Timer array-extract or compare done bits?

If I index to a single OTE, it will be overwritten on every index? Also I have to FTV alarm on the proper timer[x].dn bit. Maybe I'm missing something?

It will act pretty much the same as an index MOV would. If the address doesn't exist that scan (indexed to 2, 3, 4, etc) it will not modify the contents of that address.

So if [1] is set True one scan, and the next scan the index is at [2], the contents of [1] will remain unchanged until the index gets back to [1], then it will modify it true or false depending on the logic.
 
It will act pretty much the same as an index MOV would. If the address doesn't exist that scan (indexed to 2, 3, 4, etc) it will not modify the contents of that address.

So if [1] is set True one scan, and the next scan the index is at [2], the contents of [1] will remain unchanged until the index gets back to [1], then it will modify it true or false depending on the logic.

I'm still not following 100%-sorry!

So are you saying to have an indexed timer XIC and an Indexed alarm OTE?
something like the picture?

index coil.JPG
 
I'm still not following 100%-sorry!

So are you saying to have an indexed timer XIC and an Indexed alarm OTE?
something like the picture?

Yes, that should work. It will give you an array of dints, who all have bit "0" following the status of the corresponding Timer DN bit.

So if Timer_alarms[1].DN = True then alarm_array[1].0 will be True, and alarm_array[1] will have a value of "1" (Assuming nothing else modifies any of the bits in Alarm_array). Which will give you a Dint that you can use in your Compare/Search instruction.
 
Yes, that should work. It will give you an array of dints, who all have bit "0" following the status of the corresponding Timer DN bit.

So if Timer_alarms[1].DN = True then alarm_array[1].0 will be True, and alarm_array[1] will have a value of "1" (Assuming nothing else modifies any of the bits in Alarm_array). Which will give you a Dint that you can use in your Compare/Search instruction.

So, in your example, the alarm array wouldn't be using all the bits of each element, only the .0 position?

I was thinking about trying to load into each bit which could be difficult over bit 31 unless I could use a LINT data type.

timer[1]1.dn>>>alarm[0].0
timer[2]1.dn>>>alarm[0].1
timer[3]1.dn>>>alarm[0].2

Maybe it wouldn't be wise to try to do this you think?
 
Yes. In my example you would be using only one bit out of each dint and would need an array of dints that is 60+ long (how ever many timers you had).

Your example, or Pauly's example, you'd be using all of the individual bits of a dint but like you said there would be some hangups once you went over the max bit of your datatype. Either having to choose a larger datatype or do some logic to modify the index number to position the bit into the next word in the array. Or brute forcing each XIC OTE combo and typing it all out.

I think my way uses a bit more memory (larger array) but lets you easily index things.
 

Similar Topics

I have some logic that I have written within a 5380 series controller that tracks the time an event is started, while the event is running an RTO...
Replies
2
Views
102
Hi all, I have a simple question that I have overcomplicated and gotten stuck on. I have a variable, we can call it "light" that I need to stay...
Replies
4
Views
342
Question to anyone with ideas about my thoughts on upgrading a very vintage timer, which is being used to switch between 2 5hp domestic water...
Replies
14
Views
451
why my timer only executes once here? After first time i use it, ET stays at 0ms all the time. It is in FB
Replies
5
Views
322
Good morning guys, I'm searching for a Timer relay which accomplishes the "flasher" condition in the photo attached, however, I need the ability...
Replies
2
Views
560
Back
Top Bottom