LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication with non-SCPI device

Solved!
Go to solution

I am trying to automate a PTW Unidos Webline Dosemeter (electrometer). In the communication protocol "PTW" is the same as "*IDN?" but when I send this command (or any other) I get an E;16 error, which means "command too long." I'm wondering if LabVIEW is including some extra formatting characters that are not visible in the string. I'm using a very simple serial VI that works fine with a Kiethley Electrometer (using SCPI commands). The fact that I get an error message from the Unidos leads me to believe that the port is configured properly but the command is not properly formatted.

Any thoughts?

 

 

0 Kudos
Message 1 of 14
(3,199 Views)

Well without seeing your code we can only guess...

 

But VISA could be putting a Termination Character on the end of every command sent that your instrument does not like. 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 14
(3,187 Views)

Hi Joshua38,

 

You can check for extra characters by right-clicking the string control and selecting "'/' codes display". This will make any format characters visible.

 

Are you using one of the serial examples? If so, which one?

 

If not, can you provide your code and/or try the simple serial example and see if that produces better results (Help >> Find Examples and then search for serial)? By default, the example sends *IDN?, but you can easily replace this with your PTW command. I suspect that you just haven't configured your serial settings correctly (data bits/ stop bits or something - I'd expect a different error if your baud rate was set incorrectly). It's hard to say without seeing any code.

Regards,
0 Kudos
Message 3 of 14
(3,179 Views)

Thanks for the quick responses. I am using the "simple serial vi" provided in the LabVIEW example folder. I assumed this was a familiar piece of code. The only thing I changed was the command.   

0 Kudos
Message 4 of 14
(3,165 Views)

Josh,

 

I want to dive into this error more. The typical LabVIEW serial error codes can be found here and there isn't anything for "command too long" Is the error you're reporting on the LabVIEW error chain or this a reply from the device you're trying to talk to? If it's a response from the device, you'll want to check your device documentation for information on that error. You may need to chunk up the transmission or something if the receiving device has some limited input buffer or some static expectation of receive size, which should be documented somewhere.

 

If the error is coming through the LabVIEW error wire, can you provide a screen shot (or at least the exact error code) that is reported?

Regards,
0 Kudos
Message 5 of 14
(3,155 Views)

Well as you can see the Simple Serial example is putting a Line Feed (\n) at the end of the command.  Also the VISA Configure Serial Port has it's Enable Termination Character unwired so it will default to True and append another Line Feed (\n) to your command.

 

SimpleSerial.png

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 14
(3,152 Views)

Yikes, the website mentions UDP over serial.  That's out of my league.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 14
(3,146 Views)

Bill, it's serial over UDP. It sets up a UDP connection that sets up a virtual COM port so that you can use any terminal program to communicate with it.

 

Joshua, do you have any links to the serial protocol documentation? Can't seem to find anything on their website. I'd expect the others mentioning the termination characters are correct but we can't confirm without seeing specs on the protocol they have set up.

0 Kudos
Message 8 of 14
(3,135 Views)

Andrew,

 

The response is coming from the instrument. No LabVIEW errors. I'll keep digging through the PTW documentation. All I can find so far is that error code "E;16" means "command too long" so I'll check the terminating character to see if that is the culprit. Thanks again for your advice. 

0 Kudos
Message 9 of 14
(3,118 Views)

OK, I have tried removing the "\n" and wiring a "false" constant to the "enable terminating character" terminal, but that didn't solve the problem.  

0 Kudos
Message 10 of 14
(3,117 Views)