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

Hello, I have a panelview plus that reads from 4 different PLC's. 2 of these used to be Micrologix PLC's and someone else went and updated them to...
Replies
3
Views
79
Hello everyone, I'm new here, I hope someone can help me. I've been trying to install EDS files to my Studio 5000 with the EDS tool installer but...
Replies
3
Views
91
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
4
Views
168
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
178
Back
Top Bottom