AdvancedHMI Software

General Category => Support Questions => Topic started by: oqapsking on March 13, 2017, 04:07:44 AM

Title: how to make multi pages with the same modbus drive
Post 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
Title: Re: how to make multi pages with the same modbus drive
Post by: oqapsking on March 13, 2017, 04:16:15 AM
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

Code: [Select]
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?
Title: Re: how to make multi pages with the same modbus drive
Post by: betilly on March 13, 2017, 04:40:26 AM
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.
Title: Re: how to make multi pages with the same modbus drive
Post by: Archie on March 13, 2017, 06:33:41 AM
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
Title: Re: how to make multi pages with the same modbus drive
Post by: EE_Kraig on March 14, 2017, 01:57:44 PM
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.