
adccommunitymod (AutomationDirect) asked a question.
Created Date: May 08,2010
Created By: Steve Bailey
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
I have an application where a C-More is acting as a communications bridge between two controllers. For one controller, the C-More communicates serially using Modbus RTU. This controller's code is locked. I can only read and write to a specific range of addresses. I'll call this controller "Serial " For the second controller, the C-More communicates via ethernet. I wrote the code in this controller and can modify it as needed. I'll call this controller "Ethernet ". The C-More reads data from Serial and passes it along to Ethernet. It also reads data from Ethernet and passes it along to Serial. Serial has a built-in communications watchdog so that if it detects no communication between itself and the C-More it reverts to a set of default values. I'm trying to figure out a way to detect lack of communications between the C-More and Ethernet and have the C-More inform Serial of that loss. So far, all I 've been able to come up with is to monitor the system tag "SYS ERR Error Code " and to set a tag value in Serial when SYS ERR Error Code equals BCD 1001. The problem is that once SYS ERR Error Code has a nonzero value, it retains that value until overwritten by a new error or a power cycle on the C-More. So if communications get restored, the value doesn't change. That means I can only detect the first instance of communications loss. The work-around I 've settled on is to have the SYS ERR Error Code = 1001 event also drive the C-More to a screen with a message that instructs the operator to cycle power to the C-More. That message screen has no navigation buttons to move off it, so the operator is forced to comply. I'm seeking a more elegant solution.
Created Date: May 08,2010
Created by: a agnone
Here is an example I use for the ethernet. Works very well. Tell me when the communication between the two machines is lost. This is the first time I tried to post code. Hope it worked.
413
Created Date: May 08,2010
Created by: Steve Bailey
Thanks for that, but I think you misunderstood what I'm trying to do. In the PLC that I can edit, I already have comm loss detection logic. I need something in the C-More that I can use to tell the Serial controller (whose logic I can't modify) that the C-More is no longer communicating with the Ethernet controller.
There is an internal tag in the C-More called SYS ERR Eror Code that I am currently using. A communications timeout on any port will place a value of 1001 (BCD) in that tag. However, the value in the tag remains there until some other event writes a new value to it. Restoring communications doesn't change the value. The tag is read-only, so I can't make an action in the C-More's event manager write to it.
Created Date: May 10,2010
Created by: krak
You said you could read and write to a small range in the Serial controller. If you have any extra space to use, you can have your Ethernet controller write a 1 in that space, have a small delay, and read that space. If it is a 1 you are good to go, if it is not you have a com error. If it reads as it should write a 0 in that space, and repeat. You can then use the Ethernet controller to watch over the cmore. I would have to think that once the SYS error happens you can use the event manager to send a signal to Ethernet control that an error has occurred. Use the Ethernet controller to create a new error for the cmore to rewrite the Sys code, if you can’t just clear the code. I would have to think that there is a way to clear it, but don’t see it in the help file. Worst case scenario, you have the Ethernet controller operate a relay to cycle the power of the cmore.
Created Date: May 10,2010
Created by: Steve Bailey
I'm thinking along similar lines. In the event manager one of the actions in response to the lost communication with the Ethernet controller can be to try to read a tag from the serial controller that's outside of the valid range. That transaction will fail, and give me a different value in SYS ERR Error Code.
Created Date: May 08,2010
Created by: Steve Bailey
I have an application where a C-More is acting as a communications bridge between two controllers.
For one controller, the C-More communicates serially using Modbus RTU. This controller's code is locked. I can only read and write to a specific range of addresses. I'll call this controller "Serial "
For the second controller, the C-More communicates via ethernet. I wrote the code in this controller and can modify it as needed. I'll call this controller "Ethernet ".
The C-More reads data from Serial and passes it along to Ethernet. It also reads data from Ethernet and passes it along to Serial.
Serial has a built-in communications watchdog so that if it detects no communication between itself and the C-More it reverts to a set of default values. I'm trying to figure out a way to detect lack of communications between the C-More and Ethernet and have the C-More inform Serial of that loss. So far, all I 've been able to come up with is to monitor the system tag "SYS ERR Error Code " and to set a tag value in Serial when SYS ERR Error Code equals BCD 1001. The problem is that once SYS ERR Error Code has a nonzero value, it retains that value until overwritten by a new error or a power cycle on the C-More. So if communications get restored, the value doesn't change. That means I can only detect the first instance of communications loss. The work-around I 've settled on is to have the SYS ERR Error Code = 1001 event also drive the C-More to a screen with a message that instructs the operator to cycle power to the C-More. That message screen has no navigation buttons to move off it, so the operator is forced to comply.
I'm seeking a more elegant solution.