LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Read Frame Error

Hello,

I am writing a PC-Driver for an Heraeus-Vötsch HT 4020 with Labview. I got a Datasheet who says that command to control the Thermal Chamber have to look like this in ASCII:

$00E\s0020,0\s0020,0\s0020,0\s0020,0\s0020,0\s0070,0\s11110000\r

then the Chamber has to send me:

0\r

after that I send the next command, to get the current values:

$00I\r

and the response from the Chamber has to look like this:

0020,0\s0020,0\s0020,0\s0020,0\s0020,0\s0020,0\s0020,0\s0020,0\s0020,0\s0020,0\s0070,0\s0070,0\s11111111111100000\r

but I only get an frame Error from the Visa Read, when I want to have the first response (0\r) from the Chamber.

Could You please tell me, where my mistake is?

I attached the Labview File.

Here is also a Link for the Datasheet (start at Page 7):

http://forums.ni.com/ni/attachments/ni/140/44043/1/PROTOCOLE%20RS%20232.pdf

 

Kind regards

RubertIV

Download All
0 Kudos
Message 1 of 8
(3,804 Views)

A couple of things I noticed:

 

1) You are using the literal strings "\r" and "\s" (2 characters each - a \ and r or s) instead of sending the return and space characters (a single character) respectively. If you right click your string constants and change to '\' codes display then put in the "\r" and change the display back you'll see the difference.

 

2) You are using a termination character and yet you are also using 'read bytes at port' - if you are using a termination character then you should read until either you get one or you get a timeout and not use the bytes at port property at all.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 8
(3,796 Views)

Hello Sam_Sharp,

 

1. Ok, I saw the difference and correct it.

2. I did it with a While-Loop, till the 0<CR> comes. But its impossible to use 'Bytes at Port', how I say to the Visa Read how many Bytes it have to read?

0 Kudos
Message 3 of 8
(3,782 Views)

"VISA Read Function

This function might return less than the number of bytes requested if the function reaches the end of the buffer, reaches a termination character, or if a timeout occurs. The output error cluster indicates if a timeout has occurred."

 

Just put a large number in the 'byte count' (i.e. more than you expect to receive for a single command - 1000 bytes?) and the read node will wait until you receive the termination character you have configured (0x0A) or it times out (10s in your case). If that doesn't work, it might be because the datasheet specifies a termination character of \r (0x0D) instead of \n (0x0A) at the end of the command so you should use that as the termination character.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 8
(3,772 Views)

Walfischdreck, I already did this before.

Then I recieve the Timeout Error.

But before I recieve this massage from the Chamber:

\00\00 (I can only see it with the /-Code View)

0 Kudos
Message 5 of 8
(3,768 Views)

Well I'd imagine that you would need to be sending the right commands (after the "\r" confusion) and also with the right termination character. If it still times out after those are corrected then that means nothing was received - either you're sending an incorrect/malformed command to the device and it isn't responding or maybe you have another configuration/setup issue (e.g. baud rates, wrong cable etc.).

 

Have you tried talking to the device from another piece of software to make sure you can send/receive commands to it without LabVIEW? (e.g. using a serial console / manufacturer supplied software)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 8
(3,746 Views)

I'll try it today.

0 Kudos
Message 7 of 8
(3,734 Views)

The Chamber is broken. I will call the Service from the Producer and contact you when its working.

0 Kudos
Message 8 of 8
(3,723 Views)