CLX to Flex read/write

HallerGK

Member
Join Date
Jan 2009
Location
Indiana
Posts
26
You may remember me from my "CLX to SLC 3/05" thread.
Thanks to the DF1 messaging solution offered by Ken, the project was a success. Delicious cake for everyone.

Now I've got a FlexLogix and the same ControlLogix, connected via Ethernet/IP.
There are tags all over the Flex (Controller and Program scoped) that I MUST read from and write to using the ControlLogix. Most of the tags are either Floats or Bools

Here's the catch, I'm not allowed to modify the Flex Program.

Does anyone have any advice on how I can read from and write to those tags on the Flex using the CLX?
 
You have to use Ethernet IP messaging from the CLX to the FLX. Message type will be CIP Data Table Read/Write. In the communication tab you will need to enter the path to the FLX in the following format
"ENXT_Module_Name, 2, FLX_IP_Addr, 1, 0"

There are two important considerations here:

- If the tags you wish to read from the FLX are not organized into an array, you will need ONE MSG PER TAG. Try to have the FLX programmer dump all required tags into a READ array and a WRITE array.

- You cannot read program scoped tags.
 
One non-reliable, inefficient, time-consuming method is to use RSLinx OPC server. An OPC client can then read program scoped tags from the FLX and then write to tags in the CLX. Quite a lot of programming will be involved and you will be relying on a PC to pass data.
 
Well too bad. The part that handles program tags will have to stay then. I do not know of any other way to read/write program scoped tags.
 
I thought we had agreed on just you-can't-do-that messaging technique per week.

The very best thing to do would be to try carefully to overcome the you-can't-touch-it restriction, so you could write a little logic in each Program to copy the data you need to Program-scope tags, preferably arrays or UDTs.

The Boolean tags might remain a sticking point. Neither Message instructions nor Producer/Consumer tags will let you choose Boolean as the data type.

But I do know a neat way to get to Program scope tags. After all, RSLinx can do it, why couldn't Logix ?

What you do is circumvent the MSG instruction's syntax checker by using a COP instruction to move a String Tag value into the .RemoteElement sub-element of the MSG control tag.

MSG control tag = "GetObscureData", type MESSAGE
Tag Name string tag = "TagPath", type STRING

Value of TagPath = "Program:MainProgram.TagName" (obviously, you put your own Program names and Tag Names in)

Perform a COP instruction prior to executing the MSG instruction.

COP
Source = TagPath
Destination = GetObscureData.RemoteElement

When you're entering the MSG instruction, put a dummy tag name into the Source Element field; RSLogix doesn't know that it doesn't exist, and it will be replaced before the MSG occurs.
 
Wow Ken! I never thought this was possible. I knew you could programmatically alter the sub-elements of the message control tag but accessing program tags like this!!! I feel enlightened... (assuming you have already tested that this works)
 
Yes it is brilliant.
I knew there'd be a way to do it. Stick-it naysayers.
That's like the guy who scanned a 45 record, loaded the image onto his computer, and wrote a program in visual basic to measure the distance between the grooves on the record and play the music.

Luckly, we finally got permission from the plant manager to reload the flex. I made an array in the controller and just used structured text (generated in excel) to copy the values over. Now I have what I need to do a CIP data table read.

But I just keep getting those darn status codes.
 
Last edited:
Originally posted by Ken Roach:

What you do is circumvent the MSG instruction's syntax checker by using a COP instruction to move a String Tag value into the .RemoteElement sub-element of the MSG control tag.

OK, now that one that one winds me up. Who at Rockwell decided, in their infinite wisdom, that a valid data access that the protocol can handle would be flagged as an invalid entry in the development environment?? Someone needs a good, solid ball kick for that one.

Keith
 
That's just it though, a bad message instruction can cause a non-recoverable fault, even on a good day. Program tags arn't ment to be accessed by other PLCs, they are ment to be local, not global. The one who deserves the ball kick is the idiot who program-scoped all the valuable data in the first place.
 
Alrighty, so I packed the bits into a DINT[8]
And I have my message configured comme ca:
===================================
Msg Type: CIP Data Table Read
Source Element: MyDINTArray[0]
Number of Elements: 8
Destination Element: MyDINTArray[0]
====================================
o_O Error Code:16#0004 Extended Error Code:
Error Path: **Classified**
Error Text: |0| syntax error
====================================

If you (the reader of this) are new (like me) and feel that you must give back to the community for their help and support then this should be an easy one, please validate my assumption that it doesn't like that "[0]" at the end of source/destination element. Or is that error coming from something else?
 

Similar Topics

I'm having a brain **** today. I have a 1794-IE8 in slot 01 of a flex rack. Set for 1/4 rack. RIO module added. No yellow triangles. However...
Replies
2
Views
1,573
I'm going to be doing a project and need 24 120 VAC inputs and 16 relay outputs. On Point I/O I was going to use IA4 and OW8 modules. On Flex I...
Replies
4
Views
3,759
Why cannot I add an extra 1794-AENT drop online? I seem to be able to add generic & 1756 modules.
Replies
7
Views
1,807
Guys, I'd like to ask what is the advantage of using Controllogix modules (1756-CN2R) at the remote IO nodes compare to Flex IO modules...
Replies
12
Views
10,412
Just a heads up for anyone that may hit this problem.... Last night, attempting to commission a new panel with 5 PF700VCs, 480V of various sizes...
Replies
1
Views
5,121
Back
Top Bottom