
With RS232 the first questions how to define the end of a dataset:
- either there is a character send only at the end of each dataset or
- you define a pause as a end of dataset
In this example we use the second criteria defining a pause of 100 ms as the trigger for a line feed. The duration of the break can be defined variably. The red command are the changes necessary to implement the line feed.
let ms = 0
do
' Read data and write to file
INPUT A
if BYTESREAD > 0 then
put -202, #0
put 1, A, BYTESREAD
let ms = millis + 100
end if
if (millis > ms) and (ms > 0) then
put 1, #13
put 1, #10
let ms = 0
end if