CODESYS - the IEC 61131-3 automation software
https://forum.codesys.com/

Multiple Modbus Read Registers Access by an Array of Elements
https://forum.codesys.com/viewtopic.php?f=21&t=8772
Page 1 of 1

Author:  mikeardy [ Mon Apr 16, 2018 2:24 pm ]
Post subject:  Multiple Modbus Read Registers Access by an Array of Elements

Hi,
I need to read about 250 UDINT via Modbus in Slave mode. A SCADA manages this data and write via Modbus remotely to my controller.
So inizially I configured on my controller a modbus slave device. Due to Modbus limitations I configured 4 channel in Read Holding Registers mode with an array of 125 elements (500 elements in total of WORD type).
In a GVL I defined an array of 250 elements of UDINT type poiting at the starting address of the input registers, beginning at %IW60.
Finally in my application program I used the array poiting values I need directly by index.
Is it the right way or maybe there is a quite simpler or "more readable" and canonical method?
See pictures I added to this post.
Many thanks

Page 1 of 1 All times are UTC+01:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/