Creating a Parameter
Use the Add-On Instruction Definition Editor to create the parameters for your instructions. Follow these steps to define the parameters for your instruction.
1. In the Controller Organizer, right-click an Add-On Instruction and choose Open Definition.
2. Click the Parameters tab and enter a name for a parameter.
3. Define the Usage, based on the type of parameter: Input, Output, InOut.
4. Select a data type, with the following options based on the parameter usage:
– An Input parameter is passed by value into the Add-On Instruction and must be a SINT, INT, DINT, REAL, or BOOL data type.
– An Output parameter is passed by value out of the Add-On Instruction and must be a SINT, INT, DINT, REAL, or BOOL data type.
– An InOut parameter is passed by reference into the Add-On Instruction and can be any data type including structures and array.
5. If this parameter is intended as an alias for an existing local tag, click the Alias For menu to choose the local tag or its member.
6. Set the default values.
Default values are loaded from the Add-On Instruction definition into the tag of the Add-On Instruction data type when it is created, and anytime a new Input or Output parameter is added to the Add-On Instruction.
7. Set the display style.
8. Check the box to make the parameter required or visible, as desired.
If you decide to make the parameter required, it will also be visible.
9. Type a description, maximum 512 characters.
This description appears in the instruction’s help.
10. Select an External Access type for Input or Output parameters.
11. Check the Constant box for InOut parameters you want to designate as constant values.
12. Repeat for additional parameters.
The order that you create the parameters is how they will appear in the data type and on the instruction face. To rearrange the order on the Parameter tab of the
Add-On Instruction Definition Editor, select the parameter row and click Move Up or Move Down.
1. In the Controller Organizer, right-click an Add-On Instruction and choose Open Definition.
2. Click the Parameters tab and enter a name for a parameter.
3. Define the Usage, based on the type of parameter: Input, Output, InOut.
4. Select a data type, with the following options based on the parameter usage:
– An Input parameter is passed by value into the Add-On Instruction and must be a SINT, INT, DINT, REAL, or BOOL data type.
– An Output parameter is passed by value out of the Add-On Instruction and must be a SINT, INT, DINT, REAL, or BOOL data type.
– An InOut parameter is passed by reference into the Add-On Instruction and can be any data type including structures and array.
5. If this parameter is intended as an alias for an existing local tag, click the Alias For menu to choose the local tag or its member.
6. Set the default values.
Default values are loaded from the Add-On Instruction definition into the tag of the Add-On Instruction data type when it is created, and anytime a new Input or Output parameter is added to the Add-On Instruction.
7. Set the display style.
8. Check the box to make the parameter required or visible, as desired.
If you decide to make the parameter required, it will also be visible.
9. Type a description, maximum 512 characters.
This description appears in the instruction’s help.
10. Select an External Access type for Input or Output parameters.
11. Check the Constant box for InOut parameters you want to designate as constant values.
12. Repeat for additional parameters.
The order that you create the parameters is how they will appear in the data type and on the instruction face. To rearrange the order on the Parameter tab of the
Add-On Instruction Definition Editor, select the parameter row and click Move Up or Move Down.
Figure 3 - Add-On Instruction Definition Editor – Parameters Tab
0 comments :