Linear interpolation
Pulses are output from two channels in accordance with the parameters in the specified DUT, so that the path to the target position forms a straight line.Pulses are output from the specified channel when the control flag for this channel is FALSE and the execution condition is TRUE.
Input
Pulse output channel:
FP-XH C30 T/P: 0–3
FP-XH C60 T/P: 0–5
FPS: 0, 2
FP-X R: 0, 1
FP-XC14T: 0, 1, 2
FP-X C30T/C60T: 0, 1, 2, 3
FP0R: 0, 1, 2, 3
For interpolation, channel 0 and 1 or channel 2 and 3 are used as pairs. You may only specify 0 or 2 (for C14T: 0 only).
Input/output
Starting address of area containing the data table
FPS, FP-X: F175_PulseOutput_Linear_DUT_0
FP0R: F175_PulseOutput_Linear_DUT_1
Use the following predefined DUT: F175_PulseOutput_Linear_DUT_0
The following parameters can be specified in the DUT:
The following parameters for each axis are calculated upon execution of the instruction and stored in the operation result area of the DUT.
Pulse output characteristics
X-axis target value (channel 0): 5000
Y-axis target value (channel 2) (FP-X: channel 1): 2000
The two axes are controlled so that a linear path is followed to the target position.
FP-X: When a pulse output instruction is executed and pulses are being output, the pulse output control flag (e.g. sys_bIsPulseChannel0Active) of the corresponding channel is TRUE. No other pulse output instruction can be executed as long as this flag is TRUE.
FPS: The high-speed counter control flag (e.g. sys_bIsHscChannel0ControlActive) and the pulse output control flag (e.g. sys_bIsPulseChannel0Active) are assigned to the same special internal flag number (e.g. R903A). Therefore, when a high-speed counter instruction or a pulse output instruction is executed, both the high-speed counter control flag (e.g. sys_bIsHscChannel0ControlActive) and the pulse output control flag (e.g. sys_bIsPulseChannel0Active) for the channel used are TRUE. No other high-speed counter instruction or pulse output instruction can be executed as long as this flag is TRUE.
FPS: Executing the circular interpolation control instruction F176_PulseOutput_Center sets the circular interpolation control flag (sys_bIsCircularInterpolationActive) to TRUE. The status of this flag is maintained until the target value is reached (even if the execution condition is no longer TRUE). During this time, other pulse output instructions cannot be executed.
FPS: Set any high-speed counter allocated to a pulse output channel to "Unused" in the system registers.
FP-X: Set "Pulse output" for the desired channel in the system registers.
We strongly recommend that you incorporate a forced stop option in your positioning program.
Use the following predefined DUT: F175_PulseOutput_Linear_DUT_1
The following parameters can be specified in the DUT:
The following parameters for each axis are calculated upon execution of the instruction and stored in the operation result area of the DUT.
Pulse output characteristics
X-axis target value (channel 0): 5000
Y-axis target value (channel 1): 2000
Pulses are output from the X-axis (channel 0) and the Y-axis (channel 1), so that the initial speed is 500Hz, the target speed is 5kHz, and the acceleration time and deceleration time is 300ms. The two axes are controlled so that a linear path is followed to the target position.
Pulses are output using a duty of 25%.With the pulse output method "pulse/direction", pulses are output approx. 300ms after the direction signal has been output; the motor driver characteristics are simultaneously taken into consideration.
Pulse output stops when the target value is reached.
We strongly recommend that you incorporate a forced stop option in your positioning program.
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
bTrigger: BOOL:=FALSE;
dutLinearData: F175_PulseOutput_Linear_DUT_0:=dwControlCode := 16#1000,
diInitialAndFinalSpeed := 500,
diMaximumSpeed := 5000,
diAccelerationAndDecelerationTime := 300,
diTargetValue_X := 5000,
diTargetValue_Y := 2000;
(*Control code:
Digit 3: 1=Duty ratio 25%
Digit 2: 0=Fixed
Digit 1: 0=Relative value control
Digit 0: 0=CW/CCW
*)
@'': @'';
END_VAR
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 6 ;
NETWORK_BODY
B(B_CONTACT,,bTrigger,4,2,6,4,R);
B(B_VARIN,,dutLinearData,11,4,13,6,);
B(B_VARIN,,0,11,3,13,5,);
B(B_F,F175_PulseOutput_Linear!,Instance,13,1,28,6,,?DEN?Hn_iPulseOutputChannel?Ds_dutDataTable?As_dutDataTable?AENO);
L(1,3,4,3);
L(6,3,13,3);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF DF(bTrigger) then
F175_PulseOutput_Linear(n_iPulseOutputChannel := 0,
s_dutDataTable := dutLinearData);
END_IF;