F169_PulseOutput_Jog

JOG operation

This instruction is used for JOG operation.The specified number of pulses is output after the position control trigger input has turned to TRUE. A deceleration is performed before the target value is reached and pulse output stops.Pulses are output from the specified channel when the control flag for this channel is FALSE and the execution condition is TRUE.

Parameters

Input

s_dutDataTable (F169_PulseOutput_Jog_DUT)

Starting address of area containing the data table

n_iPulseOutputChannel (INT)

Pulse output: 0 or 1

Remarks

  • Use the following predefined DUT: F169_PulseOutput_Jog_DUT

  • The following parameters can be specified in the DUT:

    • Control code

    • Speed

  • Pulse output characteristics

    The frequency and the duty can be changed in each scan. (The change becomes effective with the next pulse output.)

General programming information

  • As soon as you begin editing a program online (i.e., in RUN mode) using this instruction, pulse output will stop.

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

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

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

  • Pulse output stops when the upper limit of the internal elapsed value is exceeded if rotation is in one direction only. As a countermeasure, reset the elapsed value to 0 before executing this instruction. Pulse output does not stop when the FP0R is used in FP0 compatibility mode because the data range for the elapsed value is a signed 32-bit value.

  • When using incremental counting, pulse output stops when the elapsed value exceeds 2147483647.

  • When using decremental counting, pulse output stops when the elapsed value exceeds -2147483648.

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

Running the FP0R in FP0 compatibility mode

To run the FP0R in FP0 compatibility mode, you can download an FP0 program to the FP0R. Please note the following restrictions:

  • The FP0R supports signed 32-bit data for elapsed value and target value; the FP0 supports signed 24-bit data. In FP0 compatibility mode, counting and pulse output continue even if data exceeds the FP0 range.

  • The duty ratio is always 25% regardless of the settings in the instructions. 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.

  • The FP0R does not support the "no counting" setting. Instead, incremental counting is performed with the FP0 pulse output instructions set to "no counting".

  • The maximum pulse output frequency is 10000Hz.

  • Make sure the pulse output instruction does not use an output that is also being used as a normal output.

  • An FP0 program can only run in FP0 compatibility mode, if the PLC types (C10, C14, C16, C32, and T32) match exactly. FP0 compatibility mode is not available for the F32 type FP0R.

Outputs and system variables for FP0, FP-e

Channel and pulse output numbers

Channel no. Pulse output Pulse output method

0

Y0

Pulse

Y2

Direction

1

Y1

Pulse

Y3

Direction

System variables for memory areas used. Values in parentheses are valid for FP0 T32.

Description

System variable

Pulse output: control flag for channel

0

sys_bIsPulseChannel0Active

1

sys_bIsPulseChannel1Active

Pulse output: elapsed value for channel

0

sys_diPulseChannel0ElapsedValue

1

sys_diPulseChannel1ElapsedValue

Pulse output: target value for channel

0

sys_diPulseChannel0TargetValue

1

sys_diPulseChannel1TargetValue

High-speed counter or pulse output controlcode

sys_wHscOrPulseControlCode

Example

Global variables

In the global variable list you define variables that can be accessed by all POUs in the project.

DUT

The DUT F169_PulseOutput_Jog_DUT is predefined in the FP Library.

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_EXTERNAL
		X0_bMotorSwitch: BOOL:=FALSE;
	END_VAR
	VAR 
		dut_Jog: F169_PulseOutput_Jog_DUT:=wControlCode := 16#110,
iSpeed := 0;
			(*Digit2: 1= Duty 10%
Digit1: 1=Incremental counting
Digit0: 0=No direction output*)
		@'': @'';
	END_VAR

POU body

The comment fields explain the function of this example.

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_COMMENT,,define frequency~ 300Hz,2,1,22,2,);
B(B_F,E_MOVE!,Instance,9,2,15,6,,?DEN?D?AENO?C);
B(B_VARIN,,300,7,4,9,6,);
B(B_VAROUT,,dut_Jog.iSpeed,15,4,17,6,);
B(B_CONTACT,,X0_bMotorSwitch,5,3,7,5,);
L(1,0,1,6);
L(1,4,5,4);
L(7,4,9,4);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 7 ;
        NETWORK_BODY
B(B_F,F169_PulseOutput_Jog!,Instance,12,2,25,7,,?DEN?Ds_dutDataTable?Hn_iPulseOutputChannel?AENO);
B(B_VARIN,,dut_Jog,10,4,12,6,);
B(B_VARIN,,0,10,5,12,7,);
B(B_CONTACT,,X0_bMotorSwitch,5,3,7,5,);
B(B_COMMENT,,start pulse output to output,2,1,22,2,);
L(1,4,5,4);
L(7,4,12,4);
L(1,0,1,7);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF (X0_bMotorSwitch) then
    dutJog.ispeed := 300;
END_IF;
IF (X0_bMotorSwitch) then
    F169_PulseOutput_Jog(s_dutDataTable := dutJog, 
  n_iPulseOutputChannel := 0);
END_IF;
Related topics:

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