Sign in to follow this  
Followers 0
Chris_TR

Serial Communication Settings

21 posts in this topic

Hi, I build an Host Link driver to be able to read some memories of a CJ series PLC. But, to be able to communicate, I need to set serial parameters from Cx-Programmer before using my program. So, I want to know if it's possible to set serial communication settings (e.g.:Host Link, 9600, 7,E,2) from my computer by using a RS232 link without Cx-Programmer? Chris

Share this post


Link to post
Share on other sites
If you built your own driver, there should be a possibility to set the port settings either directly through the language you're using (hint: if you tell us what language and which API you're using we might be able to help you better!). I think you can set it through the Windows Control Panel as well.

Share this post


Link to post
Share on other sites
In fact my problem is at the PLC level. I need to configure the PLC itself to use Host Link with known serial communication parameters. I know that I can configure it with Cx-Programmer but assuming that Cx is not available, is there a way to do it otherwise. (I build my driver in LabView and I'm using a CJ1G CPU44H)

Share this post


Link to post
Share on other sites
Ah, I get what you want. The settings you mentioned are standard for older systems, that's why I thought you wanted to change settings of the computer. I'm not so experienced with the CS1 series yet, I presume there are different default settings in that series... The settings are stored in special DM's. It should be explained in the CS1G operation manuals (sorry, I'm too lazy to read them for you, you'll have to look it up yourself). They can be set with a programming console, or you could probably use your own driver to do it as well, (probably some limitation on when/how you can set it will apply). You also have the problem with "sawing off the twig you're sitting on" - it would probably not be a good idea to connect through the port you're trying to change settings for!

Share this post


Link to post
Share on other sites
Excellent point TERdON! Chris_TR, You can use the STUP(237) instruction to modify the serial port setup. This instruction can be triggered by your code. Hope this will help.

Share this post


Link to post
Share on other sites
Thank you both for your answers... Assuming that I don't know the current settings of the PLC's serial port, is there a way to communicate with it? The situation is that my software has to communicate with various PLCs that are already programmed and running... Is there some "generic" command, or any dip switch, that I can use to communicate with it in the first time...?

Share this post


Link to post
Share on other sites
Chris, The CJ Series does have a dip switch for each port (peripheral and serial) which will force the port to the default communications settings. Nibroc

Share this post


Link to post
Share on other sites
Hi Nibroc, Yes, you're right. But I already tried this option.....put dip switch #5 ON (default settings) and used settings specified in doc. But it didn't work. Maybe I did something wrong...I will try it again tomorrow.

Share this post


Link to post
Share on other sites
Just a fly in the dark but do you have the correct cable? There is a file in the download section for Omron cables - non standard.

Share this post


Link to post
Share on other sites
Hi BobB, I'm quite sure that my cable is ok....because I can communicate with the PLC with my driver or with Cx-Programmer. I attached the figure on how I build the cable (doc. no. W393-E1-08).

Share this post


Link to post
Share on other sites
Did you try powering down the PLC after setting the DIP switch?

Share this post


Link to post
Share on other sites
I've just try it but it didn't work to. Do you know which settings Cx-Programme use to communicate with the PLC.

Share this post


Link to post
Share on other sites
Default Communication settings for the peripheral port is Toolbus, 9600,E,7,2. Default Communication settings for the RS232 port is Sysway (Hostlink), 9600,E,7,2.

Share this post


Link to post
Share on other sites
Well, if CX-Programmer use these settings and it can communicate with the PLC, why my driver that also use these settings can't communicate when the dip switch #5 is ON (default settings) ? It can only communicate when the dip switch #5 is OFF

Share this post


Link to post
Share on other sites
By your answer, we have to assume that you are using something other than the default settings. Is your driver written for Sysway or Toolbus? What are the settings for your RS232 port in the non-default mode? Obviously it is something other than Sysway 9600E72. You are asking us to be something of a mind reader. Please be explicit about how your driver is written.

Share this post


Link to post
Share on other sites
I took a screen shot of the API's settings: According to these settings downloaded from the API, I use the same communication settings as the default one. So, it doesn't matter if the dip switch #5 is ON or OFF if I want to communicate with my driver. Right ? About the driver that I'm using. It's built in LabVIEW. I also took a screen shot of the serial communication port settings: The main question is: Can a home made driver communicate with the API if dip switch #5 is ON, supposing it's using default settings, or just CX-Programme can do that ?

Share this post


Link to post
Share on other sites
I am wondering if there is a problem with the unit number. I am not familiar with Labview but some software I have used requires a unit number above zero. Also, sometimes unit numbers are shifted one to the right as with J Bus. Edited by BobB

Share this post


Link to post
Share on other sites
Here's a quick test....a couple any ways... 1. U can connect via cx-prog using your cable and you are using the same cable when connecting with your lab view right...THAT RULES OUT CABLING 2. When you connect through cx-prog (go online) watch the leds on the PLC indicating comms. THEN go offline and try your application DO the LEDs flash at all ? IF not then there seems to be a problem on the LAbview side. 3. Download Portmon form the down load section. Make sure u run this first before starting either cx or LAb view. Since cx -porg works trial this first. You should be able to see in portmon all of the comm's between the PLC and the Cx-prog. Once you do then stop and close cx-prog, and start your application. Try to start the comm;s in your labview application and monitor through portmon, this will indicate it the labview is even trying to open the serial port for comms.

Share this post


Link to post
Share on other sites
Hi Sleepy Wombat, Thanks for the idea of using Portmon...that's help me to determine that CX-Programmer do not communicate in Host Link mode when dip switch #5 is ON....but in Toolbus mode as I can see from the manual : So, do you know where I can find the Command/Response formats for Toolbus ?

Share this post


Link to post
Share on other sites
If this is happening then i believe that your communication settings to communicate to the PLC are set for tool bus. See attaceched image this dialog should also be set for hostlink (SYSMAC WAY).

Share this post


Link to post
Share on other sites
Yes you are right, but in this case, I need to put dip switch #5 to OFF and set the PLC to Host Link in Cx-Programmer. Back to the main problem that I have: Like I said in previous post, I want to communicate with some PLC's that are already programmed and running with my Host Link driver (that I know it works well). But before that, I need to establish the PLC communication settings to the desired settings "WITHOUT" Cx-Programmer. So, I'm trying to find a setting (PLC dip switch combinason, computer serial port settings/protocol) that will allow me to communicate with these PLC's independently of their configuration.

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