AutomationDirect
Search
Login | Register
Accounts & Orders
Cart
0
$0.00

Recent Orders

View and Manage | Request Cancellation

Your Account

Account Home

Checkout   $0.00


  • My Orders
  • Product Returns (RMAs)
  • Pay Proforma Invoices
  • Pay Freights
  • Invoices / Invoice Reprint
  • Quotes / Favs / BOMs
  • Packing List Reprint
  • My Product Docs
  • Credit Application
  • Tax Exemption
| Direct Sales in US and Canada | 1-800-633-0405 | About Us | Contact Us | Line Card
Products | Support
| Compare
  
Ordering Tools  
warning Cookies are not enabled on your browser.
Cookies are required for our site. Please enable cookies in your browser preferences to continue.
+
Navigation
+
Shopping Categories
  • Barcode / RFID / Vision
  • Bulk Wire & Cable
  • Cables (Terminated)
  • Circuit Protection / Fuses / Disconnects
  • Communications
  • Drives & Soft Starters
  • Enclosure Thermal Management & Lights
  • Enclosures & Racks
  • Field I/O
  • HMI (Human Machine Interface)
  • Hydraulic Components
  • Motion Control
  • Motor Controls
  • Motors
  • Pneumatic Components
  • Power Products (Electrical)
  • Power Transmission (Mechanical)
  • Process Control & Measurement
  • Programmable Controllers
  • Pushbuttons / Switches / Indicators
  • Relays / Timers
  • Safety
  • Sensors / Encoders
  • Stacklights
  • Structural Frames / Rails
  • Tools & Test Equipment
  • Valves
  • Water (Potable) Components
  • Wiring Solutions
  • Retired Products
+
Learn More
  • Brand Line Card
  • What's New
  • E-newsletter
  • Online PDF Catalog
  • Video Tutorials
  • Company Reviews
  • Learning Library
  • Affordable Training
  • Free Online PLC training
  • Cybersecurity
+
In Depth Product Sites
  • Programmable Logic Controllers
  • Productivity1000 PLCs
  • Productivity2000 PLCs
  • Productivity3000 PLCs
  • ProductivityCODESYS
  • LS Electric XGB Series PLCs
  • ProductivityOpen
  • CLICK PLCs
  • Do-more H2 PLCs or
    Do-more T1H Series
  • Do-more BRX PLCs
  • C-more Touch Panels
  • AC & DC Drives
  • Motion Control Components
  • Servos
  • StrideLinx
  • Pneumatics
+
Product Selectors &
Configuration Utilities
  • PLC Family Selector
  • P1000 PLC Systems
  • P2000 PLC Systems
  • P3000 PLC Systems
  • ProductivityCODESYS
  • CLICK PLC Systems
  • Do-more® BRX PLC Systems
  • LS-Electric® XGB PLC Systems
  • Productivity®Open Systems
  • AC Motors
  • Datalogic® Safety Light Curtains
  • LS-Electric® Servo Systems
  • Nitra® Pneumatic Grippers
  • Object Detection (Sensors)
  • PAL Controller Configurator
  • Precision Gearbox Selector
  • Protos X® Field I/O
  • Quadritalia® Modular Enclosures
  • Stellar® Soft Starters
  • Stepper System Selector
  • SureFrame T-slot Extrusion
  • SureMotion® XYZ Gantry
  • SureServo2® System Selector
  • SureStep® Linear Actuators
  • Timing Belts & Pulleys
  • Werma® Stacklights
  • ZIPLinks
Filter Results Clear All
You've selected:
> Programmable Controllers > Do-more H2 & T1H PLCs (Micro Modular & Stackable)
  •   Shop  
  •   Overview  
  •   In Depth  
Do-more Home Download Free Software
 
Features
Top 11 Ways You Can Do More with this PLC Serial Communications Ethernet Communications High Speed Modules Hign Speed Inputs Motion Control Remote I/O Free Online Training
Free Software
Simulator Auto-Discover I/O Communications Powerful Math Monitoring & Troubleshooting Memory Management Program Management Project Management Security Download the FREE software
Hardware
H2 CPUs T1H CPUs Bases AC I/O Modules DC I/O Modules AC & DC I/O Modules Analog I/O Modules Specialty Modules Go to ZIPLink Selector Tool
Videos


Do-more H2 (Micro Modular PLC) Videos

View Do-more Designer Videos


Detailed Product
Overview



To learn more: https://www.automationdirect.com/do-more?utm_source=BvTuz6H3sD4&utm_medium=VideoTeamDescription - (VID-DM-0049)

Learn how to use casting to save yourself headaches when programming. This video introduces the concept and provides several examples so you can see how easy it is to use.

Online Support Page: https://community.automationdirect.com/s/?utm_source=BvTuz6H3sD4&utm_medium=VideoTeamDescription

**Please check our website for our most up-to-date product pricing and availability.


Hide Transcript
View Transcript
Casting is a great way to make your coding

life so much easier. For example, suppose you want to take an IP

address in the usual format and pack it into an unsigned DWord which is what you’ll need

for some instructions. You could do a bunch of math and combining

and re-arranging to create the properly formatted IP Address, or you can do it the easy way. Using the INIT instruction you can just say

you want this to go into the upper byte of D0, this to go into the next lower byte, this

into the next byte and this into the lowest byte. That colon is the casting operator and it

tells Do-more exactly how we want to transform or ‘cast’ one data type into another using

this code. In the SETUPIP instruction for example, you

can now use D0 as the IP address. Now your IP Address is easy to maintain and

the intent of your code is obvious so when you come back to look at it in the future

you will see exactly what you meant to do. Suppose you want to take one bit of an unsigned

word and use that to drive an output coil. You could do some math and masking and shifting,

etc. But why not do it the easy way? Simply tell Do-more you want the 4th bit – numbering

starts at zero – to drive the output? We’re just telling Do-more to transform

– or cast - the 4th bit of the word into a bit type to use in this contact. Easy. Suppose you receive a number from some other

device in Modbus holding register 10 and you know it is intended to represent a real number. You could do a bunch of math to convert that

into a real number format, or, you can use casting to simply tell Do-more to do it for

you. Casting is a super-fast shortcut around a

lot of programming headaches. The help topic covers every possible way you

can cast one thing into another so take a look at that to learn more. And check this out. In the element browser, this little button

down here is awesome. Suppose I want to take a V memory element

and pull one bit out of it. Look – it shows me the exact format I need

to use! How about a taking signed word and pulling

out a byte, the upper byte and we want it unsigned. There’s the exact format I need. So when in doubt, use the cast builder – it’s

quick and easy. Once you get the hang of casting will quickly

become one of your favorite programming tools. And if you need more help with casting, contact

AutomationDirect’s free award winning support team during regular business hours. They will be happy to help. And don’t forget the forums. There are lots of automation professionals

there that love to share their years of experience. Just don’t post any questions directed at

AutomationDirect’s support team there, they don’t monitor the forums on a regular basis. Spend Less, Do More, With AutomationDirect.


Playlist Not Found Could not find playlist PLPdypWXY_ROoEcDCcD10Qdb3S9tOmfEn5

Playlist Not Found Could not find playlist PLPdypWXY_ROoJx-HnK9gj2Z5a-i7th-UK

Playlist Not Found Could not find playlist PLPdypWXY_ROqvbaYVBWc3kH-pP01fI4-E

Playlist Not Found Could not find playlist PLPdypWXY_ROr5OPw3e0o8rLC0JQijmCNY

Playlist Not Found Could not find playlist PLPdypWXY_ROrtSkGYNq8Xc52QWTCWf2Ci

Playlist Not Found Could not find playlist PLPdypWXY_ROrRJ5YuFYxs3mSXr9250AN7

Playlist Not Found Could not find playlist PLPdypWXY_ROqJO86ikigKmjnSkbguBKBw

Playlist Not Found Could not find playlist PLPdypWXY_ROqWWy8OnWGt3YD4Dald6uf-

Playlist Not Found Could not find playlist PLPdypWXY_ROrmjIdXLaeovoTLZP65hdac

Playlist Not Found Could not find playlist PLPdypWXY_ROoqTZihvX8c8UUj5GzVCuKH

Playlist Not Found Could not find playlist PLPdypWXY_ROr0ZfCV-fAgau5yDemA19CV

BRX Do-more PLCs - Motion Control & High Speed Inputs
  • Video
    BRX Do-more CTRIO2 Motion Demo Hardware from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Config & JOG from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Dynamic Motion from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Using Limits from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Trapezoid Moves from AutomationDirect
  • Video
    BRX Do-more CTRIO2 Motion Using Encoders from AutomationDirect
BRX Do-more PLCs - Hardware
  • Video
    How To Sense Temperature with a Do-more PLC from AutomationDirect
  • Video
    How To Detect Objects with an AutomationDirect Do-more PLC
  • Video
    AC Motor On/Off with Do-more PLC Part 1 from AutomationDirect
  • Video
    AC Motor On/Off with Do-more PLC Part 2 from AutomationDirect
  • Video
    How to Sense Distance with an AutomationDirect Do-more PLC
Contact, Connect & More
Sign Up
to receive:
FREE e-Newsletter
sign up today!
Connect With Us
Social Media Channels:
linkedin    facebook    x    instagram    youtube
Company Information
About Us
Brand Line Card
System Integrator Program
International Sales
Panel Builder Program
Site Help
Company Reviews
Download Price List
Contact Us
Contact Options
1-800-633-0405
Monday - Friday
9 a.m. - 6 p.m. ET
excluding holidays
Career Opportunities
Voted #1 mid-sized employer in Atlanta
We're a great place to work!
Check out our job openings

Need Training?
Affordable Training by Interconnecting Automation
Free Online PLC Training
FREE Video Tutorials
Information & News
What's New / In The News
FREE e-Newsletter
Automation Notebook
Product Literature
White Papers
News, Product and Training Bulletins
E-Books
Shop with confidence
Checked   Safe & Secure
payment methods


We accept VISA, MasterCard, Discover, American Express, PayPal or company purchase orders.
AutomationDirect

BBB Accredited

Voted #1 mid-sized employer in Atlanta
Check out our job openings

Copyright © 1999-2025 AutomationDirect.  ALL RIGHTS RESERVED.
Site Map     Send Us your Feedback     Unsubscribe     Email Preferences     Legal & Business Policies     YouTube Terms of Service
Clear login credentials



Back to Top


spinner Updating...
Info
„