Sign in to follow this  
Followers 0
PdL

CX-Supervisor 2.1 Ethernet comms

9 posts in this topic

Does anyone know a good method or setting to be able to detect a PLC connected by Ethernet (FINS UDP) going offline, and more important a method to have it reconnect when online again? I am currently using a 5sec interval script to detect offline status by returning the value of the IsPLCOpen handle to a system point which on its turn raises a digital alarm. This works good on startup when a PLC is offline, but when a PLC goes offline during runtime (e.g. pulling the plug) it takes quite a while (even given the 5 sec interval). I also would like the PLC to auto reconnect within CX-Supervisor, just as with CX-Programmer. I asume the background comms using CX-Server is identical for both client applications so this should be possible?? I have tried some scripting using the IsPLCOpen status and controlling the PLCOpen command, but I could not get it to work. I have noticed that when a PLC goes offline, the PLC Open box at the runtime PLC properties is still checked but no status appears. Only when I uncheck and confirm to close the PLC and right after check the box again and confirm to open the PLC, the connection is re-established. Any help appreciated!!

Share this post


Link to post
Share on other sites
Hi PdL, I thought it did this anyway!! You should be able to prove it by removing the PLC cable, but after it is unplugged you should get an error in the CX-Supervisor error log "xxxxx Timeout/other communications error : <PLCName>, [CX-Server: DEVICE, COMMS_FAILED, 0x8A1B] " (after timeout period and retries). Once reconnected you should get "xxxxx Communications re-established on PLC [<PLCName>]". Do you not get this in the CX-Supervisor error log? rgds, Bertie

Share this post


Link to post
Share on other sites
Hi Berti, Yes in the error log it does properly report connection time-out/re-established, but this seems to be independant of the "PLC Open" status within CX-Supervisor. I am now returning the PLCCommsFailed handle instead of the IsPLCOpen to provide a digital alarm when a device goes offline, this works better and it does return the value properly timed together with the comms error in the error logs. But now the next problem, when a device is already offline at startup, it only gives an error "Could not open ... ", but upon plugging the device back in it does not automatically connect, and I manually have to open the device in the PLC maintenance menu. Is it possible to have it connect automatically when a device is available again? Thanks, PdL

Share this post


Link to post
Share on other sites
Hi PdL, Yes you're right... the autoreconnection only works once an original connection has actually been made. If the initial connection fails (whether by "Open on Startup" or manual OpenPLC script) then reconnection is not automatically attempted. I also guess the problem with calling OpenPLC from an Interval script is that it can fill the error log with "Could not open.. " messages? But are you really experiencing that many problems on startup? I guess you're just searching for the 'perfect solution' I think this is a bit "Chicken or Egg" if you understand? You can only tell the device is available again by actually suceeding in connecting - so you have to try the connection first to find out if it is available. Obviously from CX-Supervisor script the OpenPLC is the key way. I wonder if you can use the embedded CX-Server control to do this in the background (using "CXServer.OpenPLC()" VBScript command)? This might confirm that you CAN open it without logging a message if you can't. The only other possibility is way outside my expertise (and probably what your original question actually was...) about how from VBScript to PING or detect an Ethernet node is present. Personally, I would just have a popup page that opens when your alarm is set saying "PLC is offline" with a button to manually call OpenPLC. Bertie.

Share this post


Link to post
Share on other sites
Hi Bertie, I guess I will go for the OpenPLC interval script on Comms failed or not open status, I don't care for the error log, I have it set to not automatically display, as the messages are not meaningful to the operators. That's why I want to have digital alarm messages e.g. PLC panel ## in room ## connection failed. The popup page with manually calling OpenPLC button is not really clean in my opinion... the operator doesn't know when the device is able to connect again so will keep trying to open etc... The system is running on a ship where we have to deal with non preferent consumer trips and although the PLC and PC power supplies are on UPS power connection break ups are quite common. Thanks for your help!

Share this post


Link to post
Share on other sites
PDL is that a screen shot of the SCADA system you have set up with CX-Supervisor... If so, that looks fantastic.....

Share this post


Link to post
Share on other sites
Yes this is a screenshot of the network page of the Supervisor project. It wanted to give the operator a clear view of the network status and some reference for electrical diagrams etc. It takes some work but the operators appreciate info like this.

Share this post


Link to post
Share on other sites
Here's a few I did a number of years back... Yep, to get the right look takes a hell of a long time... (just finding the pics for the buttons took heaps of time). Would love to see more screen shots if possible... great work once again mate.

Share this post


Link to post
Share on other sites
On 24/09/2008 at 0:31 AM, PdL said:

Yes this is a screenshot of the network page of the Supervisor project. It wanted to give the operator a clear view of the network status and some reference for electrical diagrams etc. It takes some work but the operators appreciate info like this.

Hey, I can't connect to the plc via ethernet. can you tell me the steps you did to do it?


 

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