AdvancedHMI Software
General Category => Support Questions => Topic started by: oqapsking on March 13, 2017, 04:07:44 AM
-
hello
i need to no how to use the same driver component for multi pages
which means
when i put the drive on the main form
i can use it on the other pages
and choose it
with thanks
-
i used this way to make it happen
i add onther modbus to the new page
and on the form load i wrote this code
Private Sub Monitor_Load(sender As Object, e As EventArgs) Handles MyBase.Load
ModbusTCPCom1.IPAddress = MainForm.ModbusTCPCom1.IPAddress
ModbusTCPCom1.TcpipPort = MainForm.ModbusTCPCom1.TcpipPort
End Sub
is there another way?
-
You can just add new windows form Project->Add windows form. Then from toolbox drag modbus driver to your new form. Click on ModbusTCPCom1 driver below, you can see ModbusTCPCom1 properties in the right down corner. There you can set ip and port. In this case you dont need to write any code.
-
You can also use an INIFile to give all of your drivers the same settings. See this:
http://advancedhmi.com/documentation/index.php?title=INI_File_Usage
-
If you're not familiar, check out the TabControl in VisualStudio. I decided to use that rather than multiple forms. Not saying it's better, just an option.