Author Topic: how to make multi pages with the same modbus drive  (Read 1200 times)

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
how to make multi pages with the same modbus drive
« 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

oqapsking

  • Full Member
  • ***
  • Posts: 178
    • View Profile
Re: how to make multi pages with the same modbus drive
« Reply #1 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?

betilly

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
Re: how to make multi pages with the same modbus drive
« Reply #2 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.
« Last Edit: March 13, 2017, 04:43:27 AM by betilly »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: how to make multi pages with the same modbus drive
« Reply #3 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

EE_Kraig

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: how to make multi pages with the same modbus drive
« Reply #4 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.