Dbanks

Clearing an Array in RSLogix

3 posts in this topic

I'm having a tough time clearing the entirety of an array. I've tried using the copy function, the clear, the fill and the the file synchronous copy functions. I'm solely trying to copy 0's into the entirety of a 20 tag array. Example Tag[0] to tag[20]. I saw another thread here: http://forums.mrplc.com/index.php?/topic/14678-clearing-an-array-in-rslogix-5000/ 

However, that didn't help me. Anyone have any shortcuts here? 
Thanks so much in advance!

Share this post


Link to post
Share on other sites

I'm sure this is not the smoothest way to do this but 

I would use indirect addressing and when I push the clear button the index counter will scroll through the tags one scan at a time every scan add one to the Indexing_Counter till it reaches 20 then stop adding to Indexing_Counter            

Share this post


Link to post
Share on other sites

The COP instruction will work if you have a second array of all zeroes, then you could do this:

COP 
Source	ZeroArray[0]
Dest	Tag[0]
Length 	20

The FLL instruction works like this:

FLL
Source	0
Dest	Tag[0]
Length	20

COP works for a full array into a full array but doesn't work for a single element into an array. The FLL works for that.

Here's how I tested this:

5b2a750d753a9_COPandFLL.PNG.4c3a48cd800b

The SeedArray rung puts numbers into the Tag array while the other 2 rungs both clear it.

 

Also, FYI, this would get more traffic in the Allen Bradley sub-forum.

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