Sign in to follow this  
Followers 0
soundwave

CJ1M Slave on Existing Modbus Network

43 posts in this topic

First chance to look at this post, Sorry... Nibroc, you are doing a bang up job... thanks buddy... And Soundwave you seem to be in the thick of it. The way i see it you are testing the Modbus protocol in a loop back format correct... Not having tried this myself there could be a timing issue... However if you want to simply test the modbus slave routine might i sugget that you can use you PC to run a modbus master routine and talk to your CJ slave.... I would suggest to donwload the following free utility to try this. The comm's cable between the PLC and the PC would be the same RS232 Omron programing cable that you are use to... Modscan download

Share this post


Link to post
Share on other sites
Oh look out!! Sleepy has returned from the wilds. Good to have you back Sleepy.

Share this post


Link to post
Share on other sites
Thanks Sleepy, I have tried this program because you had suggested it another post. I did a little testing before with no send reveive lights on the SCU41 i thought i would simply connect the serial port 2 (slave) to my existing master network (serial port 1) I think my problem is the comms cable. Do you use a standard rs232 straight through cable. ( I use the peripheral port for programming.) If not I have two omron CJ1W-CIF11 rs232 to 485/422 converters I had connected these via two wire SCU41 serial port 2 | CIF11 RDA- , RDB+ | | | | two wire | | | SDA-, SDB+ CIF11 | RS232 gender changer | | PC I only attempted before i tried connecting it to the master network and when i saw the lights flashing for port 2 on the SCU41 card i rejoiced and headed down that path. Thanks sleepy i will atttempt this tommorow at work and trouble shoot the PC to SCU41 further for success

Share this post


Link to post
Share on other sites
Hi, For any connection between a PC and a PLC RS232 port, simply use a standard 'host link' cable (9pin to 9pin). The pin outs is on this web site: Omron Hostlink Cable Just fit the 9 pin connectors (you won't need the 25pin). Once you have this cable, you can test your comms using Modscan, Omron Multiway (it is on the CX-One disk), or windows hyperterminal. The CJ1W-CIF11 is not suitable to connect to a PC, as it requires a 5V supply off one of the pins, this supply is not available on a standard PC RS232 port. Nibroc

Share this post


Link to post
Share on other sites
That has cleared things up Nibroc, As you mentioned the PC does not supply the voltage to the CJ1W-CIF11 converter and this would have been the reason why the program was polling serial port two but i was not seeing the recieve light flashing on the SCU41. The first reason was that i thought the small DIP switches on the unit was a surface mounted IC with a viewing window. How neat i thought. After closer inspection i saw the switches ( 30min later at least) and disciplined myself accordingly. I will get a temporary cable based on the pdf you supplied. I recieved the software Cx - one on tuesday and did not search through the supplied programs i will however look at Omron Multiway. Thanks again guys much appreciated it would have taken months to get where i am now without hte support and knowledge shared here. I will update tommorow when i return to my long weekend holiday batch.

Share this post


Link to post
Share on other sites
A Communication Success !! Serial Port 1 the master is polling the two power meters and storing these process variables in data memory. Serial Port 2 is the slave and is being polled by the Desktop PC. The slave is communicating to the Desktop PC and communicating the process variables that are then displayed using a modbus emulator on the Desktop PC! Many thanks Nibroc for pursuing this thread and for each solution you have provided. The last solution being that the RS232 comms cable. We have a dummy setup with two RS232 connectors wired to terminals on a single board. I wired these up as specified and instant communications!! Conquered!! Sleepy i think you were right on the timing issue so in bold ATTEMPTING TO CREATE A MODBUS NETWORK WITH SERIAL PORT 1 AS A MODBUS MASTER AND HAVING SERIAL PORT 2 AS A MODBUS SLAVE ON THE SAME NETWORK WAS NOT SUCCESFUL Ok so i clean up my code a bit and post the results because this is Nibroc as editor and me as a writer.

Share this post


Link to post
Share on other sites
OK although this code will not assist those that have helped me i am sure others can find use for it. The attached code is for a CJ1M CPU23 and a SCU41 communications unit ( it may apply to other configs but i am unsure) I have serial port 1 connected to two power meters. These power meters are seen as 2 slaves and the PLC is the master. I also have serial port 2 connected to an existing modbus network (one i do not know alot about as yet). The PLC is a slave and the master is an existing SCADA PC. I could run thorugh all the hassles and troubleshooting performed but this is probably best left to this thread and a previous thread > CJ1M & SCU41 - Modbus 2 Slaves, Ladder Program Polling with PCMR(260) http://forums.mrplc.com/index.php?showtopic=4649 Thanks again to Nibroc, Jay Anthony, BobB & Sleepy wombat for their support on these two threads. Also if this is the final version (or something simlilar to this) is permission granted from sleepy wombat in using the Modbus code & protocol and Nibrocs code for passing the token? no responsibilites on your behalf for any bad coding or uneducated applications by myself!!

Share this post


Link to post
Share on other sites
Hello Soundwave, Great to hear you have succeeded. Yes you can use any code (or fragments of) I have provided - no problem. (See 'MrPLC Terms of Service to use the FORUM' - basically everthing on this site is supplied 'as is') Will be stopping by your district soon - Melbourne? -have a project to commission. Nibroc

Share this post


Link to post
Share on other sites
I was at Campbellfield for 2 days last week and will be in Geelong (Kardinia Park) for 2 days this week. Flying Jet Star to Avalon - lot closer to Geelong than Tullarmarine - no need to go through Melbourne then.

Share this post


Link to post
Share on other sites
... was in Geelong earlier this year (on holiday) - nice spot. I'll be working not far from the Melbourne Airport - flying in from NZ, will stay with my Sister in the City somewhere. Not sure when - sometime in July at this stage. Got another one in Sydney not long after that... Don't usually do too much in Aus though. Happy days ...

Share this post


Link to post
Share on other sites
Brisbane for me Nibroc, I am holidaying myself on Thursday for a couple of weeks! Thailand through Cambodia and then to the base of Vietnam, then 6 days spare to get to the top. Haven’t seen much outside Australia but mum was born at mount maunganui near tauranga where I have spent a few summers. So there was a panic to progress with aspects of the programming in particular knowing the communications link is possible and capable (hence the weekend work!). This project was won after I had planned the holiday and the boss gave me a good deal more responsibility but incidentally a holiday during a busy time of the project. Not to worry though. Thanks for the terms of use, this leads me to believe that a “unreliable but mostly unpredictable coding” should have been my username. Thanks again guys i am sure you will see my name here in two weeks!

Share this post


Link to post
Share on other sites
Maybe you could show us where ya'll are talking about.

Share this post


Link to post
Share on other sites
Going to Thailand for a holiday in october!! Map.... for Jay.... Nibroc

Share this post


Link to post
Share on other sites
Glad to see you finally got it working Soundwave.......

Share this post


Link to post
Share on other sites
Any good pubs and restaurants you can recommend?

Share this post


Link to post
Share on other sites
Well... only passed thru on a road trip... had a couple (of few) beers at this place on a jetty... had a great view of the harbour looking across towards Melbourne!! NIBROC

Share this post


Link to post
Share on other sites
Hi, I'm trying to do something similar using scu, you could send me this code?

Share this post


Link to post
Share on other sites
The thread that you posted in is more than 8 years old. Current generation SCU cards have a Mode that you can select that directly supports Modbus RTU as a slave with no code or PMCR needed.Assuming your PLC and SCU hardware is new within the last few years, this is a much easier way to do Modbus RTU slave.

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