F176_PulseOutput_Pass

Circular interpolation (pass position)

Pulses are output from two channels in accordance with the parameters in the specified DUT, so that the path to the target position forms an arc.The radius of the circle is calculated by specifying the center position and the end position.Pulses are output from the specified channel when the control flag for this channel is FALSE and the execution condition is TRUE.

Parameters

Input

n_iPulseOutputChannel* (decimal constant)

Pulse output channel:0, 2

Input/output

s_dutDataTable (F176_PulseOutput_Pass_DUT)

Starting address of area containing the data table

Remarks

Use the following predefined DUT: F176_PulseOutput_Pass_DUT

The following parameters can be specified in the DUT:

  • Control code

  • Composite speed

  • X-axis target value

  • Y-axis target value

  • X-axis pass value

  • Y-axis pass value

The following parameters for each axis are calculated upon execution of the instruction and stored in the operation result area of the DUT.

  • Radius

  • X-axis center value

  • Y-axis center value

Pulse output characteristics

(1)

Rotation direction: from channel 0 (x-axis) to channel 2 (y-axis) (for a movement in positive direction on both channels)

(2)

Rotation direction: from channel 2 (y-axis) to channel 0 ( x-axis) (for a movement in positive direction on both channels)

Fv:

Composite speed

O (Xo,Yo):

Center position

Fx:

X-axis speed

S (Xs,Ys):

Current position (start)

Fy:

Y-axis speed

P (Xp,Yp)

Pass position

r:

Radius

E (Xe,Ye)

Target position (End)

Example

Let channel 0 be the X-axis and channel 2 be the Y-axis.The position control mode is absolute value control.

The current position is (q=60°, Xs=5000, Ys=8660). The center position O (Xo=0, Yo=0) is used as a reference point. Pulses are output from the X-axis (channel 0) and the Y-axis (channel 2) at a speed of Fv=2000Hz until the target position (q=-30°, Xe=8660, Ye=-5000) is reached.

General programming information

  • The execution condition for this instruction must be continually TRUE. When the execution condition is FALSE, pulse output stops.

  • 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.

  • 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. To restart circular interpolation, perform a forced stop (stop pulse output) to set the circular interpolation control flag (sys_bIsCircularInterpolationActive) to FALSE.

  • If "Continue" has been selected for the operation connection mode, use a special flag (sys_bIsCircularInterpolationOverwritingPossible) to permit overwriting of the target value. The flag is TRUE for one scan when the circular interpolation instruction is executed.

  • The target value for each axis must be within the range of -8388608–8388607. When this instruction is used in combination with other pulse output instructions, e.g. F171_PulseOutput_Trapezoidal, the target value in these instructions must be within the same range.

  • The accuracy of circular interpolation may degrade if the scan time is too long.

  • Online editing during RUN mode is not available for this instruction.

  • If both the main program and the interrupt program contain code for the same channel, make sure both are not executed simultaneously.

  • As there is no interpolation function for the home return, the home return should be executed for each channel.

  • When using in applications requiring precision, test runs with the actual machine are necessary.

  • Set any high-speed counter allocated to a pulse output channel to "Unused" in the system registers.

  • 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.

Flag setting during instruction execution

(1)

Execution condition X0

(2)

Pulse output control flag, channel 0 (sys_bIsPulseChannel0Active)

(3)

Pulse output control flag, channel 2 (sys_bIsPulseChannel2Active)

(4)

Circular interpolation control flag (sys_bIsCircularInterpolationActive)

(5)

Target value overwriting possible flag (sys_bIsCircularInterpolationOverwritingPossible)

a

Start

b

Execution condition FALSE

c

Target value reached

d

Start continue mode

e

1 scan

Example

POU header

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
		Trigger: BOOL:=FALSE;
		dutPassData: F176_PulseOutput_Pass_DUT:=dwControlCode := 16#1000,
diSpeed := 2000,
diTargetPos_X := 8660,
diTargetPos_Y := -5000,
diPassPos_X := 9396,
diPassPos_Y := -3420;
			(*Control code:
Digit 4: 0=Operation connection mode: stop
Digit 3: 1=Rotation direction: CCW (left)  
Digit 2: 0=Fixed
Digit 1: 0=Relative value control
Digit 0: 2=Pulse/direction (Forward FALSE)
*)
		@'': @'';
	END_VAR

LD body

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,,Trigger,4,2,6,4,R);
B(B_VARIN,,dutPassData,10,4,12,6,);
B(B_VARIN,,0,10,3,12,5,);
B(B_F,F176_PulseOutput_Pass!,Instance,12,1,27,6,,?DEN?Hn_iPulseOutputChannel?Ds_dutDataTable?As_dutDataTable?AENO);
L(1,3,4,3);
L(6,3,12,3);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF DF(Trigger) then
    F176_PulseOutput_Pass(n_iPulseOutputChannel := 0, 
        s_dutDataTable := dutPassData);
END_IF;

Modified on: 2022-06-28Feedback on this pagePanasonic hotline