Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Archie

Pages: 1 ... 5 6 [7] 8
91
Open Discussion / Linux Mint and AdvancedHMI
« on: February 12, 2015, 09:33:47 PM »
For those that like to experiment, I found that it is very easy to run an AdvancedHMI application on Linux Mint with Cinnamon. After installing be sure to have an internet connect and then enter this in a command prompt:

sudo apt-get install mono-vbnc

Mono is already part of the package, but needs the visual basic library (vbnc)

You can then execute an AdvancedHMI application like this:

mono AdvancedHMI.exe

92
Support Questions / Version 3.97e breaking changes
« on: January 28, 2015, 02:29:43 PM »
Version 3.97e has some modifications to the MessageListByValue that will generate errors if updating from a previous version. These errors will show up in the designer.vb code. You can simply delete the lines with the errors pertaining to HighlightKeyCharacter and related properties

93
Support Questions / Who has run applications long term?
« on: January 25, 2015, 05:19:17 PM »
A question has come up about long term stability of AdvancedHMI. I personally have quite a few applications out there that run 24/7 without a restart/reboot except in cases when the facility loses power.

What experiences have others had with long term running of an application? I know the latest version is only days old, so if you have an app to mention also note the version number.

94
Tips & Tricks / Build a gage with the AnimatedPictureBox
« on: January 11, 2015, 08:01:18 PM »
The AnimatedPictureBox can be a bit overwhelming initially, but it has a lot of flexibility. This sample will show how to create a custom gage without the need for any code writing.

1) Add an AnimatedPictureBox to your form
2) Set the Size property to 200,200
3) Download the 2 attached files
4) On the BackgroundImage property, select and click the ellipses (button with 2 dots)
5) Click the Import button on the window to pops up
6) Browse to and select the RoundMeterBackground.png that was download in step 3
7) Make sure BackgroundImageLayout is set to Stretch
8) Go to the Image property, select and click the ellipses (button with 2 dots)
9) Click the Import button on the window to pops up
10) Browse to and select the RoundNeedle.png that was download in step 3
11) Set both ImageSizeXValue and ImageSizeYValue to 0.5, this will size the needle appropriately
12) Set the ImageTranslationYValue to 25
13) Expand down ImageRotationScale and set these values
           RotationCCWAngle -43
           RotationCWAngle   43
           RotationMaxValueCW 100
           YPosition 100

14) Set PLCAddressImageRotationValue to a valid PLC address


You should now have a meter that has a range from 0-100

95
Open Discussion / Bot Registration Flood
« on: December 14, 2014, 10:54:26 AM »
It seems the bots have figured out how to register on the forum. This required deleting a large number of users. If your account was deleted, it was by pure accident and I apologize. Please register again.

96
Tips & Tricks / A Colorful Progress Bar / Bar Level
« on: December 09, 2014, 08:32:20 PM »
There are a number of free example custom controls around the internet that are easy to add to an AdvancedHMI solution. One example can be found here:

https://code.msdn.microsoft.com/Custom-Colored-ProgressBar-a68b61de/view/Reviews

To add this to your AdvancedHMI project follow these steps:

1) Right click the PurchasedControls folder in the AdvancedHMIControl project in Solution Explorer
2) Select Add Class
3) Give it the name ProgressBarEx
4) Delete the two lines of code
5) Copy all of the code from the web link above and paste into the new class

At this point you can Build the project and you should get a ProgressBarEx in your Toolbox. The ProgressBarEx is now a simple windows form control. We now need to make this into an AdvancedHMI control.

1) In the Controls folder of the AdvancedHMIControls project in Solution Explorer, right click BarLevel and select Copy
2) Right click the Controls folder and select paste
3) Right click the new file (Copy of BarLevel.vb) and select rename
4) Change the name to ProgressBarExHMI.vb
5) Right click the new file and select View Code
6) About 26 lines down, if neceaary, change the name from BarLevel to ProgressBarExHMI
6a) About 27 lines down you will see the code  Inherits MfgControl.AdvancedHMI.Controls.BarLevel
7) Change this to Inherits ProgressBarEx
8 ) You will get 3 errors because the ProgressBarEx does not have a ValueScaleFactor property. This is resolved by deleting the overridden property of Text. Delete all of this code:
Code: [Select]
    '******************************************************************************************
    '* Use the base control's text property and make it visible as a property on the designer
    '******************************************************************************************
    <System.ComponentModel.Browsable(True)> _
<System.ComponentModel.DesignerSerializationVisibility(System.ComponentModel.DesignerSerializationVisibility.Visible)> _
    Public Overrides Property Text() As String
        Get
            Return MyBase.Text
        End Get
        Set(ByVal value As String)
            If m_Format <> "" And (Not DesignMode) Then
                Try
                    MyBase.Text = Format(CSng(value) * m_ValueScaleFactor, m_Format)
                Catch ex As Exception
                    MyBase.Text = "Check NumericFormat and variable type"
                End Try
            Else
                '* Highlight in red if an exclamation mark is in text
                If InStr(value, "!") > 0 Then
                    If MyBase.BackColor <> _Highlightcolor Then SavedBackColor = MyBase.BackColor
                    MyBase.BackColor = _Highlightcolor
                Else
                    If SavedBackColor <> Nothing Then MyBase.BackColor = SavedBackColor
                End If

                If m_ValueScaleFactor = 1 Then
                    MyBase.Text = value
                Else
                    MyBase.Text = value * m_ValueScaleFactor
                End If
            End If
        End Set
    End Property
9) Build the Solution

You should now have a ProgressBarExHMI in your Toolbox

97
Open Discussion / Omron Drivers and Micro800 Series Driver
« on: November 10, 2014, 03:29:17 PM »
Version 3.81 is now available and includes drivers for many Omron PLCs

OmronEthernetFINSCom - Ethernet for newer PLCs such as CP1H
OmronSerialFINSCom - Serial communication for newer PLCs such as CP1H
OmronSerialHostLink - Serial communication for C200 series PLCs

A modified version of the EthernetIPforCLX driver has been added that can read/write tags in an Allen Bradley Micro820 and Micro850

98
Tips & Tricks / Enhancing Existing Controls (version 3.80)
« on: November 01, 2014, 06:02:59 PM »
One of the new features in Version 3.80 is a control architecture change that allows very easy addition of PLCAdress**** properties.

The way the PLCAddress properties work is by subscribing to the PLC Address specified, then using the returned value to put in the controlled property. The controlled property is the name following PLCAddress name. For example, in a DigitalPanelMeter, the Value property specifies what to display on the meter. Therefore the PLCAddressValue property can be used to specify a PLC Address of where to get the value to put in the Value property.

So now let's say you want to control the decimal on the DigitalPanelMeter using a value in the PLC. The decimal is controlled with the DecimalPosition property. The key to this is to get a value from the PLC to go into that property. Version 3.80 has drastically simplified this The way to do this is to create a property named PLCAddressDecimalPosition. The new controls will parse the property name to see if it starts with PLCAddress and followed by the name of an existing property. If so, it will automatically subscribe to the PLC.

To create this property it takes one line of code.

- Open the DigitalPanelMeter.vb found in the AdvancedHMIControls project.
- Go to the Region of "PLC Related Properties and add this code as the first line in the Region:
Code: [Select]
    Public Property PLCAddressDecimalPosition As String
-Build the Solution
-Add a DigitalPanelMeter and you should see the new property of PLCAddressDecimalPosition

99
Tips & Tricks / Launching Application via PLC Value
« on: October 07, 2014, 07:31:26 PM »
Sometimes you need to launch an application on a PC when a value changes in the PLC. This is fairly easy to do in AdvancedHMI.

1) Add your driver and set the properties
2) Add a DataSubscriber to the form and set PLCAddressValue to the register/tag that you want to use to launch an application
3) Double click the DataSubscriber to get back to the code
4) Add the following code, which assumes you are using a Boolean value from the PLC
Code: [Select]
    Private Sub DataSubscriber1_DataChanged(sender As System.Object, e As MfgControl.AdvancedHMI.Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
        If e.Values(0) = "True" Then
            System.Diagnostics.Process.Start("C:\Windows\Notepad.exe")
        End If
    End Sub

5) Run the application and toggle the bit in the PLC you specified in the DataSubscriber.

Each time the bit goes True, Notepad should start up

100
Tips & Tricks / Very Simple Data Logging
« on: September 19, 2014, 08:20:37 AM »
Quite often it is necessary to temporarily log some values to a text file with a time stamp. This is very easy to do with just a few lines of code:

1) Add a driver (e.g. EthernetIPforCLXCom) from the Toolbox to your form and set it's properties
2) Add a Timer, set the Interval to the sampling time in milliseconds (500 for 1/2 second)
3) Set the Enabled property of the timer to True
4) Double click the timer to get back to the code
5) Add the following code to read the value and write it to a text file
6) Run the application.

Code: [Select]
    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        '* Retreive the value from the PLC
        Dim Value1 As String
        Try
            Value1 = EthernetIPforCLXCom1.Read("MyTag")
        Catch ex As Exception
            MsgBox("Failed to read")
            Exit Sub
        End Try

        '* Create a file writer that will append
        Using sw As New System.IO.StreamWriter("LogFile.txt", True)
            '* Write the data with a time stamp
            sw.WriteLine(Now & " - " & Value1)

            sw.Close()
        End Using
    End Sub

101
Tips & Tricks / More than just PLCs
« on: September 12, 2014, 09:58:54 PM »
Many devices support ModbusRTU communications. With the ModbusRTU driver you can use AdvancedHMI with more devices than just PLCs.

I successfully tested this with and AutomationDirect temperature controller (SL4824). I used the AutomationDirect USB to RS485 adapter (USB-485M) to connect a PC to the temperature. After changing a few communication settings in the temperature controller, I was able to display Set Point and Actual Temperature in AdvancedHMI.

Soon I will test this with an AutomationDirect servo drive to see if I can control a servo without a PLC.

102
Support Questions / TwinCAT with ModbusTCP using CX8000
« on: August 24, 2014, 02:32:03 PM »
Just for a reference I wanted to post this information. I tested this with a CX8090 using flash card image version 353e

First off, this flash card version now allows the CX to work with the TwinCATCom driver which allows you to use variable names directly. This would be the preferred method. However I wanted to share how to use the ModbusTCP driver also.

The main bit of information I want to share is how a TwinCAT address converts to a Modbus address. Here is a sample variable that I created in TwinCAT:
Code: [Select]
VAR
ModbusOffset12288 AT %MW0 : WORD;
END_VAR

To show the value of this variable add a BasicLabel on the form and set the PLCAddressValue to 412289 (notice it is one higher than the offset, that's a typical modus thing).

The next TwinCAT address of %MW2 would be referenced by Modbus Address 412290. Notice that TwinCAT offsets are by byte and Modbus is by word, hence you add 2 to the Beckhoff address, but only add 1 to the Modbus address.

103
Application Showcase / AdvancedHMI Videos
« on: July 14, 2014, 07:59:03 PM »

104
Additional Components / Adding Custom Controls (Aqua Gage)
« on: September 04, 2013, 08:55:26 PM »
Creating custom controls for AdvancedHMI from scratch can be an advanced exercise requiring some extensive knowledge of .NET.  However, incorporating an existing .NET control into AdvancedHMI may be easier than you think.

All AdvancedHMI visual controls start out as a standard .NET WinForm control that is inherited into a new control that adds the functionality that links it to the communication driver. The following is a walk-through showing how to take the attached AquaGage control and incorporate it into an AdvancedHMI project.

Adding The Class Library to AdvancedHMI
1) Download and unzip the attached Visual Studio Solution (AquaGageDemo.zip). The solution includes a class library with a single custom control.
2) Open an AdvancedHMI project
3) In the Solution Explorer right click the Support directory in the AdvancedHMI project
4) Add->Existing Item
5) When the Add Item window opens, change the file filter to All Files(*.*)
6) Browse to where you unzipped the AquaGage project and browse to and select \AquaGage\bin\Debug\AquaGage.dll
7) Click the Add button to add this file to the AdvancedHMI project

Adding a Reference To The Class Libary
1) Now the DLL class library file should be in the Support directory
2) In Solution Explorer, right click AdvancedHMI project and select Add Reference
3) When the Add Reference window opens, select the Browse tab
4) Browse into the Support directory and select the AquaGage.dll file

105
Application Showcase / Main Screen of Roll Forming Machine
« on: August 23, 2013, 11:47:44 AM »
This was the main screen of a machine used to roll form seals. It has others screen for creating parts and storing them in an Excel spreadsheet.

Pages: 1 ... 5 6 [7] 8