jholstein
I want to update the IP address of the P1AM-100 Ethernet module in code, instead of doing it at compile time. Is this possible?
Reply 0 0
thiagoralves
No, it is not possible. The module configuration is compiled as part of the OpenPLC micro-runtime that is flashed to the device.
Reply 0 0
jholstein
OK. 

Is there a way to link in the arduino libraries with an external c module? I have used the arduino ethernet library to dynamically assign both the Mac and IP addresses, and could probably do the same in an extern c module if I could figure out how to link them in...
Reply 0 0
thiagoralves
If all you want is just have the IP address being dynamically assigned by the DHCP server, then just leave the fields blank at the compilation window and the OpenPLC micro-runtime will take care of that. The only platform that does not support DHCP directly is the esp8266 due to some internal SDK differences.

If what you want is to change the IP dynamically at run time, from you PLC program, then no, you can't do that with an external c module. The Arduino code is C++, not C. There is a lot of work-around to actually glue the Editor C-generated code with the Arduino environment. You will have to edit the OpenPLC micro-runtime code to make those changes. If you want to dive in, the micro-runtime code is located at /editor/arduino/src (for IEC libs and hardware drivers) and /editor/arduino/Examples (for the main .ino entry point)
Reply 0 0
jholstein
Ok. Thank you. I will look at this. This is very helpful.
Reply 0 0
Reply