Sign in to follow this  
Followers 0
soundwave

CJ1M & SCU41 - Modbus 2 Slaves

28 posts in this topic

There has been another one since. Multiple generators in a base load power station. Too messy. Declined to quote. Has been one on Lord Howe Island as well. Declined to quote. Included alternative enrgy sources to be synchronised. Engines to be rebuilt etc.

Share this post


Link to post
Share on other sites
I have still not had a chance to program modbus. i have been asked to program the display (led panel). I now realise i have ordered the OD211's instead of OD212s ( ? sourcing outputs) which will cost time. Because i am moving on to another area of the project I think i will start another thread when i have trouble in a different area of modbus.

Share this post


Link to post
Share on other sites
Finally Completed the programming for a CPU23 as a master with two power meters as slaves. You can look over this BobB and comment if you wish it is attached at the bottom, The program basically uses the modbus protocol V5 by sleepy wombat. The equipment is a CJ1M – CPU23 with a SCU-41 comms card set as unit 0. I am the master in a small modbus network with 2 nodes. The program executes three read statements. 1. Read node 1 – Power Qualities 1 2. Pass Token 3. Read Node 1 – Power Qualities 2 4. Pass Token 5. Read Node 2 – Power Qualities 1 I have used a system where a token is passed between three read statement (I believe most use this method). When the token is passed the read statement has control of setting up the PCMR instruction, executing the PCMR instruction, and then storing the retrieved data. I had a couple of problems with handing over the token. First few attempts used a counter, the next a direct pass to the following read statement ... etc... Eventually i have settled with a timer that passes the token between three read statements. A node can be unplugged and the program will write zeros to it’s receive address. When the node is plugged back in the program again polls this node for data. So these have been the last two problems; Segregating the read statements so data was not stored in the next read statement addresses when executed. Making sure when a device was not connected the latest data would read all zeros. And making sure if it was reconnected it was actively polled again. Now I am back to the CPU23 as a slave in an existing network Modbus_Master_2_Slaves.cxp

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