08-06-2014 09:38 AM
Hello,
I am new with labview and I am trying to connect WAGO controller with LabVIEW 13 through modbus protocol via TCP/IP. Now, the question is how can I have multiple TCP/IP connections in the same LabVIEW project but different VIs? I am using MB ethernet master query.vi to write and read registers. Any suggestion would be very helpful to me.
Thanks and Regards
08-07-2014 09:38 AM
"can I have multiple TCP/IP connections in the same LabVIEW project but different VIs?"
short answer: yes. You just need to make sure that you manage the ip and port constraints and you should be a-ok...
I've done this before using multiple acromag boards that use modbus in the same project/application. I used LVOOP where each acromag had its own class and managed its own modbus session.
-pat
08-08-2014 04:30 AM
Thanks for your reply Pat!
as you said you used multiple Acromag boards in your system but in my application I have only one WAGO controller so requirement would be to have multiple TCP connections with same port number and same IP address. Sorry for not clearifying in the first post!
08-08-2014 05:16 AM
08-08-2014 12:16 PM
Instead of having multiple VIs in the same program that all establish a connection to the same unit, it would be much better to have a single VI in its own loop that is responsible for all modbus communication, and then feed values in and out of it (using queues, notifiers, or functional global variables as appropriate for the type of data and update frequency).
08-08-2014 03:28 PM
08-11-2014 04:13 AM
Thanks Nathan and Mike for replying.. Having a songle loop for all communication was the last option I kept in mind as I wanted to avoid using global variables and also having multiple queues or notifiers in a vI create problems sometimes. I tried using 3 queues to pass data in a same VI but not all of them were passing data so I thought of having multiple TCP connections.
08-11-2014 06:08 AM
08-11-2014 07:18 AM
Hello, Mike sorry I am really new to LabVIEW so could you please elaborate a bit about UDE to pass data?
08-11-2014 07:27 AM
if you create an event of some data type and pass it into two different process, you can register for the event in/before one process, and then generate the event when necessary in the other process, passing the data of interest to the handler.
-pat