Author Topic: Enabling/Disabling Second ModbusTCP driver with button click  (Read 2543 times)

nickromano07

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hello!  I am creating a UI for a test set where one ModbusTCP (ModbusTcpCom1) driver is always communicating to the controller and on a separate form a second ModbusTCP (ModbusTcpCom2) driver will have its IP configured by the user via a label and be able to enable/disable ModbusTcpCom2 with a button click. This is so that while the form is open but the ModbusTcpCom2 is not needed the application won't send out communication errors.
Changing the IP address was easy enough and that part works fine but I can't seem to enable/disable the second com.

This is my first time using this forum and it seems to be a wealth of knowledge and if anybody can point me in the right direction...........

Thank you!!

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5269
    • View Profile
    • AdvancedHMI
Re: Enabling/Disabling Second ModbusTCP driver with button click
« Reply #1 on: July 21, 2015, 06:55:51 PM »
Setting DisableSubscriptions property to True will disable the updating of controls and subscriptions.

Darrell

  • Full Member
  • ***
  • Posts: 198
  • Electrician / PLC Technician
    • View Profile
Re: Enabling/Disabling Second ModbusTCP driver with button click
« Reply #2 on: July 21, 2015, 08:29:05 PM »
This maybe of some use to someone , I've done this on a few forms for checking modbus addresses,  4 buttons and a textbox , I set the Disable Subscriptions for the driver to true so the form will not be communicating when the form is first loaded,  I click the connect button when I want to start.

(Get Modbus Driver IP Button)   This will get the driver IP and display it in the textbox.
                                              Double Click on button and add this Code:   
Code: [Select]
TextBox1.Text = ModbusTCPCom1.IPAddress
(Change Modbus Driver IP Button) This will get the driver IP from the textbox and will now become your driver IP .
                                                   Double Click on button and add this Code:     
Code: [Select]
ModbusTCPCom1.IPAddress = TextBox1.Text
(Click to Connect Button) This will Disable comms for this driver 
                                     Double Click on button and add this Code:   
Code: [Select]
ModbusTCPCom1.DisableSubscriptions = "True"
(Click to Disconnect Button) This will enable comms for this driver 
                                         Double Click on button and add this Code:     
Code: [Select]
ModbusTCPCom1.DisableSubscriptions = "False"

nickromano07

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Enabling/Disabling Second ModbusTCP driver with button click
« Reply #3 on: July 21, 2015, 08:52:09 PM »
Archie / Darrell......Thank you for replying!  I forgot to mention that I was using DisableSubscription successfully,  it was bringing it back that had me stuck.
Darrell I will apply your suggestions right away and let you know!!
OUTSTANDING HMI design software!!   So many uses!
By the way I am using Arduino boards with an Ethernet shield/Modbus TCP library and I wanted to let you know as well as anybody who reads this that should you decide to use Arduino as a controller ONLY use the 32bit Due!!!  Using the 8bit (Uno/Mega2560) is a waste as the processor speed is so limited that the HMI application is very slow to respond.  As soon as I switched to the 32bit the performance is outstanding!!

nickromano07

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Enabling/Disabling Second ModbusTCP driver with button click
« Reply #4 on: July 21, 2015, 09:10:48 PM »
That did it!!  Thank you very much,  hopefully my coding exp grows to where I can return the favor!

nickromano07

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Enabling/Disabling Second ModbusTCP driver with button click
« Reply #5 on: July 21, 2015, 09:21:33 PM »
If I may ask one more....I am having trouble bringing in the purchased controls into the newest release (Digitalpanel meter blue)  The previous versions never posed a problem for me but now I am unable to correct the errors that generate,  paticularly with the "callBack" used in the DigitalPanelMeterBlue.vb