02-18-2026 02:55 PM
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()
02-19-2026 04:23 AM
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!
02-19-2026 06:32 AM
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).