Free AdvancedHMI has been Updated - Now with Ethernet/IP driver

Windows Controls

Hey There,

I've been using Advanced HMI for a while now controlling prototypes I've been developing with Micrologix and SLC's. Due to this my VB skills have improved 10 fold (sweet!). So first off thanks Archie.

Now for the question... Is it possible and if so can I use windows controls with the HMI and not just the controls that comes with Advanced HMI? If you could point me towards any particular reading materials/tutorials or just want to tell me I'd appreciate it a lot.

Go raibh maith agat.
 
Now for the question... Is it possible and if so can I use windows controls with the HMI and not just the controls that comes with Advanced HMI? If you could point me towards any particular reading materials/tutorials or just want to tell me I'd appreciate it a lot.
It's good to hear that you are finding the software useful.

With a little bit of VB code, you can use the standard controls. For example, if you wanted to use the standard Button that is part of Visual Studio:

1) Be sure a PLC driver has been added to the form.
2) Add a Button to the form
3) double click to get to the code
4) Add this line of code to the event:
DF1Comm1.WriteData("B3/0",1)

The assumes that you are using the DF1Comm PLC driver.
 
Oh so simple! can;t believe I didn't think of that myself, cheers Archie.

One more thing, in relation to post #46 I was wondering if you could share that code with me or give me your thoughts on implementing database's, I've recently done a couple of applications in VB with SQL and am keen on getting better at it. Considering that PLC programming is my core job it would be efficient to develop my SQL skills with PLC programs.

Go raibh maith agat.
 
One more thing, in relation to post #46 I was wondering if you could share that code with me or give me your thoughts on implementing database's, I've recently done a couple of applications in VB with SQL and am keen on getting better at it. Considering that PLC programming is my core job it would be efficient to develop my SQL skills with PLC programs.
Unfortunately a database example would not be very easy to do in a single post. I really need to make a video showing the process. If you search the internet for information on Data Sets, Table Adapters, and Data Tables, that will get you pointed in the right direction.

Just to give you an idea, here are some snippets of code for storing to a database:
Code:
'* Declare the table adapter and table
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ProductTableAdapter [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TillerLineDataSetTableAdapters.ProductNumbersTableAdapter[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ProductTable [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]New[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TillerLineDataSet.ProductNumbersDataTable[/SIZE]
Code:
'* Declare the row of data to store in the table
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PNRow [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] TillerLineDataSet.ProductNumbersRow[/SIZE]
Code:
'* create a new row and populate
[SIZE=2]PNRow = ProductTable.NewRow[/SIZE]
[SIZE=2]PNRow.ProductNumber = ModelNumber(i)[/SIZE]
'* Add the row to the table in memory
[SIZE=2]ProductTable.AddProductNumbersRow(PNRow)[/SIZE]
'* Write the table modifications to the database
[SIZE=2]ProductTableAdapter.Update(ProductTable)[/SIZE]
 
Thanks for that guys,

I've been looking at the "Forms over data" video series on msdn and found them very useful, they describe creating database/connecting/stored procedures/reporting etc. Should be fun using them with data from a PLC!

Anyway thanks for the info will let you know how i get on!

Go raibh maith agat
 
I don't want to jump in with a question not related to this thread, but being new to the forum please allow me some slack.

I have build a very nice PC based HMI using serial comms on a Micrologix 1000.
Now the powers that be want to spread this on the network. I will buy an ethernet card and use the ethernet driver you have kindly written, This I believe will be straight forward.

The hard part is:
could the stand alone program installed and viewed live on more than one PC.
is it possible to create a webpage to display the information? and if do what language would work? PHP, Java or something?

The data I display is simple on/off states of sensor inputs.

Many thanks in advance
 
awesome job! I am new in logic, and they know nothing about Visual Basic, but I have achieved a simple interface. The good thing is that it shows someone like me can do, and it is fun to boot!
 
The hard part is:
could the stand alone program installed and viewed live on more than one PC.

Yes, as long as they are all connected to the PLC's network

is it possible to create a webpage to display the information? and if do what language would work? PHP, Java or something?

The data I display is simple on/off states of sensor inputs.

You can use one of the above methods to move data to/from an SQL server and then have eg. PHP read/write the data from the database.
 
Mysql data logging from AdvancedHMI

For anyone who's interested this code sends values from the PLC to a MySQL Database:

Imports System.Data.SqlClient
Imports System.Data
Imports MySql.Data.MySqlClient

Label1.Text = EthernetIPforSLCMicro1.ReadAny("F16:0")
Dim SQLStr As String
SQLStr = "INSERT into xxxxxxxxxxxx(id, f16_0, t_stamp) VALUES(' ','" & Label1.Text & "','" & Now() & "')"
UpdateDatabase(SQLStr)

Private Sub UpdateDatabase(ByVal SQL As String)
Dim MySQLConn As MySqlConnection = Nothing 'The SQL Connection
Dim MySQLCmd As MySqlCommand = Nothing 'The SQL Command
Dim connStr As String = "server=xxxxx; user id=xxxxx; password=xxxxxxxxx; database=xxxxxxxxx; pooling=false"

'Write to SQL
MySQLConn = New MySqlConnection(connStr) 'The SQL Connection
MySQLCmd = New MySqlCommand(Sql, MySQLConn) 'The SQL Command

MySQLConn.Open() 'Open the connection
MySQLCmd.ExecuteNonQuery() 'Executes SQL Commands Non-Querys
only

MySQLConn.Close() 'Close the connection
If MySQLConn.State = ConnectionState.Open Then
MySQLConn.Close()
End If

Just insert the relevant timers or if statements and you should be good to go!!!

Thanks Archie, amazing code!
 
Loki,

If you use that code i put on to send the values to a MYSQL db, then you can write a simple HTML page that uses jQuery to load dynamic data from a php page every second if you wanted?

Let me know if you want the code for all the pages!!!
 
Changing PLC addresses at runtime

The Alarm grid as it currently exists has very few features. To get it to do much more than show alarms, it will require adding code to the component.

AdvancedHMI comes with all the source code, so someone that can do VB programming can customize the components.

Hello, I added code to the AlarmGrid and it went quite well, eventually! I might post it on here sometime.

What I'm trying to do now is to change the PLC address of a component at runtime. I can change the PLCaddress property and see that it has changed, but the component doesn't seem to recognise the change and just goes on reading from the original PLC address. It seems that when runtime begins, the component sets its PLC address from the PLCaddress property, and then doesn't use this property thereafter. Is this a fundamental feature of AdvancedHMI, or could it be changed by a quick alteration of code?

Thanks very much
 
What I'm trying to do now is to change the PLC address of a component at runtime. I can change the PLCaddress property and see that it has changed, but the component doesn't seem to recognise the change and just goes on reading from the original PLC address. It seems that when runtime begins, the component sets its PLC address from the PLCaddress property, and then doesn't use this property thereafter.
I have not tested this, but this simple code modification in the controls should allow you to change the PLC Address during runtime:

Code:
[SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'*****************************************[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'* Property - Address in PLC to Link to[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'*****************************************[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] m_PLCaddress [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = [/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"N7:0"[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] PLCaddress() [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] m_PLCaddress[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Get[/COLOR][/SIZE][/COLOR][/SIZE]
 
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] value [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE]
[SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]'* If PLC Address changes, then drop subscription and re- subscribe[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] value <> m_PLCaddress [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Then[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2] m_CommComponent.UnSubscribe(NotificationID)[/SIZE]
 
[SIZE=2] m_PLCaddress = value[/SIZE]
[SIZE=2] SetupDelay.Enabled = [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]True[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]If[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Set[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Property[/COLOR][/SIZE]
[/COLOR][/SIZE]
 
2 PLC,s communicating to 1 advanced HMI form

Hi Archie,

Do you know if it is possible to have 2 plc,s connected to 2 comm ports on a computer and have a set of controls on a form for each plc in advanced hmi to control each plc. I tried to do this but in the properties box of the DF1COMM1 & DF1COMM2 I could not select different comm ports.Can you help.
Thanks
 

Similar Topics

Hi everyone, I'm in search of software for electrical drawings, preferably free but also interested in paid options. Any recommendations or...
Replies
33
Views
1,589
Hello, S7-200 is installed with dot matrix printer. its printer is not working. now I have changed the printer. Problem in new printer is that...
Replies
0
Views
210
We are to develop a first application in Codesys. It will contain motion (Softmotion) with drives on Ethercat (CSP mode). Off course there will be...
Replies
2
Views
917
Just started working with some HART loops and I'm trying out Pactware.I'm using Krohne and it works just fine recognizing my modem. I downloaded...
Replies
9
Views
1,371
Hi, There's a problem I face with upgrading the OS from XP which has the Step 7 Lite installed to windows 10. As I can't use a cracked version of...
Replies
2
Views
623
Back
Top Bottom