LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA does not write termination character to TCP/IP resource

Solved!
Go to solution

Hello everyone, I have an issue with VISA Write. I set up an ethernet device in NI MAX and used VISA Interactive Tool to write a command to it and it works. Now, I don't know how to translate it to to LabView program. This is the command that works, the first portion is the message, including the start and the termination character is 04. 

 

Screenshot 2023-08-10 154743.png

When I attempt to replicate this in block diagram, I use exactly the same code have for Serial interface but it doesn't seem to work. The only difference is that for that code, the resource was Serial and this resource is coming from TCP/IP.

Screenshot 2023-08-10 175112.png

Any clues on how to fix it? I've tried to just write "$T00R*\04" to VISA Write without property node, combination of code with special (\n, \r, etc.) characters but it still won't work. 

 

 

0 Kudos
Message 1 of 5
(1,096 Views)

The ASRL End Out (End Mode For Writes) is a serial setting and not to be used for TCP/IP sessions.  You need to set the following Message Based Settings:

  • Termination Character = 0x04
  • Termination Character Enable = TRUE
  • Send End Enable = TRUE

 


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 2 of 5
(1,072 Views)

I've tried that and it still won't send the termination character. 

Screenshot 2023-08-11 093105.png

When I check the message being sent with wireshark, I get this, termination character is missing (6 bytes). 

rew2322.png

Comparing the same message when I use VISA interactive terminal ($T00R*\04), I get 0x4 at the end sent to the device (7 bytes):

Untitled.png

Also, when I use these setting with VISA Interactive tool and type $T00R* in Input/Output section of the same tool, it won't send terminating character either (only sending 6 bytes). This makes me think the LabView does not interpret "TermChar En" and "Send End En" commands properly.  

Screenshot 2023-08-10 113837.png

0 Kudos
Message 3 of 5
(1,025 Views)
Solution
Accepted by topic author John32d

Right-Click on that string constant and select Visible Items->Display Style. Right Click again and select '\' Codes Display.

Now enter \04 after your command. Disable the Send End Character boolean property. I never use that but send the termination characters explicitly like explained above.

Rolf Kalbermatter
My Blog
Message 4 of 5
(1,018 Views)

 Thank you, this works, I'd have to write a subvi to concatenate term character to command string. Kudos.

Screenshot 2023-08-11 103251.png

0 Kudos
Message 5 of 5
(1,006 Views)