ainfirdaus
Arduino uses 16 MHz frequency. In other word, its priod is one sixteenth us. Can openplc period be faster than 50ms? 

Thank you

Firdaus from Indonesia
Quote 0 0
thiagoralves
Hi Firdaus! The answer is yes. You can define the period of your program going to Config0->Res0 (double click) on the left panel. Then under tasks you can set the interval to whatever you want. However, this period is just for your program. Given that the Arduino is a slave device (i.e. it is not running the program), you will also have to modify the slave polling period under Settings on the OpenPLC web interface. This setting defines how often the OpenPLC application is communicating with your slave devices.

Just keep in mind that setting a very low number (something less than 1ms) for either one can cause problems. The communication speed between the Arduino board and the OpenPLC host is 115200 baud. If you set the polling period too low, it might be that the Arduino gets another message before it has finished processing the last one. So, beware. I would say that a safe number for just one slave device is around 10ms.
Quote 0 0