¶ Build a Pneumatic Pick-and-Place Machine Program
Build a complete pneumatic pick-and-place station from an empty workspace to an exported PLC project.
A two-axis pneumatic pick-and-place unit that transfers parts from a feeder to an outfeed conveyor.
Hardware Signals:
- Vertical cylinder (Z axis) reed switches:
S_Z_UP, S_Z_DOWN
- Horizontal cylinder (X axis) reed switches:
S_X_HOME, S_X_OUT
- Vacuum gripper sensor:
S_VAC_OK
- Operator push-buttons:
B_START, B_ESTOP
- Solenoid valve outputs:
Y_Z_DOWN, Y_X_OUT, Y_VACUUM
Operating Cycle:
- Wait in
IDLE for B_START with Z up and X at home.
- Lower Z (
PICK_DOWN), switch on vacuum (GRIP), and wait for S_VAC_OK plus a 200 ms dwell timer.
- Raise Z and advance X to the outfeed (
TRANSFER).
- Release vacuum and vent for
150 ms (RELEASE).
- Return X to home (
RETURN) and loop back to IDLE.
| Item |
Requirement |
| AutomationView |
Installed |
| Festo Extension |
Installed from the Marketplace (for CPX-E I/O catalog entries) |
| CODESYS Extension |
Installed from the Marketplace (for PLCopen XML export) |
- Press Ctrl+Shift+P and run AutomationView: New Project.
- Select Empty Project and click Use this.
- Choose a folder and name the project
pick-and-place.
AutomationView creates the project files:
pick-and-place/
main.machine
main.seq
Open main.machine in the visual Machine Editor.
- Select the Project tab.
- Under Export Configuration, select CODESYS in Export Targets.
¶ 2.2 Add a Station and I/O Modules
- Select the Architecture tab.
- Click Add Station, name it
MainStation, and select the ethercat or profinet protocol.
- Click Add Equipment and add a digital input module and a digital output module from the Equipment Catalog:
| Slot |
Module Role |
Channels |
| 0 |
8x Digital Inputs (DI 8x24VDC) |
8 input channels (%IX0.0 – %IX0.7) |
| 1 |
8x Digital Outputs (DO 8x24VDC) |
8 output channels (%QX1.0 – %QX1.7) |
Open the Variables tab in main.machine (or let AutomationView auto-discover them as you build the sequence, then click Freeze).
| Name |
Description |
S_Z_UP |
Z cylinder retracted |
S_Z_DOWN |
Z cylinder extended |
S_X_HOME |
X cylinder at home |
S_X_OUT |
X cylinder at outfeed |
S_VAC_OK |
Vacuum confirmed |
B_START |
Cycle start push-button |
B_ESTOP |
Emergency stop |
| Name |
Description |
Y_Z_DOWN |
Z down solenoid |
Y_X_OUT |
X advance solenoid |
Y_VACUUM |
Vacuum valve |
| Name |
Description |
ready |
Machine in home position |
Open main.seq in the Visual Sequence Editor.
Visual EditorPythonClick on the canvas and use single-key shortcuts:
| Key |
Element Added |
| I |
Initial step |
| S |
Normal step |
| T |
Transition |
| A |
Action on the selected step |
| C |
Comment |
Create these six steps:
| Step |
Type |
Name |
Comment |
| 0 |
Initial |
IDLE |
Home position, wait for start |
| 1 |
Step |
PICK_DOWN |
Lower Z over feeder |
| 2 |
Step |
GRIP |
Vacuum on, wait for confirmation |
| 3 |
Step |
TRANSFER |
Raise Z, move X to outfeed |
| 4 |
Step |
RELEASE |
Release part and vent vacuum |
| 5 |
Step |
RETURN |
Move X back to home |
from automation_machine import Sequence, StepType, ActionInstruction
class PickAndPlace(Sequence):
def setup(self):
idle = self.add_step(StepType.INITIAL, name="IDLE")
pick_dn = self.add_step(name="PICK_DOWN")
grip = self.add_step(name="GRIP")
xfer = self.add_step(name="TRANSFER")
release = self.add_step(name="RELEASE")
retn = self.add_step(name="RETURN")
Select each source step, press T, and enter its condition:
| From |
To |
Condition |
IDLE |
PICK_DOWN |
B_START AND S_Z_UP AND S_X_HOME AND NOT B_ESTOP |
PICK_DOWN |
GRIP |
S_Z_DOWN |
GRIP |
TRANSFER |
S_VAC_OK AND vac_dwell.Q |
TRANSFER |
RELEASE |
S_Z_UP AND S_X_OUT |
RELEASE |
RETURN |
S_Z_UP AND NOT S_VAC_OK |
RETURN |
IDLE |
S_X_HOME |
Select each step and press A to configure its actions:
| Step |
Qualifier |
Target / Instruction |
Comment |
IDLE |
N |
ready |
Machine in home position |
PICK_DOWN |
N |
Y_Z_DOWN |
Extend Z down |
GRIP |
S |
Y_VACUUM |
Latch vacuum on |
GRIP |
N |
TON vac_dwell (200 ms) |
Stabilise vacuum |
TRANSFER |
S |
Y_X_OUT |
Latch X advance |
RELEASE |
R |
Y_VACUUM |
Release vacuum |
RELEASE |
N |
TON release_dwell (150 ms) |
Vent vacuum |
RETURN |
R |
Y_X_OUT |
Retract X |
- Press F5 to start the simulator (
IDLE highlights as active).
- Click the variable badges directly on the canvas transitions (or in the Variables panel) to test the sequence:
| Input Values Set |
Expected Transition |
B_START = TRUE, S_Z_UP = TRUE, S_X_HOME = TRUE |
IDLE -> PICK_DOWN (Y_Z_DOWN turns on) |
S_Z_DOWN = TRUE, S_Z_UP = FALSE |
PICK_DOWN -> GRIP (Y_VACUUM latches on) |
S_VAC_OK = TRUE (wait 200 ms) |
GRIP -> TRANSFER (Y_X_OUT latches on) |
S_Z_UP = TRUE, S_X_OUT = TRUE |
TRANSFER -> RELEASE (Y_VACUUM resets) |
S_VAC_OK = FALSE, S_Z_UP = TRUE |
RELEASE -> RETURN (Y_X_OUT resets) |
S_X_HOME = TRUE |
RETURN -> IDLE |
- Press Shift+F5 to stop the simulation.
| Symptom |
Cause |
Fix |
IDLE stays active |
B_ESTOP is TRUE |
Set B_ESTOP to FALSE |
Stuck on GRIP |
vac_dwell.Q has not elapsed |
Wait 200 ms or check the TON duration |
Output remains TRUE |
Latched S action was not cleared |
Verify the matching R action on the downstream step |
¶ Step 6: Assign and Validate Hardware Addresses
- Press Ctrl+Shift+P and run AutomationView: Assign Addresses Automatically (or assign channels manually in the
main.machine Architecture tab):
| Variable |
Module |
Address |
S_Z_UP |
DI slot 0 |
%IX0.0 |
S_Z_DOWN |
DI slot 0 |
%IX0.1 |
S_X_HOME |
DI slot 0 |
%IX0.2 |
S_X_OUT |
DI slot 0 |
%IX0.3 |
S_VAC_OK |
DI slot 0 |
%IX0.4 |
B_START |
DI slot 0 |
%IX0.5 |
B_ESTOP |
DI slot 0 |
%IX0.6 |
Y_Z_DOWN |
DO slot 1 |
%QX1.0 |
Y_X_OUT |
DO slot 1 |
%QX1.1 |
Y_VACUUM |
DO slot 1 |
%QX1.2 |
- Run AutomationView: Validate All Addresses to confirm there are zero conflicts.
¶ Step 7: Translate and Export the Project
- Preview Source Code: Open
main.seq and click the Translate icon in the editor title bar (or run AutomationView: Translate to Target Language) to view the generated Structured Text side-by-side.
- Export Deployable Project: Run AutomationView: Export Project from the Command Palette or the Machine Explorer title bar.
- AutomationView writes the exported files to
automationview/export/codesys/:
pick-and-place/
main.machine
main.seq
automationview/
export/
codesys/
project.xml
| Target IDE |
Import Path |
| CODESYS V3 |
Project > Import > PLCopenXML |
| TwinCAT 3 |
PLC > Import > PLCopen XML |
| Schneider EcoStruxure |
File > Import > PLCopen XML |