This version of Internet Explorer is either no longer supported by Microsoft, or is obsolete and some features of our store may no longer be supported.
Please consider upgrading or use a different browser.
Cookies are not enabled on your browser.
Cookies are required for our site. Please enable cookies in your browser preferences to continue.
AutomationDirect's COVID-19 Related Supply Chain Update currently shows we have our normal high levels of product inventory. Considered an essential business as defined by the CISA, we continue to fill customer orders in accordance with current rulings. Click here to read or download our full statement. (Updated: 4/6/2020)
NOTICE: FedEx and UPS have suspended all service guarantees until further notice. More information can be found at each carriers website.
Before placing your order, please ensure you will be available to receive packages (and freight when applicable) at your facility.
Our offices will be closed on Friday, April 10th in observance of Easter.
Orders placed by 6:00PM ET on Thursday, April 9th will ship same day (if paid for by Credit Card or charged to a PO account in good standing). Orders placed after 6:00PM ET on Thursday, April 9th will ship on Monday, April 13th (based on credit approval and stock availability).
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.