LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP communication with third party hardware

Hello

 

I am trying to get a code to communicate with a third party hardware by TCP. To start with sending strings and returning data. I have looked up some of the examples and the code should be ok. Any advise as why it is not working would be appreciated. Thanks!

Please find the VI as attached.

0 Kudos
Message 1 of 6
(1,744 Views)

Hi Cyrus,

 

Any advise as why it is not working would be appreciated.

What exactly is not working? You don't mention any problems…

Where do you have problems? Do you get error messages?

 

the code should be ok

- There is no error handling (apart from displaying an error at the end) in your VI…

- Do you really need to read just one byte to get the length of the message? Does that byte really contain a char from "0" to "9"?

- Which device are you talking to? Is there a manual for that device?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 2 of 6
(1,741 Views)

Hi GredW,

 

Standard data output format for the device is 1 byte, so that will get the length of the message 

Checking the errors after stopping the code, it says

Possible reason(s):

LabVIEW:  The network operation exceeded the user-specified or system time limit.

I am trying to communicate to a data acquisition device. I have a list of commands, but not the manual yet.

I am guessing the way I am transmitting the string data is not correct, but not sure what I need to do with it.

 

Best regards

Cyrus

 

 

0 Kudos
Message 3 of 6
(1,714 Views)

Hi Cyrus,

 

I am guessing the way I am transmitting the string data is not correct

does your device expect some EOL chars ("end of line"), like CR of LF, before it will answer to a request?

 

but not sure what I need to do with it.

Then you will have to wait for this manual!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 4 of 6
(1,707 Views)

Yes I believe so. I need to somehow joint an End of line constant to the String. What is the best way to do this?

 

thanks

Cyrus

0 Kudos
Message 5 of 6
(1,703 Views)

Hi Cyrus,

 

I need to somehow joint an End of line constant to the String.

Use ConcatString with the needed EOL constant…

 

(Hint: when you work with string constant you should always make the display mode indicator visible. It's a right-click option…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO
0 Kudos
Message 6 of 6
(1,700 Views)