Arduino, logging and communications
Sketch Logger
Start with the hardware serial port connected to USB and to PLC
Read a line from PLC (actually from laptop via debug port)
Parse the line into variables
print variables
sscanf does not want to work with the input buffer. It expects a string, an array of characters. The String object, the Arduino String, has an array of characters but it also has a length as well as other stuff.
I found a copy from String to a normal C character array. sscanf works with the integers .. but not with the floating point value?
That seems to work after a few iterations. The floating point variable still does not want to scan ...
But this is progress ... the string that my PLC sends out is parsed into integers and stored in memory.
|