I've been programming software and home automation systems for years now, but I'm rather new to CoDeSys and PLC driven systems. Presently I find myself trying to communicate with a Parker Hannifin HMI with a WAGO PLC via Ethernet Modbus, and it's driving me bananas.
WAGO provides great documentation, and CoDeSys great function blocks, for communicating between a couple of like-minded devices. I've controlled outputs on a coupler via Modbus without problem, and never really had to worry about the coil/register addressing system. Now, however, I find myself trying to communicate with an HMI using the Kepler driver, and just can't find what the heck I'm changing. With those specs out of the way, let me break it down a bit.
According to the HMI software—Interact Xpress—Modbus addresses (somehow) on a 1-65536 range. What confuses me about this is that I find nowhere what the units of said range are: bits? bytes? words? Just the same, I have a spreadsheet that says the word 256 on the PLC is holding register 400257 (per offset). I then tagged a couple of buttons on the HMI to toggle the first couple of bits in said word. It sounds great, but when I view the 256-511 word range on the PLC I see absolutely no sign of changing bits; I have, in fact, not been able to produce the slightest sign of communication in said scenario. The HMI reports that the buttons are reading and writing correctly to their assigned address, but no where else do I find signs of this to be true.
Does it sound like I'm merely addressing incorrectly? What is the unit of measurement for the Modbus range? Has anyone succeeded in this endeavor already? Would someone mind explaining the basic of Modbus communication? (The documentation makes a great reference if one already has an idea of what they're looking at.)
Any or all information would be greatly appreciated. Thanks!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
have you check the io-addresses in the controller configuration ?
the modbus-address 400257 is correct if your first in/output is
locatet at IX0.0 /QX0.0 otherwise you must add the plc-addressoffset to the modbus-address.
for testing the communication in general, you can add following code to your controller
VAR_GLOBALÂ Â BIT_0Â Â Â Â AT%MX0.0:Â Â BOOL;Â Â (*ModbusAdresse412289*)Â Â BIT_1Â Â Â Â AT%MX0.1:Â Â BOOL;Â Â BIT_2Â Â Â Â AT%MX0.2:Â Â BOOL;Â Â BIT_3Â Â Â Â AT%MX0.3:Â Â BOOL;Â Â BIT_4Â Â Â Â AT%MX0.4:Â Â BOOL;Â Â BIT_5Â Â Â Â AT%MX0.5:Â Â BOOL;Â Â BIT_6Â Â Â Â AT%MX0.6:Â Â BOOL;Â Â BIT_7Â Â Â Â AT%MX0.7:Â Â BOOL;Â Â BIT_8Â Â Â Â AT%MX0.8:Â Â BOOL;Â Â BIT_9Â Â Â Â AT%MX0.9:Â Â BOOL;Â Â BIT_10Â Â Â Â AT%MX0.10:Â Â BOOL;Â Â BIT_11Â Â Â Â AT%MX0.11:Â Â BOOL;Â Â BIT_12Â Â Â Â AT%MX0.12:Â Â BOOL;Â Â BIT_13Â Â Â Â AT%MX0.13:Â Â BOOL;Â Â BIT_14Â Â Â Â AT%MX0.14:Â Â BOOL;Â Â BIT_15Â Â Â Â AT%MX0.15:Â Â BOOL;Â Â WORD_1Â Â AT%MW2:Â Â Â Â WORD;(*ModbusAdresse412291*)Â Â WORD_2Â Â AT%MW4:Â Â Â Â WORD;(*ModbusAdresse412293*)END_VAR
hope that helps
Volker
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello All:
I've been programming software and home automation systems for years now, but I'm rather new to CoDeSys and PLC driven systems. Presently I find myself trying to communicate with a Parker Hannifin HMI with a WAGO PLC via Ethernet Modbus, and it's driving me bananas.
WAGO provides great documentation, and CoDeSys great function blocks, for communicating between a couple of like-minded devices. I've controlled outputs on a coupler via Modbus without problem, and never really had to worry about the coil/register addressing system. Now, however, I find myself trying to communicate with an HMI using the Kepler driver, and just can't find what the heck I'm changing. With those specs out of the way, let me break it down a bit.
According to the HMI software—Interact Xpress—Modbus addresses (somehow) on a 1-65536 range. What confuses me about this is that I find nowhere what the units of said range are: bits? bytes? words? Just the same, I have a spreadsheet that says the word 256 on the PLC is holding register 400257 (per offset). I then tagged a couple of buttons on the HMI to toggle the first couple of bits in said word. It sounds great, but when I view the 256-511 word range on the PLC I see absolutely no sign of changing bits; I have, in fact, not been able to produce the slightest sign of communication in said scenario. The HMI reports that the buttons are reading and writing correctly to their assigned address, but no where else do I find signs of this to be true.
Does it sound like I'm merely addressing incorrectly? What is the unit of measurement for the Modbus range? Has anyone succeeded in this endeavor already? Would someone mind explaining the basic of Modbus communication? (The documentation makes a great reference if one already has an idea of what they're looking at.)
Any or all information would be greatly appreciated. Thanks!
Hi,
what type of WAGO PLC ?
Greets Volker
Hello Volker,
I'm using a 750-871.
hi,
have you check the io-addresses in the controller configuration ?
the modbus-address 400257 is correct if your first in/output is
locatet at IX0.0 /QX0.0 otherwise you must add the plc-addressoffset to the modbus-address.
for testing the communication in general, you can add following code to your controller
hope that helps
Volker