Hi all,
I'm very new to Labview and I'm working through various videos and training courses. I believe I have LabviewNXG and NIVISA 20 installed correctly but I have found that a bit confusing.
I have 4 instruments connected through USB to my Windows 10 Pro laptop. These appear as USBTMC devices. In NI Max (and SystemDesigner) I can see these 4 devices and I can use the VISA test panel to send SCPI commands to each of them successfully. The HMC4083 (PSU) does require a \n terminator on a command to work correctly, the other instruments do not.
In LabviewNXG I opened the VISA Simple Query.gvi example which can be used to send a SCPI command to a named test instrument. This works for 3 of my test instruments without a problem. The HMC8043 is sent a command (*IDN?\n) and I see a message pop up on the device's UI to tell me it has received it (the specific identification command.) The read always results in a timeout error.
I have tried amending the Instrument profile in the .gvi project to set "Termchar EN" to true and use the TermChar (I don't know what to hook that too but it defaults to \n.) I've pasted an image below. This doesn't impact the other 3 instruments but the HMC8043 still has a timeout error on the read.
There is a white paper provided by Rohde & Schwarz which has this to say:
*Note4 - Termination Character '\n'
'\n' is a Linefeed (LF) termination character, hexadecimally represented as 0x0A. It serves as message termination character.
In case of RawSocket and Serial connection, for VISA Write operations you always have to terminate strings with the LF character, because that is the only way to tell the instrument that message has ended. To recognise the end of the response in VISA Read operations, you need to set the VISA attributes VI_ATTR_TERMCHAR_EN to TRUE and VI_ATTR_TERMCHAR to 0x0A. Otherwise, although VISA Read receives correct response, it finishes with timeout error since it still expects more bytes to arrive.
Some instruments require the LF regardless of the connection type. In any case, sending the message with the LF at the end is the most universal and always works properly.
According the SCPI standard, instruments must terminate responses with LF. In our example above, notice the LF at the end of the identification string response in the NI Visa Test Panel. RsVisaTester does not display white characters, but you can see them in the RsVisaTraceTool log.
I don't know if NI Visa automatically handles the TermChar as it works with the HMC8043 irrespective of any IO settings. I've attached an image of the IO settings and the commands work irrespective of the Enable Termination Character setting.
Gut feel tells me it's a simple setting in my VI project but I've searched and tried various properties in the Instrument Node but to no avail, and now I'm lost for other things to try.
Thanks
Andrew