Sign in to follow this  
Followers 0
ChrisKozanecki

Strange Comm Port Results

14 posts in this topic

I have a strange (to me at least) situation with some CJ PLC's that I have, and I am hoping someone can help me eliminate the problems. Specs: They are CJ1G-CPU42H PLCs. They have an ID231 and an OD231. The Comm port is connected to a PC Comm port, and the cable is always connected. Using TXD and RXD to communicate due to small ammount of traffic. Troubleshooting: I find that when the PC is already powered up, the PLC will have a perfectly functioning RS-232 port when it powers up. I have no issues when the device powers up and I try to use the program on the PC to communicate. I find that when the PLC is already powered up, the PLC will not have a functioning RS-232 port when the PC powers up. No form of communication through this port is possible, not even connecting to another computer or another program. Power cycling just the PLC at this point will fix the problem I find that if the Cable is not connected to the PLC comm port it doesn't matter which powers up first. They port will always function. Conclusion: So based on my above findings, I am assuming that the PLC does some sort of 'protected' state on the comm port? Is there a way to reset this state within the ladder logic so that the PC and the PLC dont have to be started in a specific order? This has been causing confusion for all the operators of the machine. I appreciate any advice that can be given.

Share this post


Link to post
Share on other sites
Just a thought, try the STUP instruction. Did not review, but I think there are settings in the instruction for port "defaults". Have used this before to change port settings. Hope this will help.

Share this post


Link to post
Share on other sites
I looked at the STUP command, and it seems that it might be for a Comm unit. Does it work for the built in Rs-232 port, and if so how do I specify the onboard port in the N operand? EDIT: I found a book that had a little more detail. It seems it will work for the onboard RS232, but I am now stumped on the settings words. I cant seem to find where it tells me what S0-S9 equate to, and I have a custom setting I need to retain. Edited by ChrisKozanecki

Share this post


Link to post
Share on other sites
Chris, Refer to W340 manual for STUP Control word setup, it will work with the on board port. Best description I have found for the Source word values are in the W393 manual under the PLC Setup section, should be Section 7-1-2-7 (W393-E1-07). Basically the STUP instruction writes to addresses 160 - 167(?) for the "Host Link" port. Setup the Source data based on the info in this section and you should be good. It is a bit confusing at first look, but it should make sense. Let me know if you have any question and I can try to help. I am sure Jay can breeze through this. Hope this will help.

Share this post


Link to post
Share on other sites
I found what you are talking about in W393, but unfortunately that wasn't much help. I am going to continue looking for the actual meanings of each bit in these 10 words from S to S+9. I know that if I put 0000 in S it will reset to default settings, and right now I am wishing we didn't need the special settings.

Share this post


Link to post
Share on other sites
I'm a little confused. The W393 manual does detail the bit settings for the Source words. What are your special settings?

Share this post


Link to post
Share on other sites
perhaps its the version of manual I have. It is running // 9600,7,E,2,N // RS-232 Mode // start code 0x0002 // end code 0x0003 its not that strange, but its not default either.

Share this post


Link to post
Share on other sites
Chris, Take a look at the attached pdf. It is the section from the manual. S0 = 160, S1 = 161, etc. If I get a minute, I will try to verify the Source data values. If you are in a hurry, talk to Mano or Michael, they should be able to help. Hope this will help. STUP_RS232_No_Protocol_Settings.pdf

Share this post


Link to post
Share on other sites
If I understand your settings correctly: S0 = 1300hex S1 = 0000hex S2 = 0000hex S3 = 0000hex S4 = 0203hex S5 = 1100hex Hope this will help.

Share this post


Link to post
Share on other sites
That's the conclusion I came to also. I will try putting it onto a machine and see if it does the reset I am looking for. Thank you for all your help.

Share this post


Link to post
Share on other sites
Hi, I have exactly the same problem. I found out that with the command stup(239) i can reset the communication and it works. But stup(237) only works if you modify the current settings, so that i have to do a stup with a non-desired settings and then a stup with my settings. Everything its a mess and i think its not the best solution. Could you tell me the solition you implemented? Thanks

Share this post


Link to post
Share on other sites
... What about using the port restart bit. A526.00 This will reset the RS232 port. Nibroc Edited by Nibroc

Share this post


Link to post
Share on other sites
There is an FB in CX-One V2 for setting up a Modbus slave serial port. Dissecting the STUP function in the FB may be of help.

Share this post


Link to post
Share on other sites
It looks like a good solution would be to identify the error and restart the rs-232 port after it ... I'll try Thanks

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