09-02-2008 06:05 AM
Hello,
I am trying to communicate with an IR thermometer (IRT) using LabView VISA write/read VIs via RS232. The block diagram I have created is similar to the standard Serial <-> VI provided in LabView examples.
The problem is that the IRT is not responding well to this VI. I said 'not responding well' because it sometimes acknowledges the commands written to it and sometimes doesnt. If I run the VI with the same command several times it eventually responds to the command but the number of times I have to send the command is totally random. When I operate it using hyperterminal it works absolutely fine - responding to every command the very first time. I have checked the input setting parameters such as data bits, parity, stop bits, flow control etc. - they are exactly the same for both, the hyperterminal program and the LabView VI.
I would really appreciate it if someone can point me in the right direction here.
Many thanks,
Sunil.
09-02-2008 07:07 AM
Are you sending an End-of-Line character ('\n')? Or setting the boolean to TRUE to add an End-of-line character?
Are you receiving all of the echoed data back? If you send a command, do you get a full response back as you would with HyperATerminal? or does it get truncated?
If it is truncated, then you need to read the remainder of the buffer until it is empty.. I think the Advanced - Serial communication example does that.
R
09-02-2008 08:15 AM
Can you post your communication part of your vi.Do you need to include a little delay before reading?
09-02-2008 09:15 AM
09-02-2008 09:22 AM
>>OS:533; OS:552A;
E:100; MAX:23; MIN:21; DIF:2; AVG:22; HAL:75;
LAL:0; AMB:75; PRN:4; PRNF:1; IR:23; CF:1; FF:0; LF:0;
End
The above data appears when I send 'transmit' command to the instrument (command is 'T')
>>XPRNF:0;
The above data appears when I send 'stop data transmission' command (command is 'P')
In case of hyperterminal there is no delay between writing the command and receiving the data from the instrument.
Any ideas what is going on here?
Any help would be much appreciated!!
09-02-2008 09:24 AM
You should really post your VI.
Try sending a \r\n. This is what Hyperterminal does. This may fix your write problem.
Try setting the 'enable termination character' to false. With it true, as soon as a termination character is detected, the read stops. If you have multi-line responses, you need to use VISA Bytes at Serial Port to determine how many bytes to read and keep reading until this returns 0.
09-02-2008 09:35 AM
This is what the VI looks like. I tried \r\n and setting the boolean to false but it still doesnt work!
09-02-2008 09:37 AM
09-02-2008 09:40 AM
09-02-2008 09:46 AM