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 January 23rd, 2012, 07:20 PM   #16
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
Its a perfectly good answer - wish I could get the messages across with so few words
__________________
___________________________
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
Old January 23rd, 2012, 07:40 PM   #17
Kev77
Member
United States

Kev77 is offline
 
Kev77's Avatar
 
Join Date: Mar 2008
Location: Beaverton, Or
Posts: 392
Can you give me an example on when to use a Bool[32]. For stuff like process_ready, I will use single Bools, but for oneshots, test bits, and alarm bits it has always been easier to use DINT's. DINT's work real well in alarming.

Thanks for the responses!
  Reply With Quote
Old January 23rd, 2012, 08:06 PM   #18
rkukl
Lifetime Supporting Member
United States

rkukl is offline
 
rkukl's Avatar
 
Join Date: May 2002
Location: USA MA
Posts: 152
I would kindly suggest reading the following Tech support article on the AB website

answer ID> 41378 - ControlLogix data always align to 32 Bit boundary
  Reply With Quote
Old January 23rd, 2012, 08:14 PM   #19
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 6,147
Kev77

If using DINTS works for you for oneshot storage bits then keep doing it that way.

For alarms I've developed an affinity for ALMD and ALMA - they are just too handy to not use.

For test bits and the like we define a UDT and call the type PROGRAMMER. It contains a set of Bools called AlwaysON, AlwaysOFF, TOGGLE, a general purpose bool[32] array, a DINT array, a REAL array, a TIMER array, a COUNTER array, and a CONTROL ARRAY. Then tags are created of the PROGRAMMER data type for each of our programmers. This lets us all automatically see which programmer is troubleshooting, debugging, or testing changes to a program. If someone else sees XIC CONNOLLY.AlwaysOFF on a rung then they know it is me who has temporarily disabled something as opposed to an AFI that carries no information with it.

If I want to group bits then I frequently use bit overlays. I hesitate to get too deep into overlays as it is an advanced programming topic, but here goes anyways. An overlay is a special kind of a UDT.

For example, I might have a DINT tag named State. However I want each bit in STATE to have a name, not just a bit position number. I might want something where
State.0 = Reset State
State.1 = Pick up Part
State.2 = Move Part to Fixture
State.3 = Clamp Part
State.4 = Apply glue,
etc.
But rather than remember what each state number is I would like to be able to name each bit, much like a timer has a .DN or .TT bit that has a name as well as a number.
State.Reset
State.Pickup
State.MovePart
State.ClampPart
State.Glue
The overlay lets me reference bits by name and at the same time do something like
MOV 2 STATE (sets state to pickup state)
or
CLR STATE (clear all state bits)
or
State:=State*2 (to advance to the next state, set the next bit up, and clear all others)

This requires that the bits be from a DINT in the UDT. They cannot be bools.

Overlays can offer some significant advantages but they also come with some big disadvantages. You cannot create them in RSLogix5000. You have to create an external XML file to define the overlay and once you import it into your Logix5000 project you cannot change it or edit it. This requires some careful planning. If you want to know more then search the AB KB for the tech notes on bit overlays and I've posted a couple of threads with overlay examples in them that you can find with a forum search.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.
  Reply With Quote
Old January 23rd, 2012, 09:22 PM   #20
Kev77
Member
United States

Kev77 is offline
 
Kev77's Avatar
 
Join Date: Mar 2008
Location: Beaverton, Or
Posts: 392
It makes sense to do it that way. I will check out the AB technotes on overlays and see if I can wrap my head around it some more. It looks like it would work well in sequencing.

As for alarming DINT's work well when working with Panelviews. I agree about using the ALMD and ALMA.

Thanks for the class, tell me where to send the check...
  Reply With Quote
Old January 24th, 2012, 12:30 PM   #21
Craig Spinharney
Member
United States

Craig Spinharney is offline
 
Join Date: Apr 2005
Posts: 54
Quote:
Originally Posted by TConnolly View Post
Kev77

If using DINTS works for you for oneshot storage bits then keep doing it that way.

For alarms I've developed an affinity for ALMD and ALMA - they are just too handy to not use.

For test bits and the like we define a UDT and call the type PROGRAMMER. It contains a set of Bools called AlwaysON, AlwaysOFF, TOGGLE, a general purpose bool[32] array, a DINT array, a REAL array, a TIMER array, a COUNTER array, and a CONTROL ARRAY. Then tags are created of the PROGRAMMER data type for each of our programmers. This lets us all automatically see which programmer is troubleshooting, debugging, or testing changes to a program. If someone else sees XIC CONNOLLY.AlwaysOFF on a rung then they know it is me who has temporarily disabled something as opposed to an AFI that carries no information with it.

If I want to group bits then I frequently use bit overlays. I hesitate to get too deep into overlays as it is an advanced programming topic, but here goes anyways. An overlay is a special kind of a UDT.

For example, I might have a DINT tag named State. However I want each bit in STATE to have a name, not just a bit position number. I might want something where
State.0 = Reset State
State.1 = Pick up Part
State.2 = Move Part to Fixture
State.3 = Clamp Part
State.4 = Apply glue,
etc.
But rather than remember what each state number is I would like to be able to name each bit, much like a timer has a .DN or .TT bit that has a name as well as a number.
State.Reset
State.Pickup
State.MovePart
State.ClampPart
State.Glue
The overlay lets me reference bits by name and at the same time do something like
MOV 2 STATE (sets state to pickup state)
or
CLR STATE (clear all state bits)
or
State:=State*2 (to advance to the next state, set the next bit up, and clear all others)

This requires that the bits be from a DINT in the UDT. They cannot be bools.

Overlays can offer some significant advantages but they also come with some big disadvantages. You cannot create them in RSLogix5000. You have to create an external XML file to define the overlay and once you import it into your Logix5000 project you cannot change it or edit it. This requires some careful planning. If you want to know more then search the AB KB for the tech notes on bit overlays and I've posted a couple of threads with overlay examples in them that you can find with a forum search.
Unfortunately, Rockwell has recommended not going much over 200 ALMA & ALMD instructions in a controler due to overhead required to process them. I suspect the Version 21 changes will lessen the impact of that restrition but only for the 557X series of ControlLogix processors.
  Reply With Quote
Old January 24th, 2012, 02:23 PM   #22
Doug-P
Member
United States

Doug-P is offline
 
Doug-P's Avatar
 
Join Date: Jun 2003
Location: Pa
Posts: 1,243
Quote:
Originally Posted by TConnolly View Post
For the ControlLogix Boolean memory is allocated differently by the compiler and word instructions don't work on it. The compiler allocates a full 32 bit word for a stand alone boolean but it still may contain only boolean information and so word level instructions are not allowed. When you create an array the memory allocation is word optimized but the data type remains the same, meaning you may not use word level instruction on it.
Thanks. I learned something today. (I'm still in PLC-5 land)
__________________
Let's eat Grandma!

Let's eat, Grandma!

Words are very important, but punctuation saves lives...
  Reply With Quote
Old August 22nd, 2012, 10:27 AM   #23
Daniel_LeRoy
Lifetime Supporting Member
United States

Daniel_LeRoy is offline
 
Join Date: May 2011
Location: Dallas, TX
Posts: 91
Thx Guys

Good thread. I learned a lot!
  Reply With Quote
Old August 23rd, 2012, 05:27 AM   #24
robw53
Member
United Kingdom

robw53 is offline
 
robw53's Avatar
 
Join Date: Nov 2009
Location: south yorks
Posts: 513
Dava,

I would be interested in seeing a practical example
__________________
"So far as is reasonably practicable

"Not everything that can be counted counts and not everything that counts can be counted"
Albert Einstein
  Reply With Quote
Old May 16th, 2016, 09:04 AM   #25
ghriver
Member
United States

ghriver is offline
 
ghriver's Avatar
 
Join Date: Aug 2002
Location: Earth>North America>US>CA>Hanford
Posts: 55
how to set multiple booleans

just do it in the structured text. The below will set 64 booleans to 1

Code:
for iCount := 0 to 63 by 1 do
	Hmi_Bools[iCount] := 1;
end_for;
  Reply With Quote
Old June 6th, 2016, 07:41 PM   #26
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
Quote:
Originally Posted by TConnolly View Post
.... I prefer to use stand alone tags. I've never had a memory limitation problem from doing that and a boolean tag named Process_Ready is a lot more clear than B[19].
Have you never thought of making a "Process" tag a UDT of type "Process" that you can define.

Then you can make an array of "Process" tags, so your code will ultimately address Process[5].Ready

Make it even easier to read the ladder, make your "Reingestinate_Lacquick_Comspotle" Process tag as an Alias to Process[5], and the ladder reads clean. e.g Reingestinate_Lacquick_Comspotle.Ready

HMI access to your process data is simplified, because it only needs to interface to Process[5] - think "faceplates" for your process control screens.

Life can be simpler, just needs a bit of thought


Added : Note to self - check posting dates before adding replies, lol
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
nil illegitimi carborundem



Last edited by daba; June 6th, 2016 at 07:46 PM. Reason: Old Posting....
  Reply With Quote
Old December 12th, 2017, 02:20 PM   #27
SanDance
Member
United States

SanDance is offline
 
Join Date: Apr 2012
Location: Cleveland
Posts: 1
Quote:
Originally Posted by bernie_carlton View Post
Second cwal61's suggestion. In logic you can do indirect, using '[]' to make it kind of like an array. If you don't alias the bit then you'll have to type in the bit number yourself from Factorytalk for a display reference.
Sorry for resurrecting an old thread, but this one appeared in my google search: To be more explicit, you can use indirect addressing on a word, and have it act like a bit array by using:

WordTagName.[ArrayElementNumber]
  Reply With Quote
Old December 12th, 2017, 08:42 PM   #28
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 4,360
Quote:
Originally Posted by SanDance View Post
Sorry for resurrecting an old thread, but this one appeared in my google search: To be more explicit, you can use indirect addressing on a word, and have it act like a bit array by using:

WordTagName.[ArrayElementNumber]
Apology accepted, but your post is not relevant to the OP's problem. He wanted to know methods to clear a BOOL[nn] array.

Your example cites an indirection to the BOOL element number of a "word", and I assume you mean a DINT tag, correct me if I am mistaken.

All well and good, in context, until you need more than 32 BOOLean "flags".

PS. Welcome to the forum, make your stay here useful, to yourself and others.
__________________
___________________________
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
ALMA instruction help (RS LOGIX 5000) dginbuffalo LIVE PLC Questions And Answers 1 October 27th, 2011 11:41 AM
rslogix 5000 instruction help md.abdullah LIVE PLC Questions And Answers 16 September 25th, 2011 11:02 PM
RS logix 5000 array question dsg LIVE PLC Questions And Answers 4 September 21st, 2011 07:59 PM
Shifting an array in Logix 5000 shoelesscraig LIVE PLC Questions And Answers 11 January 13th, 2011 02:30 PM
Clear Logix 5000 FBC.IN bit bulletin blues LIVE PLC Questions And Answers 2 July 31st, 2008 05:33 PM


All times are GMT -5. The time now is 07:51 PM.


.