Sign in to follow this  
Followers 0
lchamarthi

Function code 17

5 posts in this topic

Hi Guys, Could any one send me CX-protocol command (sequence, sent and receive message commands) for Function code 17 in the modbus for read/write multiple registers. Thanks Lakshmi

Share this post


Link to post
Share on other sites
Hi Guys, I have developed below macro for reading and writing multiple registers in slave using Function Code 17 as per Modbus standard application. Send Message <a>+ETB+(R(2),4)+(R(4),4)+(R(6),1)+(R(7),R(6))+<c> Receive Message <a>+ETB+<l>+ (W (1),*) +<c> with this above, I couldn't get proper response on the serial port, Is the macro is right?

Share this post


Link to post
Share on other sites
lchamarthi I have taken a quick look at your string structure, and it looks like there are some differences from the Modbus spec for function 17. Send Message</FONT></FONT>ETB+(R(2),4)+(R(4),4)+(R(6),1)+(R(7),R(6))+<c> <a> = Modbus node ETB = chr(17 HEX) (R(2),4) = Read Register Number (R(4,4)) = Number of Registers to Read (R(6),1)) = Write Register Number. This needs to be 4 characters, not 1 (R(7),R(6)) = Byte Count (2 digits) and Data. This needs to be filled out carefully in your memory. This also overlaps the previous (R(6),1). If you can send a trace of the data that is being sent, that would be very helpful. If you do not know how to use the trace, here is the method. PMCR_Data_Trace.pdf

Share this post


Link to post
Share on other sites
I can't able to trace the data as i am getting pop up that PMSU configuration not allowed to trace.

Share this post


Link to post
Share on other sites
That usually means 1 of 2 things. 1. The port is not configured as a Protocol Macro port. 2. You did not select the correct SCU or Port on the SCU. Make certain that you select the SCU in the tree on the left that matches the unit number. In the picture below, I have selected port 1 of SCU0. Make certain that you have the correct SCU and Port selected, and that it is setup as a PMCR port.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0