Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Character Termination

I am currently working on a device that its termination is '\r\n' reading the documentation NI-Visa can only do single termination and there is a way around it which I saw the answer using lab view. My project is in VBA so how do I set the termination to multicharacter termination? 

 

Set instDPM5000 = New VisaComLib.FormattedIO488
Set instDPM5000.IO = ioMgr.Open("ASRL5::INSTR")
instDPM5000.WriteString ("*IDN?")
response = instDPM5000.ReadString()
Dim serInfc1 As VisaComLib.ISerial
Set serInfc1 = instDPM5000.IO
instDPM5000.IO.TerminationCharacterEnabled = True
instDPM5000.IO.TerminationCharacter = 13
serInfc1.EndIn = ASRL_END_TERMCHAR

instDPM5000.WriteString ("DPM value")

result = instDPM5000.ReadString() 

 

0 Kudos
Message 1 of 3
(74 Views)

You don't, NI VISA only allows for a single character but why not set it to terminate simply on \n? That's how things are done in LabVIEW too!

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 3
(48 Views)

As already stated, you just use the last character as the termination character. In this situation, you need to set the Termination Character to 10 (\n).



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
0 Kudos
Message 3 of 3
(34 Views)