08-01-2013 11:12 PM
08-02-2013 02:02 AM - edited 08-02-2013 02:03 AM
Hi jtc,
two points:
1) Using BytesAtPort is silly when your barcode reader outputs values using a TermChar like CR as shown in your pics.
2) Some pseudocode, probably used by "Autonavigator" too:
IF new value read (aka "no timeout" aka "BytesAtPort>0") THEN write value to display ELSE don't change display ENDIF
Thinks about that:
What do you expect to read from the serial port when you order VISARead to read a string of zero length?
08-02-2013 02:54 AM
Hi GerdW,
I appreciate for your reply. I attached two more screen shots read data from the sensor. But after this read, the next iteration it is zero.
If its zero lenght or zero bytes then i should not read anything. But i think i look so focus on the windows hyperteminal that it
should demonstrate the same with labview.
will i be able to do this for this application?
IF new value read (aka "no timeout" aka "BytesAtPort>0")
THEN
write value to display
ELSE
don't change display
ENDIF
Thanks a lot.
Regards,
jtc
08-02-2013 02:59 AM - edited 08-02-2013 03:01 AM
Hi jtc,
I recommend to use the "Advanced Serial Read/Write" example, not the "Basic..." one. It includes the While loop missing in your simple VI: it's not necessary to Init/Close the serial port for each Write/Read operation! Using "Run continuously" is only recommended for very basic debugging, not for just letting a VI run several times...
Then for your question: Yes, you will be able to do that! Simply use a case structure and test for the given condition...
08-03-2013 12:15 AM
Hi Mr GerdW
Thank you for the enlightenment.
Finally i can read the barcode data. Also, I can now display the last
read data even when the barcode reader is not moving. The bardoce
data will update once the barcode reader starts to read another code.
One last question: On the block diagram, to avoid the pop-up error
message of timeout Err -1073807339, is it okay to ignore this error?
Is it okay that I just put "no dialog" on the Simple Error Handler?
Thanks a lot.
jtc
08-03-2013 03:20 AM