You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 21st, 2019, 09:42 AM   #1
PeeLC
Member
United States

PeeLC is offline
 
PeeLC's Avatar
 
Join Date: Oct 2018
Location: Krypton
Posts: 30
Tech Studio 5k - Turning number of bits on in an array of arrays.

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
  Reply With Quote
Old March 21st, 2019, 10:09 AM   #2
jstolaruk
Lifetime Supporting Member
United States

jstolaruk is offline
 
Join Date: Dec 2004
Location: Detroit, SouthEast Michigan
Posts: 3,380
What is your exact data types - give an example of the tag definition.
__________________
"You can live to be a hundred if you give up all the things that make you want to live to be a hundred." Woody Allen
  Reply With Quote
Old March 21st, 2019, 12:11 PM   #3
sgtgig
Member
United States

sgtgig is offline
 
Join Date: Feb 2019
Location: Eau Claire
Posts: 1
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.
  Reply With Quote
Old March 21st, 2019, 12:20 PM   #4
Ken Moore
Member
United States

Ken Moore is offline
 
Ken Moore's Avatar
 
Join Date: May 2004
Location: Upstate South Carolina
Posts: 2,522
Take a look at the FFL instruction.
__________________
"To give real service you must add something that cannot be bought or measured with money; and that is sincerity and integrity."
- Donald A. Adams

  Reply With Quote
Old March 22nd, 2019, 03:54 AM   #5
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,513
Quote:
Originally Posted by sgtgig View Post
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.
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem


  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Siemens Step 7 Count Number of Bits Store Result as Integer Galaniz LIVE PLC Questions And Answers 5 June 4th, 2013 02:54 AM
Number of Nonzero bits in a Word grockk LIVE PLC Questions And Answers 45 April 14th, 2012 05:08 PM
Biggest Number in an Array RSLogix5000 BMLLER6758 LIVE PLC Questions And Answers 17 March 11th, 2010 03:14 PM
Usless but maybe fun excercise ndzied1 LIVE PLC Questions And Answers 6 May 15th, 2006 06:28 AM
Building an S7 Array Move Questions DesertDog LIVE PLC Questions And Answers 19 June 17th, 2004 09:51 AM


All times are GMT -5. The time now is 08:26 PM.


.