Tag inside array in AB

macgioo2

Member
Join Date
Oct 2009
Location
Cambridge
Posts
98
Hi guys,

Can anyone tell me if it possible to pass a tag (not a value) into an array in compact logix. I want to then index the array.

Eg. 8 pallets with individual timers, index one position at a time. I want to index the times along with the pallet number associated with it.

Any help would be greatly appreciated.
Thank you!
 
Not clear what you mean....

Do you want to address elements of arrays using a tag value...

Array(IndexTag] where IndexTag is a tag that can be incremented/decremented etc.

That is called "Indirect Addressing".
 
I was hoping to move timer.acc (which are still running) values up through the array using FIFO.

I'm not sure how to point to the running timer and index the array.
 
Yes I understand this, but!

The timer is running..... therefore this the .acc value is forever changing. I feel i need another tag which picks up this number (indirect address) then I want to pass this tag not its value in the position 8 (the last position of my FIFO).

Then I will index the array, the timer value (which is still active) moves into position 7 of my FIFO array and I write a new value from a different timer into the now vacant position 8.

Can this be done?
 
You have to decide in which moment you read and move .acc value to your array.
I don't know what you're doing with that value but definitively you can move it to your array.
 
The timer is running..... therefore this the .acc value is forever changing.

This might be the source of your confusion. The .acc word in a timer tag is not forever changing, it changes ONLY when a timer instruction addressed to that tag executes. The accumulator is updated and it then remains at that value until the timer instruction addressed to that tag is executed again. A timer is not a device, it is a computer instruction that operates on a location in memory.

If you want to see a demonstration of how the .acc does not update until the timer executes again then put a timer in a periodic task with a period of 30 seconds and then watch the .ACC change in 30,000 count increments just once every half minute.




I feel i need another tag which picks up this number (indirect address) then I want to pass this tag not its value in the position 8 (the last position of my FIFO).

Then I will index the array, the timer value (which is still active) moves into position 7 of my FIFO array and I write a new value from a different timer into the now vacant position 8.

Can this be done?
Yes. Just address TimerTagName.acc.



For what its worth, the way timer instruction tracks time is it stores a time stamp in the LSB of word 0. Next time it executes it reads the current system time, subtracts the previously saved time stamp from the system time, then adds the result to the .ACC word. It then saves the system time over the time stamp in the LSB of word 0 so that it can repeat the process on the next execution.
 
Last edited:

Similar Topics

Hi all, I've been using Logix5000 for a while, first version 24 and recently version 32 as I had to update for working on the newer CPU modules...
Replies
2
Views
2,256
Hello everyone .. I need ahelp for complete my project's code , now i succeed by associating my tags with super genie ,But I'm stopped at the...
Replies
0
Views
1,541
I need to do a activity history of all panelview plus users (for Controllogix processor).Only I need to know who's logged and put a value inside a...
Replies
2
Views
2,166
I've written a ladder program, on PLC5 that inserts a tag within a tag. I've tried this in logix5000 and I keep getting an error. How should I...
Replies
2
Views
3,688
I have a German programed ME program. I want to know what tag in the PLC a latched button turns on. However when I open up the tag properties I...
Replies
14
Views
196
Back
Top Bottom