Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB termination character using visa

Hello,

I am wondering if someone could answer a question that has been bothering me.

I am controlling a GPIB instrument that requires a CR-LF string to end writes. Without this appended to the command, the instrument will wait indefinitely. With the GPIB write VI, I could use mode 3 to append this automatically.

I am now using the VISA write command and I have not found a way to configure this automatically. I need to manually append this to each string I send (for example, I must use the command FA\r\n instead of just FA). Is there some way to configure VISA to append the CR-LF automatically using property nodes or MAX? It's not a huge deal, but just something that has been bugging me.

Thanks a lot,
jon
0 Kudos
Message 1 of 7
(4,878 Views)
Yes, there is a way. Drop a VISA Property Node (Instrument I/O>VISA>VISA Advanced), change it to write and select the properties Message Based Settings>Termination Character and Serial Settings>Serial End Mode for Writes. Wire the constant TermChar to the Serial End Mode and wire a CR/LF (in hex=DA) constant to the term character.
0 Kudos
Message 2 of 7
(4,875 Views)
Thanks for the response.

I tried this out, but the property node complains when I wire a GPIB Instr reference to it. It says "The specified attribute is not defined or supported by the referenced resource.". Did I do something wrong?

Thanks again,
jon
0 Kudos
Message 3 of 7
(4,868 Views)
After looking at my answer, I'm not sure I gave you the correct answer. I use the method I described all of the time for automatically appending a CR/LF to my serial port VISA applications and just assumed that it would work for a GPIB session. I may be wrong. If the serial term character is an invalid property for a GPIB session, then perhaps what you can do is replace all the VISA Writes with a write function that concantanates your string with the CR and LF.
0 Kudos
Message 4 of 7
(4,866 Views)
Because you are working with a GPIB instrument, setting a property node for a serial instrument should not work. Instead of enabling termination in serial settings, enable it using the Message Based Settings » Termination Character Enable property. Let me know how this goes.

Logan S.
0 Kudos
Message 5 of 7
(4,848 Views)
Hey Guys,

Actually for GPIB there is no automatic way or VISA setting that will allow you to append characters. As Dennis mentioned we do have it for serial, but not for GPIB. Enable Termination, just enables termination for reads so that a read will return when the termination character is seen. In order to always send the termination character for GPIB you will need to do what Dennis recommended and create a subVI with the same inputs as the VISA Write and just have it append the termination characters that you need to your input string.

I hope this helps out.

-Josh
0 Kudos
Message 6 of 7
(4,828 Views)
Thank you all for answering my question. As I mentioned earlier, it wasn't a big deal - I'm just glad that I wasn't missing any options that were available.

Thanks again,
jon
0 Kudos
Message 7 of 7
(4,819 Views)