Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout error when reading a non standart sensor

Hello everybody.

I'm having trouble reading a sensor through the serial port. I can read through a MATLAB script, provided by the sensor developer, but when I try to read through LabVIEW I get an error message referring to timeout.


Error -1073807339 occurred at VISA Read in Untitled 1

Possible reason(s):

VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.

 

On line 26 of the script is the command to read the sensor characteristics as specified Header 170 header 85 slave ID 1 function code 16 service 1 CRC hi 176 CRC 20 The expected correct answer is a 368x1 vector of double

 

Glad for any help.

 

Tanks in advance.

Download All
0 Kudos
Message 1 of 4
(1,508 Views)

Hi

 

You did almost an OK job. 

But you probably have to use enable end char so it stops on a received linefeed.

Because that is what I read in Matlab.

And because of the end char as defined as CR/LF I think you have to add that to the string to be sent.

 

Finally you have in the disabled node an array of I32 but that should probably be an array of U8.

 

Good luck

I added a vi of how it would look at my place without all the stuff not really needed. But I'm not sure.

greetings from the Netherlands
0 Kudos
Message 2 of 4
(1,495 Views)

Hello Albert. Thanks for your reply.

 

I eventually did the communication to work. In a moment of epiphany, I created a typecast from a U8 array to a string and send it to the COM port. It did the magic!

Curiously, it works with and without the CR/LF as TRUE.

 

I attached the working VI. Now I need to implement the other functions, i.e., for sensor configuration and for data acquisition. This one just get the sensor information.

 

I had the chance to know Amsterdam and Eindhoven, beautiful cities and country.

 

Once again, thanks for your time.

Greetings from Brazil.

0 Kudos
Message 3 of 4
(1,433 Views)

Thanks for reporting.

Instead of a typecast you also can use the byte array to string conversion. It works the same as your typecast. In fact a u8 array and a string are almost identical. Just not for the compiler.

 

Good luck, nice that you found the solution yourself.

greetings from the Netherlands
0 Kudos
Message 4 of 4
(1,417 Views)