From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
07-03-2022 10:44 PM - edited 07-03-2022 10:45 PM
Hi everyone
I have to communicate to a serial port device, and have got it work correctly in Teraterm through COM4 port
Then I have the device displayed correctly in NI-MAX, and I'm be able to send and received through COM4 port as in the sample "Simple Serial.vi"
The problem is, I got the "bytes read" number correctly, but the response itself is empty.
Can anyone have any suggest?
Solved! Go to Solution.
07-04-2022 12:58 AM
Hi knakamura,
@knakamura wrote:
I have to communicate to a serial port device, and have got it work correctly in Teraterm through COM4 port
Then I have the device displayed correctly in NI-MAX, and I'm be able to send and received through COM4 port as in the sample "Simple Serial.vi"
The problem is, I got the "bytes read" number correctly, but the response itself is empty.
Can anyone have any suggest?
The response string is not empty, there is atleast one char…
Switch that string indicator to "\-code" displaymode (or "hex") to see what you received.
Which command do you send to your device? Can you attach the communication manual of that device?
07-04-2022 03:03 AM
Hi GerdW
Thank you for your reply
I've already turned to "\-code" display mode and send this command line
/\r\n
(The command itself is "/")
I don't have the manual in English, just the Japanese instruction.
But I'm sure that the command is correct, because it runs correctly in Teraterm
07-04-2022 03:43 AM
You didn't send /\r\n but /¥r¥n
That's very different. There is no single codepage that would mix up those characters somehow since the \ character is in the lower 127 characters of the ASCII table that all codepages display they same.
07-04-2022 03:55 AM
You also get at multi line response from your device.
You need to read all the lines. VISA read will, as default, stop the reading when it sees a received \n.
07-04-2022 04:38 AM
Thank you dkfire
I managed to read correctly the response.
The solution is repeating the VISA Read command through all the lines of the response.
Thank you very much, this helped me a lot.