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 November 10th, 2017, 03:18 PM   #1
sweetjohnny
Member
United States

sweetjohnny is offline
 
sweetjohnny's Avatar
 
Join Date: Feb 2012
Location: Iowa
Posts: 55
Question Bits vs integers

I've been programming PLC's for a few years now and I recently came across something I have no answer for or reasoning why or why not.

The question is based from programs using RSLogix 500

Question: Why would one guy use a bit(B) where another uses an integer(N)? For example a simple rung using an input to trigger a couple different things in the program. In one program a bit is used to trigger the different items in the program and in the other an integer(N) to do the same thing.

I am just curious why. They both work the same. But i cannot explain why or why not one way or the other.

I am unable to post pictures for examples.
__________________
Sweet johnny

It's a cult, and I am not drinking the kool-aid.
  Reply With Quote
Old November 10th, 2017, 03:26 PM   #2
Dravik
Member
United States

Dravik is offline
 
Join Date: Jun 2008
Location: New York
Posts: 1,363
If I follow, the question is why would someone do

If bit==true then do x
vs
If Int.0==true then do x

One possibility - Some HMI packages had tag based limits, like Fix32 for example. You could pack bits into WORDS and use an offset inside the HMI to use a smaller tag count licence.
Another - Using the bits of a WORD let you perform fun bitwise shifting and boolean algebra functions, along w/ moves and copies.
Lots of other possible reasons.
  Reply With Quote
Old November 10th, 2017, 04:14 PM   #3
sparkie
Lifetime Supporting Member
United States

sparkie is offline
 
Join Date: Nov 2014
Location: KS
Posts: 784
Mainly, on old hmis you had to transmit the data as integer words. The other reason, as explained to me by a fantastic automation engineer is the fact that the programmer learned how to do it that way, so that is how they did it.

You can also pack more data into an integer file than a bit file.
  Reply With Quote
Old November 11th, 2017, 09:49 AM   #4
PLCMentor
Member
United States

PLCMentor is offline
 
PLCMentor's Avatar
 
Join Date: Mar 2009
Location: Carolinas
Posts: 170
Another reason may be data packing. We used to have to be very careful about sending data in packets to make sure we did not bog down our communications. In an instance like that it would make sense to pack your bits into an integer word that was being sent in that packet.
__________________
Russell White, P.E.
Automation Technologies, Inc.
PLCMentor.com
  Reply With Quote
Old November 11th, 2017, 10:07 AM   #5
jstolaruk
Member
United States

jstolaruk is offline
 
Join Date: Dec 2004
Location: Detroit, SE Michigan
Posts: 3,242
Or addressing. With B files, I can reference XIC B3[1000]. Can't do that with integer files.
__________________
"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 November 12th, 2017, 07:53 PM   #6
sweetjohnny
Member
United States

sweetjohnny is offline
 
sweetjohnny's Avatar
 
Join Date: Feb 2012
Location: Iowa
Posts: 55
I think these are all correct answers to the question. Thank you.
__________________
Sweet johnny

It's a cult, and I am not drinking the kool-aid.
  Reply With Quote
Old November 13th, 2017, 02:24 AM   #7
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 1,024
One thing to remember is that by packing bits into a byte, your task of creating your SCADA can greatly be simplified if the bits all follow a standard.

For example, say that your byte has bits that tell you if a valve is opened, closed, faulted, and several alarms/faults on the rest of the bits.

You can then program a faceplate that will take a byte and animate that object with a single byte instead of listing and adding all the different bit length tags.
  Reply With Quote
Old November 13th, 2017, 05:18 AM   #8
LadderLogic
Member
United States

LadderLogic is offline
 
LadderLogic's Avatar
 
Join Date: Jun 2003
Location: Chicagolandia
Posts: 1,278
I might also think of someone who came to Rockwell world from the worlds of other PLC brands, where all the internal memory is not split into "files" of different types but where a same memory location can be addressed by either bits or bytes or words or double words or whatever. They just feel more confident and comfortable this way.
__________________
Don't trust, don't fear, don't beg...
  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
Sequencers randy LIVE PLC Questions And Answers 43 December 20th, 2014 02:10 PM
can you specify bits in omron PLC's maintenance@seta LIVE PLC Questions And Answers 5 January 6th, 2011 03:54 AM
Bits and more bits, chess, bit boards and tidbits. Peter Nachtwey LIVE PLC Questions And Answers 3 May 3rd, 2007 03:21 PM
Please Explain blackslipper LIVE PLC Questions And Answers 7 December 27th, 2005 01:14 AM
integer value = bits on drewcrew6 LIVE PLC Questions And Answers 38 February 15th, 2004 08:11 PM


All times are GMT -5. The time now is 03:22 PM.


.