Robotic Programming and Software Development
117601VAL-II
Q4(b). Write a basic program using VAL-II programming to perform a pick-and-place operation, incorporating a conditional statement based on a sensor input.20257m
VAL-II
View this question on its own page →Write a basic program using VAL-II programming to perform a pick-and-place operation, incorporating a conditional statement based on a sensor input.
Worked SolutionSolution: VAL-II Pick-and-Place with Sensor Condition
A pick-and-place program moves a workpiece from a pickup position to a placement position. A sensor can be used to verify that a part is available before starting.
Note: VAL-II syntax varies by controller implementation. The following is an exam-oriented illustrative program showing the required logic rather than a controller-specific production program.
Example
PROGRAM PICKPLACE MOVE PICK_APPROACH IF PART_SENSOR = ON THEN MOVE PICK CLOSE GRIPPER MOVE PICK_APPROACH MOVE PLACE_APPROACH MOVE PLACE OPEN GRIPPER MOVE PLACE_APPROACH ELSE STOP ENDIF ENDOperation
- Move to the pickup approach position.
- Read the part-presence sensor.
- If the sensor is ON, the robot moves to the pickup point.
- The gripper closes and holds the workpiece.
- The robot returns to the safe approach position.
- It moves to the placement approach position.
- It moves to the placement point and opens the gripper.
- It returns to the safe position.
- If the sensor is OFF, the program stops or waits for a part.
Flowchart
START ↓ Move to pickup approach ↓ Part sensor ON? ┌───────┴────────┐ NO YES ↓ ↓ STOP Pick part ↓ Close gripper ↓ Move to place ↓ Open gripper ↓ ENDImportance of the Conditional Statement
The conditional statement prevents the robot from attempting to pick an absent part. It therefore improves automation reliability, safety and process control.