JustAnotherEngineer

Referencing I/O as Integers

6 posts in this topic

I'm doing a PLC upgrade and the system currently has a ControlLogix controlling various other racks. Some have been updated to ControlLogix, some to CompactLogix and some still remain on PLC5 racks. We are upgrading from the PLC5 to a CompactLogix in the cabinet we're working on. The program currently moves INT values from an RIO to a different integer. To keep the conversion as simple as possible i was wondering if I can reference the I/O cards as an INT set so that i can just easily swap them out. Attached is a picture of how they're doing it. Simple move command but I would love to see if there was an easy way to swap them out without writing hundreds of lines of code. For reference this is 2 full 16 card racks.

Thank you,

Capture.PNG

Share this post


Link to post
Share on other sites

as shown, both source and destination are already array elements. so by controlling index on both ends, one can transfer data any way you like. index is the value inside square brackets. this value can be hardcoded like in your example or it could be a pair of variables that you control

Share this post


Link to post
Share on other sites

I guess what I'm asking is can you reference the IO cards on a CompactLogix as such. Such as Local:2:1:Pt01.Data through Local:2:1.Pt15.Data. This would make the conversion 10x easier but currently i can't think of a better way to reference it as an array/integer set. I'm sure I'm missing something but perhaps the only solution is to move the data for each individual point rather than a mass move.

Thanks,

Share this post


Link to post
Share on other sites

When referencing CompactLogix it is best to state what processor you are using as the Local data format has changed with the 5069 processors, if that is what you are using then Rockwell have a AOI that converts the 5069 format to the older format.

Share this post


Link to post
Share on other sites

I will attach the strip of tags below for one of the cards I will be referring to. What I'm after is being able to access the .Data from that card as an integer so that I can just swap out the old Integer grouping that is being used on the RIO.

Not sure a better way to describe it. I will also attach the format of the data that's coming in via RIO. It is labeled _001:I.Data and then each card on that rack will have an integer set under that with each bit being an input. I'm looking to see if the IO cards on the CompactLogix (5069 series) can be referenced in such a way that would format the data points into an integer array so all i would have to do is swap the tag in the move command that is currently moving the data from say _001:1.Data[0] into an integer array that is being used in the program. I[8] from the earlier post. Is that a possibility or am I just hoping for a function that isn't available. My goal is to avoid having a rung for moving each individual data point which over the span of 2 full 16 slot racks will really draw out the ladder program and make it a pain to read and navigate. I'd like to move all the data from each card as a set of integers but i don't know if that's a thing or how to do it if it is.

Thanks,

 

 

 

 

Capture.PNG

Capture2.PNG

Edited by JustAnotherEngineer

Share this post


Link to post
Share on other sites

When you have the data, fault, and uncertain bits mashed into a data type like that, it will always occupy multiples of 32 bits.  In this case, wasting 29 of every 32 bits.  If you replicate the pattern in your buffered copy, you can use the COP instruction to grab the whole array as-is.  There's nothing that will efficiently copy the bits while rearranging them into adjacent bits of an INT or DINT like the older devices.

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