Read Joint in SFC+
You can program a Read Joint activity in SFC+.
Open a device that has a previously-defined mechanism, motion controller and simulation logic. The Main block must be a SFC+ block
(see a typical example below).

To open the SFC+ Editor, do one of the following:
- Expand the content of the Main block and double-click Behavior.
- Right-click the Main block and select Behavior Editor.
- Select Behavior Editor
in the Main window toolbar.

- The SFC+ Editor appears as an immersive window at the center of the screen.
- A toolbox containing all the SFC+ Editor commands appears at the right side of the screen.
Note:
In our example, the resource logic is undefined, so the editor is empty.
Select Read Joint in the Activities toolbar and click the 2D immersive window to position the Kinematics Motion action.
The Read Joint Properties dialog box appears:

- In the Data frame, you can define
the value of one joint.
- In the Declaration frame, you can choose to create the port or the signal used in the Value box.
- In the Action frame, you can define the settings of the Read Joint action.
Enter Rail_Joint in the value field. That means
that the Prismatic.1 joint value will be assigned to
the Rail_Joint signal.
Click As Port. The Rail_Joint port will be created with the activity.
Click Sustain. The Read Joint activity will be executed at each cycle the step is active.
Click OK. The step S0 is created in the SFC+ graph. The action calling the Read Joint activity is identified by the icon and the joint name.

Create a new Read Joint activity to retrieve the value of the Prismatic.2 joint. - Select Read Joint
in the Activities toolbar and click the step S0 in the SFC+ editor.
The Read Joint Properties dialog box appears.
- Enter Filler_Joint in Value and select Prismatic.2 in the list.
- Click As Port.
- Click Sustain.
- Click OK.

A new Read Joint action is added to the step S0.
Close the SFC+ Editor window.
To test the behavior of the activities in simulation:
- Select the Main block in the Simulation Logic tree and click the Play
of the compass. The block is compiled and the simulation is initialized. The Simulation toolbar and the Signals Monitoring window appear.
- Expand the ports of the Main block in the Signals Monitoring window.

- Click Next
. The values of the commands are assigned to the Rail_Command and Filler_Command ports.

- Click the Play of the compass to end the simulation.

Read Joint in Dataflow
You can program a Read Joint activity in Dataflow.
Open a device that has a previously-defined mechanism, motion controller and simulation logic. The Main block must be a Dataflow block
(see a typical example below).

Double-click the Main block.

- The Block Editor appears as an immersive window at the center of the screen.
- A toolbox containing all the Block Editor commands appears at the right side of the screen.
Note:
In our example, the resource logic is undefined, so the editor is empty.
Click Read Joint in the Activities toolbox.
Then, click the Block Editor window to position the activity.

The Read Joint Properties dialog box appears.
Click OK.

- The activity is created as a block instance.
- Value (type float 64) is the joint value of the mechanism.
Scroll over the instance to see the Read Joint activity parameter.

Create a new Read Joint activity to retrieve the second joint value. -
Click Read joint
in the Activities toolbox.
Then, click the Block Editor window to position the activity. The Read Joint Properties dialog box appears.
- Select Prismatic.2 in the list.
- Click OK.

Press Ctrl and select in the ports contextual menu.

To get shorter port names, - Double-click the new port.
The Block Properties dialog box appears.
- Modify the name of the ports.

- Click OK.
To test the behavior of the activities in simulation:
- Select the Main block thumbnail and click the Play of the compass.
The block is compiled and the simulation is initialized. The Simulation toolbar and the Signals Monitoring window appear.
- Click Next
. The values of the commands are assigned to the Rail_command and Filler_Command ports .

- Click the Play of the compass to end the simulation.
|