I'm trying to extract some data from an Arduino over the usb-serial-port and to write it into a txt-file. Therefore i'm using a batch-file (Windows 7, ordinary cmd), which sends e.g. a "d" to request the desired data from the Arduino. Having received the "d", the Arduino starts to send the data to the pc. The batch-file reads the data and writes it to some txt-file. The batch code is:
mode COM4 BAUD=9600 PARITY=n DATA=8
echo d >COM4
COPY COM4 data.txt
That works so far, but the problem is:
How do I stop the COPY-process?
When the Arduino is done with sending the data, the batch file keeps on wating for more. My preferred solution would be, that the Arduino sends some string like "end", the batch file recognizes this and stops reading. Is that somehow possible?
I believe that copy will recognize a Control-Z as an end of file character and terminate.
Harkens way back to the old dos days, am I showing my age?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With