08-10-2023 05:00 PM
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.
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.
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.
Solved! Go to Solution.
08-10-2023 06:06 PM
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:
08-11-2023 08:40 AM - edited 08-11-2023 08:47 AM
I've tried that and it still won't send the termination character.
When I check the message being sent with wireshark, I get this, termination character is missing (6 bytes).
Comparing the same message when I use VISA interactive terminal ($T00R*\04), I get 0x4 at the end sent to the device (7 bytes):
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.
08-11-2023 09:12 AM
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.
08-11-2023 09:38 AM
Thank you, this works, I'd have to write a subvi to concatenate term character to command string. Kudos.