CreativeInclude
 
Hello, I'm currently doing experiments with openPLC and an Esp8266
Real pins are needed to configure Modbus inputs and outputs.
But I don't have any real inputs and would still like to use them via modbus
How can I influence the "ArduinoUploadDialog.py" via the "I/O config" in OpenPLC?

Best regards
Wolfgang

ESP8266 'Schematic.jpg
 
iO Config.jpg
 
ArduinoUploadDialog.jpg
 
defines.jpg
 
 
1.jpg
 
2.jpg
Reply 0 0
thiagoralves
If all you want is change pinout, you don’t have to change any code. Just put the pins you want on the I/O Config dialog. You can use arduino pin numbers or the predefined NODE pin names.
 
Also, if you’re using the arduino sketch extension, avoid redefining pins, as that will conflict with the runtime pins you defined in the I/O Config dialog.
Reply 0 0
CreativeInclude
Of course everything should remain consistent
I didn't enter the pins in the I/O Config dialog because they are virtual inputs.In this case I make changes in the esp8266.cpp
But suppose I want to have 16 additional inputs or outputs on the esp8266 via an i2c port expander.
How do I define the in openplc for modbus?
For me it's not about the i2c connection but about bringing 16 virtual I/O to the modbus


port expander.jpg
Reply 0 0
thiagoralves
They are already there. Modbus maps the first 56 locations for discrete IO (IX and QX) and the first 32 locations for analog IO (IW and QW). Check the Modbus documentation on the Autonomy website for more info. If you’ve changed the esp8266 driver to add the readings and writings to your hardware, then that’s it. You don’t have to modify anything else.
Reply 0 0
Reply