Data table control
This instruction performs rectangular control according to the parameters in the specified DUT with an arbitrary number of different speeds and target values.Pulses are output from the specified channel when the control flag for this channel is FALSE and the execution condition is TRUE.
Input
Starting address of area containing the data table
Sample: F174_PulseOutput_DataTable_8_Values_DUT
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
Create your own DUT using the following DUT as a sample: F174_PulseOutput_DataTable_8_Values_DUT
The following parameters can be specified in the DUT:
Control code
Frequency 1
Target value 1
Frequency 2
Target value 2
...
Frequency n
Target value n
Pulse stop
Pulse output characteristics
x Elapsed value of high-speed counter (amount of travel)
Pulses are output at the specified frequency until the target value is reached. Then the frequency changes to the second frequency value and pulse output continues until the second target value is reached, and so forth.
Pulse output stops when the last target value is reached.
A frequency of 0 signifies the final frequency and stops pulse output.
FP-X, FP0R: 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.
If the value of the first frequency specified is out of range, an operation error occurs. (If the value of the first frequency is 0, operation stops without any pulses having been output.)
If the value of the second frequency specified is out of range or 0, pulse output stops.
If the target value is out of range, the number of pulses output may be different from the specified value.
FP0R: If one of the target values is not in the direction of movement, pulse output stops.
FPS, FP-X: If one of the target values is not in the direction of movement, counting continues infinitely.
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.
FPS, FP-X: If a periodic interrupt or high-speed counter interrupt program is run, or the PLC link function is used at the same time, a frequency of 80kHz or less should be used.
FP-X: Set "Pulse output" for the desired channel in the system registers.
When programs are being edited in RUN mode, pulse output stops but resumes after the program changes have been downloaded.
We strongly recommend that you incorporate a forced stop option in your positioning program.
The status of the high-speed counter control flag or pulse output control flag may change while a scan is being carried out. For example, if the number of received bytes is read more than once different statuses may exist within one scan.
In the global variable list you define variables that can be accessed by all POUs in the project.
The DUT F174_PulseOutput_DataTable_8_Values_DUT is predefined in the “FP library” and can be used as a sample.
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_EXTERNAL
X0_bMotorSwitch: BOOL:=FALSE;
(*at X0*)
END_VAR
VAR
dutDataTable4: F174_DUT:=ControlCode := 16#1200,
Frequency1 := 1000,
TargetValue1 := 1000,
Frequency2 := 2500,
TargetValue2 := 2000,
Frequency3 := 5000,
TargetValue3 := 5000,
Frequency4 := 1000,
TargetValue4 := 2000,
Termination := 0;
(*Control code:
Digit 3: 1=Duty ratio 25%
Digit 2: 2=Frequency range 48Hz-100kHz
Digit 1: 0=Relative value control
Digit 0: 0=CW*)
@'': @'';
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_F,F174_PulseOutput_DataTable!,Instance,13,0,27,5,,?DEN?Ds_dutDataTable?Hn_iPulseOutputChannel?AENO);
B(B_VARIN,,dutDataTable4,11,2,13,4,);
B(B_VARIN,,0,11,3,13,5,);
B(B_CONTACT,,X0_bMotorSwitch,5,1,7,3,R);
L(1,2,5,2);
L(7,2,13,2);
L(1,0,1,6);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF DF(X0_bMotorSwitch) then
F174_PulseOutput_DataTable(s_dutDataTable := dutDataTable4, 4);
END_IF;