11-01-2017 04:56 AM
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.
11-01-2017 05:00 AM - edited 11-01-2017 05:01 AM
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?
11-01-2017 06:42 AM
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
11-01-2017 06:49 AM
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!
11-01-2017 06:58 AM
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
11-01-2017 07:01 AM
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…)