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

Hi everyone, I have an issue with installation of Studio 5000 33.00.02 DVD Media disc 2 with View Designer on Windows 11. After installation...
Replies
0
Views
26
Hi all. My maintenance department is clamoring for the ability to look at the PLC programs (and we finally have some who can read it.) I have a...
Replies
5
Views
229
Anyone have problems/solutions with Rehosting Studio 5000 to a new computer. Our IT department successfully Rehosted 2 laptops, but the other 2...
Replies
1
Views
103
Hi, I'm quite new to Rockwell PLC and currently trying to implement the following if Sw1 then for i:=1 to 20 by 1 do xEnable := 1...
Replies
4
Views
123
Hello! Hope you are great. I need to make a change in a PLC with ladder logic. I will mount a analog valve and I need to control it in ramp up...
Replies
7
Views
273
Back
Top Bottom