Overview:
This article describes the manipulation of multiple models based on the value of global variables using the Model Script feature in MotoSim EG-VRC.
Reference section 11.12 Model Script, of the MotoSim EG-VRC Operators Manual for more detailed information relating to using Model Scripts.
Procedure:
- Create a model with a name containing a 3-digit number.
- For example: box-001
- On the Simulation tab, under Model Simulation group, click the button Model Script Manager.
- In the Model Script Editor, click Add and enter a new script name. Click OK.
- Double click in the Script Edit box to bring up the Script Input Assistance window.
- Choose the appropriate model instruction for this new script.
- Using the Select Model Tool on the Home tab, click on the model created in Step 1.
- Replace the 3 digits in the model name with the chosen variable enclosed in brackets. It is important that the remainder of the model name matches the model in the MotoSim CadTree. Below is an example using byte variable B001. When the value of B001 is equal to 1, the model "box-001" is selected during execution of that script.
Example:
A palletizing simulation is used to demonstrate the usefulness of model scripting with variables.
The following model instructions are used:
Command Syntax | Description |
MOV model new_parent | Move (to) PARENT: Moves model to new parent at the same offset from previous. |
HID model | Hide Model: The model is hidden from view. |
SEE model | See model: The model is revealed after being hidden. |
DUP model duplicate_name | Duplicate/Copy model to remain permanently in *.vcl file or until DEL is performed. |
DEL model | Delete model; may use when DUP or CAD Tree Copy/Paste has been performed. |
Model Scripts can be executed from a job with a comment: 'MDS:[Model Script Name]
The model scripts in the Model Script Editor are saved in a text document called ModelScript.txt.
ModelScript.txt
PICK_BUILD1_BOX
{
DUP Infeed[I006]_Box box[I006]_[I001]_[I002] T=0,0
MOV box[I006]_[I001]_[I002] YRC1000-R01_tcp T=0,0
HID Infeed[I006]_Box T=0,0
}
PICK_BUILD2_BOX
{
DUP Infeed[I006]_Box box[I006]_[I003]_[I004] T=0,0
MOV box[I006]_[I003]_[I004] YRC1000-R01_tcp T=0,0
HID Infeed[I006]_Box T=0,0
}
PLACE_BUILD1_BOX
{
MOV box[I006]_[I001]_[I002] pallet[I006] T=0,0
SEE Infeed[I006]_Box T=0,0
}
PLACE_BUILD2_BOX
{
MOV box[I006]_[I003]_[I004] pallet[I006] T=0,0
SEE Infeed[I006]_Box T=0,0
}
RESET_BUILD1
{
DEL box[I006]_[I001]_[I002] T=0,0
DEL slipsheet[I006]_[I001] T=0,0
SEE Infeed[I006]_Box T=0,0
SEE Dispenser1_Slipsheet T=0,0
}
RESET_BUILD2
{
DEL box[I006]_[I003]_[I004] T=0,0
DEL slipsheet[I006]_[I003] T=0,0
SEE Infeed[I006]_Box T=0,0
SEE Dispenser2_Slipsheet T=0,0
}
PICK_BUILD1_SHEET
{
DUP Dispenser1_Slipsheet slipsheet[I006]_[I001] T=0,0
MOV slipsheet[I006]_[I001] YRC1000-R01_tcp T=0,0
HID Dispenser1_Slipsheet T=0,0
}
PLACE_BUILD1_SHEET
{
MOV slipsheet[I006]_[I001] pallet[I006] T=0,0
SEE Dispenser1_Slipsheet T=0,0
}
PICK_BUILD2_SHEET
{
DUP Dispenser2_Slipsheet slipsheet[I006]_[I003] T=0,0
MOV slipsheet[I006]_[I003] YRC1000-R01_tcp T=0,0
HID Dispenser2_Slipsheet T=0,0
}
PLACE_BUILD2_SHEET
{
MOV slipsheet[I006]_[I003] pallet[I006] T=0,0
SEE Dispenser2_Slipsheet T=0,0
}
Comments
0 comments
Please sign in to leave a comment.