NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication Issue - LabVIEW packed library, Used in TestStand Scripts

Solved!
Go to solution

Hi,

I have developed a RS422 driver in LabVIEW while does basic operation like Initialize, Read, Write, Close etc. Later I used it as a packed library in TestStand scripts.

The issue is, when I try to read response for one of the command, I am able to observe it in the 6th iteration of read step, where I am supposed to read it for the first time.

 Please suggest any ideas about what might be the reason.

0 Kudos
Message 1 of 3
(4,318 Views)
Solution
Accepted by topic author phani_HS

 

You need to find out if response data is really coming that late after giving command or the VI that you have written is not able to capture the correct data.

 

If you have a  RS 422 logger or bus analyser  then it will be easy to analyse the cause.

 

Since you are able to read it on the 6th read step few questions :

Are you always able to read it on the 6th read only? If yes then probably the target UUT is responding slowly for this command or it is sending too many junk data which is read by first 5 reads. (depends on your read algorithm).

 

The read vi should be written such that it will be in a loop ( with some time out) until it gets the required data.The time out should be configurable.

Also before you send the command you should ensure that the read buffer is empty (flushed out).

 

Hope this helps.

 

Ravi

Message 2 of 3
(4,305 Views)

Thank you Ravi,

 

This helped me a lot, last suggestion worked out for me.

 

I cleared the buffer and able to get the expected output for a single read now. It might be because of the earlier operations in the script that causing the issue.

 

Thanks once again.

Phani

0 Kudos
Message 3 of 3
(4,291 Views)