Industry Automation and Control Forum
This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2024-06-13 07:18 AM
I am using Siemens PAC4200 meter on modbus TCP with M580 controller. This PAC4200 meter can work as a modbus TCP slave and also modbus TCP to RTU gateway. Means Modbus RTU slaves can be connected under the PAC4200 meter and PLC can read data from these RTU slaves via PAC4200 as a gateway. This needs some changes in the modbus request, i.e. port number to be changed to 17002 instead of default 502 and Unit ID to be changed as the node address of the RTU device instead of default 255 . I am using Read_var instruction to generate modbus requests, can you please help how to modify the port number and Unit ID in the modbus requests?
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: 2024-06-19 05:29 AM
Looks like youre tying to ask for untid 10 @ 192.168.0.9?
The only differencd I see in our arrays is my ProtId is 16x02 in stead of 16x00 in your Read_Addr[2] high byte. I'm just running a simulation on my compter. do you have a "normal" modbus device you can test the addmx and read_var function with (using the normal port)?
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: 2024-06-16 02:07 PM
You should be able to create your address array with an ADDMX block and substitute the port before sending it to the read_var block.
With an input to the ADDMX like '0.0.3{192.168.1.1}1' the element in the [6] position of the output array is 502. Try changing that to 17002 and see if it works.
The syntax I used for ADDMX is 'rack.module.chanel{target ip}node' see the Control Expert help for more details on how to use this 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: 2024-06-18 08:05 AM
Hi Bosswaffle,
Thanks a lot for the reply. I tried it and replaced the port 502 with 17002. Also i changed the slave id byte8 as shown in the below picture. But still the reply from the modbus slave is not right. The same port number and slave id works fine in Modscan. Do you see any other problem here?
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: 2024-06-18 08:15 AM
Hi Bosswaffle,
Thanks a lot for the reply. I tried the same and edited the slave id and port number in the respective bytes as shown below but the modbus reply is not correct. With the same port number & slave id, Modscan works fine. what could be the issue?
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: 2024-06-19 05:29 AM
Looks like youre tying to ask for untid 10 @ 192.168.0.9?
The only differencd I see in our arrays is my ProtId is 16x02 in stead of 16x00 in your Read_Addr[2] high byte. I'm just running a simulation on my compter. do you have a "normal" modbus device you can test the addmx and read_var function with (using the normal port)?
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: 2024-06-26 04:59 AM
Thanks a lot for the reply, after changing it to 2, it started working fine.
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.