Hi Marc,
New brain food for tonight!
I have fresh food now....
This version has two brand new features, it is one of the main causes for this code.
The first is that data not be sent to PROVIEW directly, but they are saved in transmitting ring buffer. In this way allows us to continue the cycle without waiting.
The second is, plc thread. It is implemented in the main cycle, but each performance evokes only one function. For example, ADC, and other I / O are in plc_adc(). Data transmission to PROVIEW be managed by plc_tx ().
Slow tasks and processes are in plc_slow () array.
The basic idea is Arduino and Proview to exchange data with other meanings, not only the direct output and inputs.Such as position, velocity and acceleration of the process where direct exchange would otherwise be difficult - for example, step motors.
]