Modicon PAC Forum
A forum for topics related to the scope of Modicon PAC offers and ecosystem along the whole lifecycle: Modicon M580 and 340, EcoStruxure Control Expert, EcoStruxure Process Expert (Unity Pro) and more.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-04 08:25 AM . Last Modified: 2021-05-05 06:01 AM
I´m doing upgrade from Quantum base to M580, but there´s a Modbus RTU network with VFDs on it, and the FB Write_Red is used to write them. Now, I need to do the same in the M580 programm but I dont´t know witch FB must I use. Also I need replace READ_REG. I´m using Unirt Pro XL v12
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-05 02:12 PM
The commands available for the M580 are READ_VAR and WRITE_VAR.
These also use a different addressing structure (ADDM) so you will have to change that as well. If you are indexing the Unit ID addresses when communicating with drives via an Ethernet gateway then you can manipulate the UnitID Field in the Output parameter structure.
Also if you are cascading the commands, ensure that you complete the first command before initiating the second command. Your overall response time will be depended on the response time of the individual drives.
One other option to investigate is the use of ModBus DTM if the drives each have a unique IP address.
This would allow for a combined Read/ Write in one transaction (ModBus FC23) that is a bit more efficient.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-17 08:30 AM
The gateway IP is 192.168.3.86 and there is 12 IDs:
Can you help me with the configuration of ADR ?
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-17 04:00 PM
(*ADDM example in ST
This is using your IP address and a default 255 for the Unit ID
communicating via the M580 CPU Ethernet port
*)
ADDM_struct := ADDM ('0.0.3{192.168.3.86}255');
(* you then manipulate the contents of ADDM_struct[3] to set the Unit ID to what you want for your field device.
This is described in the ADDM Help. Note the Fields are described in Bytes, the ADDM structure is INT
You need to keep the value of the lower Byte of ADDM_struct[3] as this is manipulated by the instruction.
You then change the upper Byte to your target Unit ID using variable 'Unit_ID'.
*)
WORD_AS_BYTE (IN := INT_TO_WORD(ADDM_struct[3]),
LOW => lowB,
HIGH => highB);
ADDM_struct[3]:= WORD_TO_INT(BYTE_AS_WORD(lowB,INT_TO_BYTE(Unit_ID)));
(*the variable 'ADDM_struct' may now be used as the address input to the READ_VAR block
*)
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-19 10:08 AM
Read_Var and Write_Var would indeed be the best drop-in replacements for the modernization.
You could also use the Data_Exch block, which allows you to configure any Modbus FC including FC23 of course.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-19 07:32 PM
DATA_EXCH is probably the most powerful communication block in the ECE library.
You can use it for EIP, ModBusTCP and serial communications.
The only problem is that it is the worst documented block in the Help file - bar none.
There is no list of supported functions for the relevant communications types or protocols.
You could take the example of M340 communications from the Help and start to modify it for FC23 but you would be guessing as to location for received data and write data
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-05-20 02:34 AM
Here is a section with a sample DFB to use Data_Exch with FC23.
The query registers sequence actually follows the Modbus protocol reference manual, so not quite hard to program.
Between 2 M580s, I found I had to set both Read and Write byte swap flags to true.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-01 07:47 AM
Address is Ok? Because I can´t read anythig on RD_DATA array.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-01 07:58 AM
The address looks a bit off. When polling from an M580 CPU, the channel has to be set to 3. So change it to '0.0.3{192.168.3.86}81'
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-01 08:19 AM
First, be aware that the Trigger variable needs a positive transition. So you could do this manually or connect %S6 to the trigger pin.
If you have done this, you could do some basic troubleshooting for the Modbus comms-
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-01 08:42 AM
1: yes, I can read/write
2:
3: Tested both config, same result
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2021-06-01 09:19 AM
I didn´t notice registers was upside down, for the gateway EGX100 must be excatly read/write reg number to allow comms, otherwise you can´t read it even if the read parameters is OK.
Thank you all, for the support.
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.