Sign in to follow this  
Followers 0
chombium

CJ1M Modbus RTU

12 posts in this topic

Hi, I have CJ1M PLC with SCU 41 board connected to it. I have to program modbus RTU master on the PLC. I found Sleepy Woody's protocol macro for it but the thing is that I don't have CX-Protocol to download the macro to the communication board. Is there any demo/trail of CX-Protocol available to download? Is there any possibility to open/convert the CX-Protocol file to a CX-Programmer file? Guess not Is there any sample code of modbus implementation for CX-Programmer that doesn't use the macro mentioned above. I'm not really familiar with the PMCR instruction. I assume that it's not possible to use it without downloading macros in the SCU. I've tried writing the protocol using RXD and TXD instructions and CPUs serial port but I had a problem because they werew converting the values to ASCII. PLEASE HELP ASAP BEST REGARDS, Jovan

Share this post


Link to post
Share on other sites
I have to read some transducers which have modbus RTU RS485 communication. I basically need only modbus fuction no. 4 I've tried writting that function using TXD and RXD but they were converting all the data I was sending to ascii. Some code for CX-Programmer on doing that communication would be a very helpful. The next step was to try PMCR which as I see works only if I program the PMSU with some macros. Sleepy Wombat sorry for writing wrong your nick GREETZ, Jovan

Share this post


Link to post
Share on other sites
Have you ever looked in the download section in Omron utilities ???? Try this link i have never used it.... Protocol downloader.... I am not sure if it works...... Good luck,,,

Share this post


Link to post
Share on other sites
The problem with using the above utility is that the utility itself must be used to create the source file. Sleepy, if you have time, could you: 1. Download your Modbus Mater Macro to the target CPU with CX Protocol (it could be any CJ or CS1). 2. Upload the same Macro using the utility. 3. Save it using the utility's file format. Then it will be distributable along with the Protocol Macro Transfer Utility and there will be no need for CX Protocol to load the orginal source code. BTW, does your Macro support Function 04?

Share this post


Link to post
Share on other sites
Hi, QUOTE Try this link i have never used it.... Protocol downloader.... I was thinking that program would do the job, I've downloaded yesterday, but the problem is the one that Jay mentioned. I tried to open the .psw file but the program asked for .pmr file It doesn't support the CX-Protocol file format Sleepy, can you do what Jay suggests? I need only the master macro. It would be nice if you divide it in two separate files. One for the master and one for the slave Is there any freely available demo/trail of CX-Protocol? Another thing that I want to ask about the macro are the IDs of the master/slave macros: Since the slave and master routines have the same function numbers if I download whole .psw file (both master and slave) how would I know which macro will be called. For example: if the second control word is 04 (read holding register) how would I know which macro will be called? master or slave? I've noticed an error in the manual that comes with the Sleepy's modbus protocol macro. In the manual the order of the CRC16 bytes are Hi Lo, but in the modicons modbus specifications are CRC(Lo) CRC(Hi). What about the macro?? GREETZ, Jovan Edited by chombium

Share this post


Link to post
Share on other sites
Read the notes again...and have a look at the PLC program required to send (Master) commands...Then look at the asocaited slave routine file in CX-P to see how that can be achieved for SLAVE also.....

Share this post


Link to post
Share on other sites
OK. Here it is: Modbus Master Object Code @ MrPLC.com Read the manual carefully. It shows you exactly what to do. The sequence number in the second operand of the PMCR instruction defines the particular master or slave sequence that will be executed. Also remember that the sequence number is entered in Hex in the PMCR instruction.

Share this post


Link to post
Share on other sites
Sleepy, Jay You were very helpful. Thank you very much. The thing I was confused by, was the possibility of having both master and slave routines in the same SCU, and the equality of the function numbers. I usualy write master or slave not both in the same device. Guees I have to read the manual more carefuly Once again: Thanks a million, I'll probably catch my deadline GREETZ, Jovan

Share this post


Link to post
Share on other sites
Hi again, At first I want to say that the leds on the SCU are finally flashing I forgot the other problem that I have I need the pin out of the ports of SCU41. That would probably be in the SCU41 manual which I couldn't find on the web nor in the download section. Because of the problems with macros that I had, I'm planning to write a protocol downloader, but which supports the CX-Protocol file format. Therefore I need some docs on CX-Protrocol file format. Are there any? GREETZ, Jovan

Share this post


Link to post
Share on other sites
I guess you will have to reverse engineer it like we did for the utility.

Share this post


Link to post
Share on other sites
Thanks, once again Jay A Guess I'll have to put some more effort to make the program. I Assume that the protocol for downloading/uploading macros to the SCU is some of the stadard protocols. Is it? GREETZ, Jovan

Share this post


Link to post
Share on other sites
It's not documented. We had to snoop it to figure it out.

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