Could anyone help me to figure out how to configure Portenta Machine Control as modbus tcp slave using Arduino PLC IDE.
Ethernet Configuration window shows
But... what means:
"Modbus TCP Slave always enabled"? Does it mean that modbus server always running in background?
What is "Unit identifier: 255"?
Is there some Portenta modbus register mapping info?
I've tried to connect Portenta by QModMaster, connection is ok but every read/write operation causes error.
Many thanks in advance for any information regarding this issue!
I'm trying to find the same type of information for an Opta WiFi device and I'm using PLC IDE 1.0.3 (the first version to support Opta). There seems to be some default mapping already in place, at least in the Opta, and this is what I've found so far by some quick trial and error (using QModMaster):
Coils 5, 6, 7, 8 correspond to the Status LEDs 1, 2, 3, 4, respectively. You can read from and write to those coils (Modbus function codes 0x01, 0x05).
Discrete Input 9 corresponds to the User Button and you can read its status (Modbus function code 0x02).
I tried to read/write Holding Registers and read Input Registers to no avail (I tried different starting addresses 0, 1, 30000, 30001, 40000, 40001, etc.), but this doesn't surprise me since I didn't find any way to actually map variables to ModBus addresses.
Have you found anything else on how to configure a ModBus slave through the PLC IDE?
Hello, [gguereque4]: I have already found how to map variables to modbus address for a slave device: When I create a global variable (on your code) then you go to Resources --> Parameter (non-volatile) Then add a new variable then asign the Global variable and that all. I found that on OPTA the Holding start on an specific value (16384) but it works for me. The only thing that I couldn't do is to store the variable on an specific address, because when I power off and then power on the OPTA the value start in 0 again.
Yes, only if you are trying to use as slave device. For master device es using the configuration for RS485 or Ethernet and adding the Modbus device.
I haven't tried with RTU but let me check it. Actually if you use the Satus Variables (bottom of Parameters) you should watch MOdbus registers too, Input Register in that case.
I couldn't found the retain checkbox, can you tell me where to find it? For example I programmed many counters and when I restarted the PLC I lost the data.