Activity 3.1.2f Variable Programming Introduction The concept of using a variable in a computer program is commonly used. A variable allows data tracking flexibility within the program to control the logical flow. Equipment Computer with RoboCell software Journal Pencil Procedure 1. Set up the cell using the information below. Using Cell Setup, create the following work cell: Table: 1000 x 1000 Robot: Scorbot ER4 Cylinder Size: Diameter of 40mm and Height of 40mm Cylinders: C1 300,100 C2 300, 0 C3 300, -100 C4 300, -200 Save the program as LastName_A312f. 2. Define the variables The following variables will be used in the program: ATPICK: This is where the robot is in position to pick up the cylinder. ABPICK: This is where the robot is in position above the pick-up point. DROP: This is where the robot is in position to drop off the cylinder. 3. Program the positions Open RoboCell Simulation, import the 3D graphics file created above, and program the following points using the coordinates in the chart below. © 2013 Project Lead The Way, Inc. CIM Activity 3.1.2f Variable Programming – Page 1 Note that the positions are shown looking toward the robot Program Construction The program below will perform a stacking operation with variables. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. Remark: Your Name Remark: Class Period Remark: Variable Stack Remark: Set Variables Set Variable ABPICK = 11 Set Variable ATPICK = 1 Set Variable DROP = 41 Remark: Home Open Gripper Go to Position 99 Fast Remark: Stack LOOP: Open Gripper Go to Position ABPICK Fast Go Linear to Position ATPICK Speed 5 Close Gripper Go Linear to Position ABPICK Speed 5 Go to Position 100 Fast Go Linear to Position DROP Speed 5 Open Gripper Go Linear to Position 100 Speed 5 Remark: Update Variables Set Variable ATPICK = ATPICK+1 Set Variable ABPICK = ABPICK +1 Set Variable DROP = DROP +1 Remark: Looping IF ATPICK>3, jump to END Jump to LOOP END: Remark: Home 31. Go to Position 99 Fast 4. Obtain instructor approval that the assignment has been completed. © 2013 Project Lead The Way, Inc. CIM Activity 3.1.2f Variable Programming – Page 2 Conclusion 1. Run your program to determine whether it performs as desired. © 2013 Project Lead The Way, Inc. CIM Activity 3.1.2f Variable Programming – Page 3