Sign in to follow this  
Followers 0
IGonza

Communication between CompactLogix and RSlinx

7 posts in this topic

Hello,

I'm new to AB+RSLinx configuration and we use GE rx3i + OPC Driver + Cimplicity. I'm trying to port GE program to AB PLC and got some problems.

GE does synchronization with OPC server (Proficy Driver Server) between the scans. So it runs the code from the start to the end and then update the points - send/receive to/from OPC/HMI.

Looks like for AB it works in different way.

Here is and example of pseudo code that works in GE fine  and not well in AB:

// CMD - point that is set in HMI

if (CMD == 1) then DO_SOME_LOGIC1
.....
....
if (CMD == 2) then DO_SOME_LOGIC2
......
......
.....
CMD = 0

In AB sometime CMD is set to 0 without checking on previous lines. So it means it comes to PLC in the middle of the program execution. (I know how to fix this issue by changing the code)

 

My question is : Is this configurable? Can the communication run in the same way as GE controllers do?

 

Share this post


Link to post
Share on other sites

Older A-B platforms ran with that sort of "comms, then I/O, then logic" cycle but the modern ControlLogix/CompactLogix operating system is interrupt based and you can get situations like you describe where a communications channel can update a tag in between logic instructions or rungs/lines.

It's not "configurable", in the way that you could check a box for "async/sync tag comms".

When I have logic that can be affected by the change in an HMI -written tag during the process, I copy the HMI tag to an internal tag at the beginning of the routine (or before calling the routine, if it's a subroutine or AOI).

 

// HMI_CMD - tag that is set in HMI
// CMD - tag that is used in logic

CMD := HMI_CMD;

if (CMD == 1) then DO_SOME_LOGIC1
.....
....
if (CMD == 2) then DO_SOME_LOGIC2
......
......
.....
CMD = 0
HMI_CMD := CMD;

 

 

Share this post


Link to post
Share on other sites

Thanks for your answer, Ken.

 

How old AB processors are you referencing to? 5 years ago? 10 or 15?

Also, I'm not sure that understand your logic. You have CMD := 0 and HMI_CMD := CMD; that will clean HMI_CMD on every scan and it can face the same problem.

 

What I did for now is :

// CMD - tag that is used in logic

if (CMD == 1) then DO_SOME_LOGIC1; CMD := 0;
.....
....
if (CMD == 2) then DO_SOME_LOGIC2; CMD := 0;
......
......
.....
if (CMD > 0 and FULL_SCAN_COMPLETE) then CMD := 0;
FULL_SCAN_COMPLETE := 0;
if (CMD > 0 and not FULL_SCAN_COMPLETE) then FULL_SCAN_COMPLETE := 1;

 

 

 

 

Share this post


Link to post
Share on other sites

Having I/O and HMI/comms tags update in the middle of the PLC scan is a phenomenon of the Logix 5000 family of PLCs (CompactLogix and ControlLogix).

What he did by writing the HMI tag to an internal holding tag is basically emulate the "old way" of having the I/O and comms tags updated once per scan. It keeps the tag from changing state halfway through the logic. If the HMI writes to HMI_CMD during the execution of LOGIC1 or LOGIC2, it won't matter since the PLC isn't looking at HMI_CMD during that time. It's looking at CMD instead.

I've seen this done with physical I/O as well in the 5000 world. The first step in a program is to read all PLC inputs to holding registers. The holding registers are used in the logic. The logic writes to another set of holding registers that are written to the physical outputs at the end of the scan.

 

Share this post


Link to post
Share on other sites
Quote

 If the HMI writes to HMI_CMD during the execution of LOGIC1 or LOGIC2, it won't matter since the PLC isn't looking at HMI_CMD during that time. It's looking at CMD instead.

Yes, and he assigns it to 0 at the end. So the command will be just ignored/skipped/lost. This is the problem i'm trying to solve.

Share this post


Link to post
Share on other sites

Ah, I see. Can you move the "write to 0" code into the "if...." routine? So it only writes to 0 as a part of LOGIC1/LOGIC2.

Share this post


Link to post
Share on other sites

Yes, this is exactly what I did. As addition, I added the code that makes sure the command will be reset after full scan. I need this in case HMI sends command to PLC. but PLC is not ready to accept it (logically).

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