10-08-2013 06:49 AM
Hello NI Team,
I'm currently developing a Plug'n'Play Instrument Driver. The driver should support the interfaces RS232 and Ethernet (TCPIP::SOCKET). I'm using the VISA pallett set.
What I want to reach: The VISA session should automatically append a line feed to every write operation for RS232 and Ethernet.
After reading some helpful comments I got stocked now.
1. http://www.ni.com/white-paper/4256/en
2. http://zone.ni.com/reference/en-XX/help/371361K-01/lvvisaprop/instr_3fff001c/
When I use the RS232 interface I can set a termination char for write and read operation's like that way:
This communication works perfectly with the termination char "line feed". In write and read operations. The visa write perfectly append the line feed ("\n") to every command.
With that I would only demonstrate how it should work.
Now switching to the interface type TCPIP:
I can also set the property "Send End En" to True. This should normally append the 488.2 end of message terminator for TCPIP sessions.
I also choosed a "Serial-TCPIP-USB/488 Strings" IO Protocol for the instrument session.
But after an VISA write operation e. g. "*IDN?" the VSIA doesn't append the line feed (\n or HEX 0A). I used wireshark to trace the tcpip packets.
The line feed ("\n" or Hex 0A) is missing after the string.
I'm woundering about that behaviour, because 1. http://www.ni.com/white-paper/4256/en desribes that "Both incoming and outgoing messages can have termination characters." Beacuse I'm using TCPIP Socket connection ("You need to tell VISA how messages are terminated only when using other VISA resource types (Serial Instr, USB Raw, and TCPIP Socket).") I configured the IO Prot for 488 commands.
But this doesn't work probably. What else should be configured?
Furthermore I found that the VISA Read STB and Trigger append the line feed. Why does the VISA Write doesn't make that?
This function append a line feed:
This funciton doesn't append the line feed:
Thanks a lot for your help
10-10-2013 08:48 AM
Hi,
thank you for the great description. I haeve no idea why it doesn't work. Unfortunately i couldn't find any documentation about such an issue.
Did you try to hardcode the line feed?
*IDN?\n
10-10-2013 11:59 PM
Hi Gregor,
Hardcoding the line feed might might be one more solution. Yes I tried that and it works satisfying.
But I woundered about the fact that a line feed could be set as termination for the serial interface, but not for an ethernet interface. And I use the same VISA components for communication... Does anyone of NI HQ America know that problematic?
Thanks a lot.
10-18-2013 04:35 AM
Hi,
I'm sorry, i could not get any further information about this. Mayby you can go through these posts:
https://decibel.ni.com/content/docs/DOC-31512
I hope this helps
03-22-2014 12:27 PM
Hi,
I am currently facing the same problem.
But, I do not want to manually append the LF ('\n') character, since I want to reuse some old code.
Did you manage to understand what the problem was?? Did you find out which setting can produce the desired outcome?
Regards,
Diogo Ribeiro
03-23-2014 10:42 AM
Hello,
I could not locate the problem of that behaviour. I made a workaround and hardcoded the /n (h0A) Linefeed into my code.
Maybe another member was faced with that problem? Im interested in any solution too.
Thanks!
03-23-2014 11:06 AM
05-03-2016 02:35 PM
I finally looked here after 3 day, this is still a problem...
VXI / LXI use EOI, thus the message terminiator is na; for "RAW SOCKET" the TCPIP is just a tranport for the rs232 message...
In my case the instrument does not support VXI / LXI, and this not inserting the termination on the write is a problem...
The following NI I/O Trace shows that even setting the "SEND_END" = True and "TERMCHAR" = 13, this does not happen...
Log shows being set, and tried twice with a clear buffer between each, then I added the "\r" as part of the message, which shows the device is happy...
Running Labview 2016 64bit f2, VISA 15.5, MAX 15.3...
copy for this message, sent to TDI to document this issue...
02-28-2019 07:46 PM
I would like to resurrect this unresolved thread (and link it to the essentially same discussion here extending back to 2008). As far as I can tell (and as far as is expressed here), there is no way to get LabVIEW to append a termination character to serial communications taking place over a TCPIP SOCKET (non VXI-11) connection. The workarounds are for all commands to be manually appended with the necessary termination, or for the user to override the VISA Write VI. These workarounds have been in place for over a decade. This makes it difficult to write code that works with minimal modification on GPIB, serial and ethernet interfaces, which is supposed to be one of the great benefits of the VISA architecture.
Assuming this accurately summarises the situation, I would like to log this as a bug, unless it is by design in which case I would like to see an explanation here so it can be found by future Googlers. Can someone from NI please provide a CAR, or the appropriate explanation.
02-28-2019 10:40 PM
@scwimbush wrote:
I would like to resurrect this unresolved thread (and link it to the essentially same discussion here extending back to 2008). As far as I can tell (and as far as is expressed here), there is no way to get LabVIEW to append a termination character to serial communications taking place over a TCPIP SOCKET (non VXI-11) connection. The workarounds are for all commands to be manually appended with the necessary termination, or for the user to override the VISA Write VI. These workarounds have been in place for over a decade. This makes it difficult to write code that works with minimal modification on GPIB, serial and ethernet interfaces, which is supposed to be one of the great benefits of the VISA architecture.
Assuming this accurately summarizes the situation, I would like to log this as a bug, unless it is by design in which case I would like to see an explanation here so it can be found by future Googlers. Can someone from NI please provide a CAR, or the appropriate explanation.
It is not a bug. The proper situation is for the programmer to explicitly put the termination character at the end of the command if he needs one. That is not a workaround. If I'm sending anything by serial, or TCP/IP, I don't want VISA in the background adding any characters to the end of the message I send. Perhaps what I send in one command is just the first part of a longer message. If I want a character sent, I'll put it in there. If I don't, I don't want one added automatically.