LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Instrument I/O Assistant Help - Parsing Errors

Hello All - 

 

I am having trouble working with a TSI DustTrak DRX - which does not have its own driver so I had to make one.  At this point, all I want to do is send a command to the instrument and get an indicator to repeat what the output is.  So far no luck.

 

1) I think my driver works. The instrument is connected via ethernet. The instrument has a static IP.  In MAX when I look under "Network -Devices" it appears there. "Validate" results in a successful connection. If I click on "Open VISA Test Panel/Input/Output" I am able to enter commands (e.g., rdmn\r returns the instrument number) and "Query" and the correct answer comes up. It should be noted that the number of bytes returned for different commands are different, and also that the measurement data is always of variable length, so I often get the "Timeout expired before operation completed" error.  For a simple read instrument number command, the number of bytes is predictable, but for the measurement data, it is not, unfortunately.

 

2) When I put an "Instrument I/O assistant" on the block diagram of a new VI, and add a "Query and Parse" step with the same command (rdmn - no \r this time), I again get the expected value (or when I query the measurement, rmmeas, I get the expected output string). Again, it should be noted I get the "Timeout expired before operation completed.   VISA Status code : bfff0015" error. Once I close then reopen the Instrument I/O Assistant configuration window (though not before) I can parse the data, and the token appears as a potential output of the VI. Here I can declare the output as either String or Number.

a) If I declare the output as a string and create a string idicator, an empty string is returned.

b) If I declare the output as a number (it is "8533", so this should be OK), I get the following error (even without creating an indicator before running): "Error 1 occurred at Scan From String (arg 1) in Untitled 5:Instance:0->Untitled 5 Possible reason(s): LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @."  I know from MAX that the returned value is actuall 8 bytes: \r\n8533\r\n . So, there are no unallowed characters here. And there are no paths involved - no read/write.

 

Some other info:

1) If I send start or stop commands to the instrument in MAX or the Instrument IO Assistant, I can get the instrument to turn on/off as it should, so I'm clearly comunicating to the instrument correctly.

2) I get the same behavior if I parse the returned measurement string  - \r\n385,0.013,0.014,0.015,0.020,0.035,\r\n from MAX - as a set of numbers (that is, with "Error 1 occurred at Scan From String (arg 1) in Untitled 5:Instance:0->Untitled 5 Possible reason(s): LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.")

 

Any help would be appreciated!

 

Thanks.

 

 

 

0 Kudos
Message 1 of 5
(3,643 Views)

By the way: I'm working with LabView 2012

0 Kudos
Message 2 of 5
(3,638 Views)

Hi prof_desert,

 

Instead of using the Instrument I/O Assistant, what if you try using one of the existing VISA examples in LabVIEW. Can you get things to work if you use something like the GPIB-VISA example and do simple write/reads? You may need to look at using the lower level calls to do your communication instead of the Instrument I/O Assistant.

 

Regards,

James W.
Applications Engineer
National Instruments
0 Kudos
Message 3 of 5
(3,610 Views)

Hi James -  Thank you very much.  I actually found the problem and was able to fix by changing how the output text was parsed - the \r\n in front and back was confusing it - and making sure that I flushed the read buffer after reading, just in case. I also had to modify so that the first character was read and discarded before reading (and using) the rest of the output string.

 

Now for a rookie question:  I've got it set up as a working VI now - how do I declare which variables are inputs and outputs when I put it in another vi?

 

Thanks.

0 Kudos
Message 4 of 5
(3,601 Views)

The connector pane (conpane) (square box containing other boxes immediately left of icon on front panel) is where you connect controls and indicators for input and output.  Use the wiring tool. Click on a box in the conpane then click on the control or indicator you wish to connect to that point.

 

Lynn

0 Kudos
Message 5 of 5
(3,590 Views)