Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

warning from serial read

I have some instrument drivers communicating with a laser controller over the serial port that I am using in a daq .vi and for some reason I am getting this annoying warning (see attached jpg) that says the reason may be " The number of bytes transferred is equal to the requested input count. More data might be available." The annoying part is due to the fact that the same string of drivers in a different yet similar code doesn't produce the warning.  I simply cut and paste the sub vi's from the old code into the new one and I now get this warning.  The code executes just fine so if there isn't a simple fix for this warning then at least how can I make it not show the warning everytime I run the vi?
 
Thanks
Drew
0 Kudos
Message 1 of 3
(3,344 Views)
Drew,

I can not remember the actual reason for this warning and how to avoid it. But there's an easy way to get rid of it:
1. Put a breakpoint onto the error wire behind 'serial port read'
2. Run your code once; probe if this wire's value contains your warning now
3. If so, right-click onto it, choose 'create constant'
4. Compare the value of the wire with this constant using 'not.equal' and 'compare_aggregates' mode. Wire this comaprision to a select-node.
5. Wire the original error wire to the true-input of the select node.
6. Right-click onto Select's output, choose 'create constant'.
7. Use this constant as input for the false-Input of Select
8. Wire the output of select to where serial_port_read oroiginally was wired to.

I've attached a simple example - a modified Basic Serial Write and Read .
Instead of comparing to the whole constant you may as well 'just' compare error. status AND error.code and put this comparision and the select into a subVI that cqan be reused.

HTH   and Greetings from Germany!<br>-- <br>Uwe

0 Kudos
Message 2 of 3
(3,332 Views)

Thanks Lul, worked like a charm.

Drew

0 Kudos
Message 3 of 3
(3,307 Views)