LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP WRITE FUNCTION CAUSING NOISE

Hi doc_d,

 

No worries!
For sending multiple commands, I'm assuming you're either referring to sending the setpoint to different devices or sending other commands (but similarly needing to differentiate which device it's going to). If that's the case, you can throw in a control for the unit ID string, and then concatenate the inputs to make the send commands unit ID specific.

You can do a similar thing for the data reads if you need to make them individually callable, and when you want to read all devices you can then just do a for loop over an array of the unit identifiers.

 

If you still want some cases to grab data from all devices or if you want to add more functions, you can always add more cases.

 

In trying to explain that the different commands will have different potential return data lengths, and ways to overcome that, I figured the easiest way would be to just send over the example I made using this as the TCP read with arbitrary termination characters (CR in the case of the Alicat devices) - https://forums.ni.com/t5/Example-Code/One-alternative-to-efficiently-handle-TCP-reads-of-unknown/ta-.... I can't test that it works as intended as I don't have a TCP converter, but it seems like everything's set up as it should be. Source is LV2018, so it should be readable if you have a copy of 2018+ but I can add screen snippets if needed.

Kevin Gudenkauf
Test Engineer
kevin@alicat.com
7641 N. Business Park Drive
Tucson, AZ 85743 USA
Phone (520) 290-6060
www.alicat.com
Message 11 of 14
(668 Views)

@doc_d  ha scritto:

Thank you for your reply. Yes, they have support for labview drivers and vis but I could not find one matching with my requirement because I am using  USR-TCP232-302 for which there are no drivers or VIs available.


USR-TCP232-302 is an Ethernet Serial Server. You may download and run the USR-VCOM (or equivalent) program that allows you to set up a virtual serial port. Then, I guess, you can use the Alicat drivers.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 12 of 14
(647 Views)

"USR-TCP232-302 is an Ethernet Serial Server. You may download and run the USR-VCOM (or equivalent) program that allows you to set up a virtual serial port. Then, I guess, you can use the Alicat drivers." 

Is this possible, Sir?

0 Kudos
Message 13 of 14
(605 Views)

Thank you for your suggestion If this approach works It will save my time. 

0 Kudos
Message 14 of 14
(604 Views)