- Sep
- 2
- 0
HI guys,
I read COM1 port with a Batch file after triggering an Barcode scanner that replies immediately after getting the trigger command with the code and the required CTRL-Z.
my code:
mode COM1 Baud=9600 Parity=N Data=8 Stop=1 dtr=off rts=off
echo ^|^|^>trigger on>COM1
ping 192.0.2.2 -n 1 -w 50
copy COM1 /b buffer.txt
my monitor-app shows me the answer as:
||[0]
||[1]1234567 <SUB> <CR><LF>
the batch file stops running because it's waiting for the CTRL-Z (SUB)...(what definetly appears at the end of the answer) but my batch magically doesn't get it....
my problem supposed to be between echo... and copy...
sometimes it workes pretty well, sometimes not...
sometimes I can fix the problem with changing the delay between echo and copy (50ms) or using an other Computer or COM port.
I'm quite sure there is a time-issue...
I already tried changing lots of things, including setting a delay between sending back the barcode or stuff..
does somebody have an idea what I do wrong?
Simon
I read COM1 port with a Batch file after triggering an Barcode scanner that replies immediately after getting the trigger command with the code and the required CTRL-Z.
my code:
mode COM1 Baud=9600 Parity=N Data=8 Stop=1 dtr=off rts=off
echo ^|^|^>trigger on>COM1
ping 192.0.2.2 -n 1 -w 50
copy COM1 /b buffer.txt
my monitor-app shows me the answer as:
||[0]
||[1]1234567 <SUB> <CR><LF>
the batch file stops running because it's waiting for the CTRL-Z (SUB)...(what definetly appears at the end of the answer) but my batch magically doesn't get it....
my problem supposed to be between echo... and copy...
sometimes it workes pretty well, sometimes not...
sometimes I can fix the problem with changing the delay between echo and copy (50ms) or using an other Computer or COM port.
I'm quite sure there is a time-issue...
I already tried changing lots of things, including setting a delay between sending back the barcode or stuff..
does somebody have an idea what I do wrong?
Simon