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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa TCP/IP Response different in NI Max and VIs

Solved!
Go to solution

I have a EA-1 device that works OK via telnet command on my Windows 10 machine. So, all the network settings are OK.

 

I created a Visa TCP/IP (TCPIP0::169.254.1.1::23::SOCKET) resource on Max, and commands work well there as well.

 

Now I am trying to create a VI using the same resource and Visa palette VIs, and I get jumbled up response - Some bytes match, some dont. I am not sure if this is because I am using Telnet communication (Port 23), and am not handling the telnet negotiations? I dont have much background and couldn't find examples on how to address those. Any help would be appreciated. Below is some screenshots.

 

Response from NI Max as below:

Capture.PNG

 

Response from my VI:

Capture.PNG

 

Here is my simple VI

Capture.PNG

 

 

 


Kudos are the best way to say thanks 🙂
0 Kudos
Message 1 of 4
(2,344 Views)

use the IO Trace to check what's different.

0 Kudos
Message 2 of 4
(2,278 Views)
Solution
Accepted by topic author winterishere8

In Telnet, if you see that 0xFF followed by another byte, that is an option code.  They should typically be replied with an ACK or NACK of the option.  You can look up RFC854, RFC855, and RFC933 for more details.  But the 0xFF 0xFD is a "Do" option code.  That "Do" is followed by 0x24, which is an "Environment Option".  I would have to dig through other RFCs to get any more details.  But it is most likely to format your terminal.  I typically just go ahead and ACK the option code and continue on with life.

 

So in your case here, I would just do a read immediately after the Open to clear out those 5 bytes.  After that, it looks like an echoing of your command.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(2,234 Views)
I fixed it.
- I read 6 bytes after i open the connection. Apparently my devices spits out 6 bytes when connection is closed.
- I had a bug in my code where i was sending a string of hex rather than a byte array converted to string.

thanks!

Kudos are the best way to say thanks 🙂
0 Kudos
Message 4 of 4
(2,207 Views)