Studio 5k - Turning number of bits on in an array of arrays.

PeeLC

Member
Join Date
Oct 2018
Location
Krypton
Posts
30
Hello PLCs.net!

I have a relatively large array of arrays, and I want to turn bits on in blocks(first 50/200, something like this.)

What is a function that can be used to turn bits on in bulk? I'm more used to more text based languages, this ladder stuff is kind of trippy.

I have around 400 bits, and don't want to turn them on by hand. Is there an easier way to do it?

Please let me know, thanks!
Thanks!
-PeeLC
 
Without knowing more about what you're doing I assume you should use loops and indirect addressing.


An array of arrays? Do you mean a 2D array? Then I believe the format for indirect addressing is Array[w, x].[y], which points to the yth bit of the xth element of the wth array.


Use Jmp and Lbl instructions to make loops.



If you prefer text languages, Structured Text is generally better for big array manipulation tasks like this.
 
Use Jmp and Lbl instructions to make loops.


Why ?



There is a FOR instruction which executes a subroutine file a specified number of times.


I avoid JMPs and LBLs like the plague, code becomes position dependent, you often can't see the corresponding JMP to a LBL and vice-versa, and there's always the potential for no "get-out clause", causing an infinite loop and faulting the processor on watchdog timeout.
 

Similar Topics

Compactlogix controller, program has 28 conveyors that use TON's to start the conveyors. The TT sounds a warning horn during start and the DN...
Replies
5
Views
51
I have to start out by saying I am not a PLC programmer and I have basic programming skills but mainly use software as a troubleshooting tool. I...
Replies
0
Views
39
Hi everyone, I was wondering how we declare Persistent Variables in Studio 5000 (main reason to keep the values during power cycle and program...
Replies
5
Views
176
I'm adding an IAI Gateway with 2 axes connected to it. To an ethernet network on my PLC. So, I think the math is correct on the Input and Output...
Replies
0
Views
66
Back
Top Bottom