Author Topic: Understanding Bits  (Read 10206 times)

Machinery Automation Ltd

  • Guest
Understanding Bits
« on: July 25, 2002, 11:50:59 AM »
Hi all

I am trying to further understand how the T100MD+ assigns bits.....

i have assigned DM[1] to be the control register for a HMI unit (Taian OP26L)

if i wanted to switch bit 12 on, am i right in believing i use the statement

DM[1]=1024

assuming that
bit 0=0,
bit 1=1,
bit 2=2,
bit 3=4,
bit 4=8,
bit 5=16...
..etc..etc...
bit 12=1024

or have i completely missunderstood how this works?

any comments greatly appreciated..

thanks

Russ
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »

support

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3174
    • View Profile
    • Internet Programmable PLCs
Re: Understanding Bits
« Reply #1 on: July 25, 2002, 05:26:42 PM »
You can use the statement:

  SETBIT DM[1], 12

to turn on Bit #12.

If you need to do bit manipulation, you will do well if you assign an internal relay channel to be used as the control register for the HMI. E.g. RELAY[16] occupies relay #241 to #256. You can then define label name for each of these relays and they can be set using the ladder diagram or in custom function using SETIO and CLRIO commands.
« Last Edit: December 31, 1969, 04:00:00 PM by 1076562000 »
Email: support@triplc.com
Tel: 1-877-TRI-PLCS