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 am facing an issue while installing the STUDIO 5000 in my windows 10 PC. During installation I am getting an error that " Error...
Replies
3
Views
106
I am connecting to a remote device. When attempting to upload I receive an error that states: Error: Auto_Functions: The Import was aborted due...
Replies
3
Views
164
I recently did a program conversion from logix 500 to studio 5000 and when machine runs it depends on two ton instructions to keep the machine in...
Replies
17
Views
528
Morning, we are changing how we control an HMI by having our users sign into iFix which then sends a tag to the HMI. Looking at a specific DINT...
Replies
2
Views
79
Back
Top Bottom