NordicHenry

Modbus communication between Omron CJ2M CPU31/SCU41 (modbus master) and Schneider NSX Circuit breake

5 posts in this topic

Greetings from Finland! Hardware: Omron CJ2M CPU31 + SCU21 or SCU41. PLC should act as Modbus master. Schneider Electric NSX circuit breaker with Micrologic 5.2E Trip Unit is only slave (Actually there is Modbus communication interface module which is gateway that connects Micrologic to modbus network). Software; PMCR's Easy to use Modbus RTU Master for CP1L. That application works. It's great and easy to use! Respect!! And the problem; Modbus is new thing for me. So i'm struggling with it. I can read one or two registers. That works. But Schneider's manual says; 1. "A block read request of 10 registers is necessary to read the long time protection parameters (see History Reading, page 38)". 2. Page 38 says; A block read request is necessary to read a history record (see Modbus function read n input words, function code = 4)" 3. "Some variables must be read as a set, like the long time protection variables. The whole set must be read as a block. Reading a partial number results in an error" This is how i understand that; I need to use function code 4 and read 10 registers. I'm not so familiar with macros either but if i'm right, the macro could only read one or two registers? How can i read 10 registers? I believe that it's possible to make a new message/sequence to macro, right? Here is a link to Schneider's manual

Share this post


Link to post
Share on other sites
I use this http://forums.mrplc.com/index.php?app=downloads&showfile=259
1 person likes this

Share this post


Link to post
Share on other sites
I Found so many different solutions that i couldn't decide which one could work. There is some samples even on omron's website. I will try that one! Thanks BobB!

Share this post


Link to post
Share on other sites
I studied a while and i'm beginning to understand how modbus works and how these sample codes works. First sample code: PMCR's Easy to use Modbus RTU Master is great. But with modbus commands 3 & 4 it can only read 1 or 2 registers. That's not enough. Second sample code: SleepyWompat's Modbus protocol macro can read more than 2 registers but PMCR's polling loop is very easy to use. Solution; I put those codes together. In Easy Modbus macro there are only D5004 and D5005 (etc.) available for the response. But there is a "D5006 Not used". I use it for indirect destination address for the response. Easy Modbus macro reads everything else just like before except only difference is that if you want to read more than 2 registers with modbus commands 3 or 4 then PMCR will call protocol macro from Sleepywompat's sample code and writes the response wherever i want to. Error checking and everythins else is just like it was. I still need some time but when it is ready i can upload it to sample codes if someone would like to try it. Edited by NordicHenry

Share this post


Link to post
Share on other sites
The link I posted reads as many registers as you wish - I find it is always the slave that is the limiting factor - try to read 100 registers - the slave will only allow 30 - way it goes - and then there are swapped words and swapped bytes! PITA sometimes.

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