jaebarn
Hello,
 
Does OpenPLC have the ability to talk to a device over EtherNet/IP (Allen Bradley) comms? Can I get some pointers on how to configure this?
 
I have seen some threads on here that are 5+ years old and it looks like some sort of plug in was required.
 
I'm wanting to send battery voltage and DI bit status from an ESP32 slave device being controlled by the OpenPLC runtime on a PC.
 
The ESP32 talks to the OpenPLC runtime over the WiFi and the said Micrologix (ML1100) is connected to the OpenPLC runtime PC via the same network but by Ethernet cable.
 
I've got the ESP32 up and running and can see the Digital Input change in the runtime.
 
I can successfully talk / manipulate the ML1100 N registers in an HMI (FUXA) via EtherNet/IP comms.
 
Thanks in advance
Reply 0 0
thiagoralves
OpenPLC is an ENIP slave, not master, which means you can read OpenPLC values from an HMI using ENIP, but your can’t read other devices using ENIP from OpenPLC
Reply 0 0
jaebarn
OpenPLC is an ENIP slave, not master, which means you can read OpenPLC values from an HMI using ENIP, but your can’t read other devices using ENIP from OpenPLC
Hi Thiago, thanks for your reply. So what I think your saying is I can pull Input Status's etc from OpenPLC via ENIP but not put data into OpenPLC via ENIP.
 
That is ok, I just want read OpenPLC values. What do I need to do to set up this communication? Modbus seems to be the only options when your are compiling the program.
Reply 0 0
thiagoralves
Is not about data direction but who is making the requests. OpenPLC cannot make the requests, only respond to them (slave mode). ENIP support is only available on the Linux and Windows runtimes. On Arduino-compatible boards you can only use Modbus slave. On Linux/Windows runtime you can enable ENIP on settings. The support is still experimental and might not support all message requests.
Reply 0 0
jaebarn
Hi Thiago,
 
Ok thanks. I've found the ENIP enable setting in the OpenPLC runtime and have been able to read the input and output statuses (I:0/0, O:0/0 etc) from OpenPLC in the HMI but having trouble trying to access the %MW registers. Any Idea what %MW will translate to as ENIP registers?
Reply 0 0
fg71
M stand for memory that is structured memory space. And the W stand for word and is the size of 16-bit or 2 bytes.
If you use %MW0
 
You are access the first index of array (start at 0) that is buffer of specific length, and your read 2 bytes (16-bit)
In hexadecimal form that is 0x0000 - 0xFFFF for unsigned integer, and if you use signed integer its 0x8000 - 0x7FFF.
The range is 0 - 65535 if you use unsigned integer.
The range is -32768 - (32768 - 1) if you use signed integer
 
I have never used ENIP I believe it very common in North of America but not in Europe but you need a data type of word to assign to I/O mapping
If you mean access as reading it all depends how your Client is working when you are mapping it in your PLC device.
Most of the time PLC IDE use mapping table for Client to configure the local address and remote address.
If the size of the remote address is wrong you will not get any data. The best approach is to read the documentation of the device you are using as Client.
Reply 0 0
thiagoralves
Hi Thiago,
 
Ok thanks. I've found the ENIP enable setting in the OpenPLC runtime and have been able to read the input and output statuses (I:0/0, O:0/0 etc) from OpenPLC in the HMI but having trouble trying to access the %MW registers. Any Idea what %MW will translate to as ENIP registers?
ENIP uses the exact same mapping as the Modbus protocol: https://autonomylogic.com/docs/2-5-modbus-addressing/
You will have to read integers (holding registers) to read %MW locations, at the offset described in the Modbus mapping table.
Reply 0 0
Reply