Asmol
How can I get sensor data from something like an i2c device or ultrasonic sensor using arduino or esp8266 into openplc? Do I need to change what goes into the analog variables or are there variables that I can use for this?
Reply 0 0
thiagoralves
You can’t, unless you modify the arduino firmware to read those things. OpenPLC only reads the gpio pins directly (digital and analog). It doesn’t manipulate any i2c or spi bus on the arduino
Reply 1 0
Asmol
Ok, so are there variables that I can pass the data to for this purpose? I did modify the firmware and used the variable for the analog input. I’d like to pass more than one value if possible.
Reply 0 0
thiagoralves
Then you will need to add more input or holding (output) registers to the arduino firmware. You can add as much as you need, as long as it fits on the arduino RAM. You will also need to change the arduino template on OpenPLC slave devices page. That template is expecting the exact number of inputs and outputs as defined on the arduino firmware. If you've increased that, you will need to change the template to Generic Modbus, so that you can define exactly how many inputs, coils and registers you're bringing.
Reply 1 0
Asmol
Very nice! Thank you.
Reply 0 0
Terry Flippin
Thanks for info, I finally was able to update openplc editor, and I was able to eventually get program to arduino.
Again thank you.
Reply 0 0
Reply