RSLogix moving data

canoe

Member
Join Date
Feb 2013
Location
Ontario
Posts
1
Hello,I am pretty new to this and a quick have a question.

Got a fairly simple question, On RSLogix 5000 I want to move an analog sample to an array every second for 10s. I have written a solution but it takes up several lines of code.

Basically I have my code going that every second, A counter goes increments and i move the accumulator value into a pointer. and then i move the analog data into an array (the element is the pointer value). I have run into a few issues with resetting the counter and the code gets pretty sloppy.

I really want to know if there is any instructions that i am unaware of that could do this easily and cleanly. I just do not know enough about different instructions.

Any help would be greatly appreciated.
 
Welcome to the forum.
How about using a FAL instruction in Incremental mode, that would eliminate the counter and the FAL will reset itself.
 
The simple way is to use a variable (call it 'Pointer' for instance).
After a rung with a NC contact (Timer.DN ) and your Timer , Use a NO cotact at the start of the next rung. Move the analog value to the array using the pointer for your array address. Branch under the Move instruction with an ADD instruction - add 1 to pointer with destination pointer. Add another branch with a EQU instruction - Pointer = 9 followed by a MOV instruction to move 0 into Pointer.
Please note that the timer is only approxiamately 1 sec. If you require accurate timing then use the system clock with the GSV instruction. (Get System Value ) and generate a pulse.
 
Use a FIFO. (FFL instruction) When the FIFO is full (the .DN bit sets) then stop adding.


One_Second
Timer.DN MyFIFOcontrol.DN
---] [-------------]\[----------+-FFL-------------------+-(EN)-
|Source ANALOG_TAG +-(DN)-
|FIFO ARRAY[0] +-(EM)-
|Control MyFIFOcontrol |
|Length 10 |
|Position 0 |
+-----------------------+




When you want to start over just RESet MyFIFOcontrol.
 
Last edited:

Similar Topics

Hello, I have a question for you guys. I have an AB SLC (505) that I am going to set up an alarm register with. I would like to move the...
Replies
20
Views
6,387
Hello PLC Experts, I want to do a logic where in an analog value will be captured per second or in any time possible and move that value into a...
Replies
2
Views
1,605
Can I run RSLogix 500 with the same s/n on 2 different computers, a lap top and a desk top?
Replies
5
Views
1,679
Is there an easy way to move Program Tags to Control Tags. I know I can export and import tags, but can you import exported program tags into...
Replies
5
Views
13,544
Hello all, The task at hand is a little tricky for me... a novice at best... This is all about an alarm and storing data into rs batch. I have...
Replies
3
Views
5,429
Back
Top Bottom