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

Recent Orders

View and Manage | Request Cancellation
Loading Order History
Loading...Loading...

Your Account

Account Home

Checkout   $0.00


  • My Orders
  • Product Returns (RMAs)
  • Pay Proforma Invoices
  • Pay Freights
  • Pay 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
  • Wire & Cable Management
  • Wire & Cable Termination
  • 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 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
  • 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
  • Pyrometers Selector
  • 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

Productivity PLC User Defined Instructions from AutomationDirect


Related Products

P3-622
P3-622 Thumbnail
P1-M401-15DD2
P1-M401-15DD2 Thumbnail
P1-M401-12DRS
P1-M401-12DRS Thumbnail
P1-M401-16DR
P1-M401-16DR Thumbnail
P1-M412-15DD2
P1-M412-15DD2 Thumbnail
P1-M412-12DRS
P1-M412-12DRS Thumbnail
P1-M412-16DR
P1-M412-16DR Thumbnail
P1-M412-16ND3
P1-M412-16ND3 Thumbnail
P1-M412-08ADL-1
P1-M412-08ADL-1 Thumbnail
P1-M412-04THM
P1-M412-04THM Thumbnail
P1-M412-4ADL2DAL-1
P1-M412-4ADL2DAL-1 Thumbnail
P1-M622-15DD2
P1-M622-15DD2 Thumbnail
P1-M622-12DRS
P1-M622-12DRS Thumbnail
P1-M622-16DR
P1-M622-16DR Thumbnail
P1-M622-16ND3
P1-M622-16ND3 Thumbnail
P1-M622-08ADL-1
P1-M622-08ADL-1 Thumbnail
P1-M622-04THM
P1-M622-04THM Thumbnail
P1-M622-4ADL2DAL-1
P1-M622-4ADL2DAL-1 Thumbnail
P1-622
P1-622 Thumbnail
P1-412
P1-412 Thumbnail
P2-622
P2-622 Thumbnail
P2-550
P2-550 Thumbnail
P1-540
P1-540 Thumbnail
P1-550
P1-550 Thumbnail
P3-550E
P3-550E Thumbnail
P3-530
P3-530 Thumbnail


To learn more: https://www.AutomationDirect.com/productivity?utm_source=-UoxZKbEArM&utm_medium=VideoTeamDescription

(VID-PRO-0008)

Build smarter PLC programs in less time! In this quick, practical walkthrough, you’ll learn how to create and use User-Defined Instructions (UDIs) in AutomationDirect’s Productivity Suite. See how UDIs cut out duplicated logic, make your code cleaner and more scalable, and let you standardize complex control tasks with ease. Perfect for anyone looking to level up their Productivity PLC programming.

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

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


Hide Transcript
View Transcript

AutomationDirect’s Productivity PLCs are powered by the Productivity Suite software — a tag-based ladder programming environment packed with advanced features and smart design tools. One of the most powerful of these tools is the User-Defined Instruction, or UDI. A UDI is like your own custom-built instruction — a modular, reusable block of logic that performs a specific control task. You can think of it as a self-contained mini program, complete with its own memory and input/output connections. If you’ve used Function Blocks or Add-On Instructions on other platforms, you already get the idea. It’s the same concept — reusable, organized code that keeps your programs clean, standardized, and scalable. And if you’re new to the idea, don’t worry — by the end of this video, you’ll see exactly how it works inside Productivity Suite, step by step. Let’s start simple. Imagine your project needs to perform the same mathematical calculation in several places. Rather than copying the same rungs of code over and over, you can build it once as a UDI and reuse it everywhere. To keep things easy to follow, we’ll make a UDI that just multiplies three numbers together — simple math, but a great way to show the process. First, let’s create a User-Defined Instruction. Having already created a new project in Productivity Suite version 4.5.0 or greater, open the UDI Management panel in the Tools menu from the menu bar. Before we create a new Instruction, let’s create a security key that we’ll be able to assign to it. Click the Security Key icon — it’s the fourth from the left — and in the Add UDI Security Key window, create a new one. We’ll call it “KeyA” with the tried-and-true password “guest123.” Next, click the Create New UDI button — that’s the leftmost icon — to open the Add UDI Definition window. Here, we’ll fill in the basic info: name, comment, revision, author, and so on. Let’s assign our KeyA security key while we’re here. Enter the password, and you’re ready to go. On the Properties tab, you’ll see the ID info we just entered. But the real action happens on the Ladder tab — this is where we’ll program the logic. Let’s drop in a Math instruction that multiplies our three values: Input1, Input2, and Constant. We’ll call the result Product. Variables like these that are used within the Instruction are called Parameters. For Data Type, we can just stick with 32-bit integer. For each of these, we can assign a default input value. The Scope column is where it gets interesting. In our example, Inputs 1 and 2 are going to be passed in from the program at large, so we need to choose “In.” The result, Product, will be passed out to the program and so has an “Out” scope. Constant is to be used only within the UDI, so it’s a “Local” variable. An In/Out tag could pass in either direction, but in this example, we don’t have any. Assignment is the process of linking program variables to instruction parameters, so that they can pass data back and forth, and different UDI instances may have their parameters linked to different program tags. “Assignment Required” means that the parameter must be explicitly assigned an external tag or value before the UDI will compile. When a parameter is marked as "Visible", it means that it can be seen on the UDI Instruction widget in a Task ladder editor. The Parameters tab shows all the parameter variables we just created. It would be possible to come to this tab first and create all of your parameters before writing your code on the ladder tab – it works either way. The Devices tab enables users to add a virtual hardware device that the instructions in the UDI definition ladder can reference. Before we deploy instances of this UDI, we should mention that there is another way to create these instructions. If you have an existing task that contains the logic you’ll need in a UDI, simply right-click on the task in the Task Management window and select “Create UDI Definition.” The Task logic will be duplicated in the ladder of a new UDI with the same name. Define your parameters as before. Now we’ve created an instruction. To deploy an instance of, or instantiate this instruction, close out of the UDI definition window and make your way back to the task where you’d like the instruction to be used. Click the far-right side of rung 1, and in the Instructions panel, expand the Program Control menu to find the User Defined Instruction. Double click. In the UDI window, drop down the UDI Definition menu and select the UDI we want to insert. Now you’ll see the instructions’ parameters listed Enter the tags to link to each of the parameters. Keeping things simple, we’ll say NumberA and NumberB are going to be passed into the parameters Input1 and Input2, respectively. The parameter Product will pass out to AnswerA. On the next rung, let's throw down another instance of the instruction. This time, we’ll pass NumberC to Input1, NumberD to Input2, and pass the Product out to AnswerB. Different iterations of the same code. Now, honestly, a simple arithmetic function like this isn’t the best use case for a UDI. In a more realistic situation, maybe you’re working with a system that monitors the levels in multiple liquid tanks of different sizes and shapes. Your UDI may become very complex, with logic for different tank geometries selected by a tank type input and tank measurement inputs, and multiple-level alarms/indications and pump/valve trigger outputs based on setpoint inputs or local parameters. The more duplicated code you can eliminate, the more UDIs really make sense. To find out more about streamlining your code and all the other advantages that Productivity PLCs bring to your projects, visit www.automationdirect.com Click here to see more videos about Productivity PLCs. Click here to check out the entire range of Productivity PLCs Click here to subscribe to our YouTube channel and keep up to date on all new video releases and developments from AutomationDirect.



No data returned!
An error has occurred! Please contact support
Videos Home > Productivity PLC User Defined Instructions from AutomationDirect
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