BobB Posted April 17, 2021 Report Posted April 17, 2021 I normally use the PMCR system for Modbus RTU reads but have an absolute heap on this job I am working on (4 serial cards - stuff from everywhere) so have decided to use the function block method - it will be easier. Attached is a file which is my method that I hope will work for a small part of the job. I have used a counter to step the reads and a bit counter to count the done bits and step the counter on to the next read. Not sure if this will work but assume that when a done bit turns on and the counter moves to the next read the done bit will turn off and then when the next read takes place that done bit will turn on and step the counter again. If any of you have used this before would you mind checking my code please. If it will not work I do not want to be programming a heap of stuff that will not work. Thanks for any comments. Modbus Sample.cxp
BobB Posted April 20, 2021 Author Report Posted April 20, 2021 Oooh - no takers? Surprised. Michael Walsh?
Michael Walsh Posted April 26, 2021 Report Posted April 26, 2021 Sorry, I have not been on here very much as of late. Trying to catch up. Conceptually, it looks like it will work. I would use one Function block and move the info to the inputs and then move away the output data for each execution. If you compile this code, it fails because the FBs take up too much non-retained memory and the defaults need to be changed. That being said, if you change the default memory allocations to accommodate the FBs, it should work as is.
BobB Posted April 26, 2021 Author Report Posted April 26, 2021 Thanks Michael - yes - memory has been moved and expanded to E.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now