Sign in to follow this  
Followers 0
Tony

Online status and resetting points after comm loss

7 posts in this topic

Hi, I want to show online status by means of indicators in a CXS project which connects to several PLC's I have been looking for a system point which indicates whether the communication between CXS and a plc is established or not,but can't find anything. like nr open PLC's in CX-server's performance monitor. Also after CXS lost communications with a PLC how can I let the point values drop to their defaults. Hope someone understands my 2 questions. Thanx

Share this post


Link to post
Share on other sites
Ok, online status is solved now, I am using a IsPLCOpen script for that now. so this leaves me with the pointvalues which hold their last updates value after connection loss, but I like them to be resetet to their default values as if comms where never initiated. Thanx again. Tony Edited by Tony

Share this post


Link to post
Share on other sites
I think you would need to hide your indicators (and perhaps show static text indications) using visibility animation on the IsPLCOpen status. Getting the points to revert to their default values is not possible as far as I know.

Share this post


Link to post
Share on other sites
Ok, thanx for confirming Pdl, I was allready thinking in that direction, just didn't want to code something which might allready be incorporated. Thanx

Share this post


Link to post
Share on other sites
Hi. Yes I agree with PDL that setting default values isn't the normal way to handle this. Sounds also like you might be interested in the "Display bad Quality as #" option which 'hides' values that have not been read, and also and calculations and expressions using them. This is quite like the Excel "#ERROR" for invalid numbers an is the incorporated way for indicating that PLC values should not longer be used. You can find this setting under Project menu Runtine Settings->Advanced Settings. Give it a try and hope that does just what you want. Regards, BB

Share this post


Link to post
Share on other sites
maybe it is better to use PLCCommsFailed function, since this function checks whether there is a communication with plc. as i could have seen, plc must first be opened in order to check communication. if, for some reason, plc is turned off while starting cx-supervisor, plc wouldn't be opened, hence no communication will be established even when you turn on plc. you should then restart cx-supervisor. this all applies for cx-s 1.3 and cx-s 2.1 since i've tested it. so i use the following script (on 5 secs interval): PLC_Open = IsPLCOpen("CJ1M") IF PLC_Open THEN PLC_CommFailed=PLCCommsFailed("CJ1M") ELSE PLC_ReOpenTime = PLC_ReOpenTime+5 IF (PLC_ReOpenTime >= 60) THEN PLC_Open_Status = OpenPLC("CJ1M",PLC_Open) PLC_ReOpenTime = 0 ENDIF ENDIF this should every 60 secs try to open plc if not open (that is in the case plc was off when cx-s started - assummed that the Open Device is checked in Setup Devices dialogue). and now you can use PLC_CommFailed point to indicate communication status. Also, on the Initialisation script of cx-s you put PLC_CommFailed = 1 which will be set to 0 if everything is ok after 5 secs when the above script is run. Edited by tashinz

Share this post


Link to post
Share on other sites
bad way, can miss some plc offlines is better to write an incremental dm, then plc copy it into another dm then read the copied dm with supervisor if they match means pc is online

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