F166_PulseOutput_Set

Target value match ON (pulse output)

If the elapsed value matches the target value of the selected pulse output channel, the specified output immediately turns to TRUE.

Parameters

Input

n_diPulseOutputChannel (DINT)

Pulse output channel:0–3

s_diTargetValue (DINT)

specify a 32-bit data value for the target value within the following range: -2147483467 to +2147483648

Output

d_Y (BOOL)

output which turns to TRUE when the elapsed value matches the target value:Y0–Y1F

Remarks

  • Pulse output characteristics

    Target value: 10000

    (1)

    Elapsed value of pulse output

    (2)

    Execution condition

    (3)

    "Output control active" flag

    (4)

    PLC output

    The PLC output turns to TRUE when the elapsed value matches the target value.In addition, the "Output control active" flag turns to FALSE and the instruction is deactivated.If an output is specified that has not been implemented, only the internal memory of the corresponding WY address is set or reset.

  • Interrupt operation

    The interrupt program will be executed when the elapsed value matches the target value. Any interrupt that has been entered into the Tasks list is automatically enabled.A special interrupt program number is assigned to each channel number.

  • Channels used by interrupt programs:

    Interrupt8

    Channel0

    Interrupt9

    Channel1

    Interrupt10

    Channel2

    Interrupt11

    Channel3

General programming information

  • Set "Pulse output" for the desired channel in the system registers.

  • When this instruction is executed, the "Output control active" flag (e.g. sys_bIsPulseChannel0ControlActive) for the channel used turns to TRUE. No other high-speed counter instruction with output control (F166_PulseOutput_Set or F167_PulseOutput_Reset) using the same channel can be executed as long as this flag is TRUE.

  • This instruction is available for all pulse output instructions except F173_PulseOutput_PWM and can be executed before or after execution of a pulse output instruction.

  • The duplicate use of an output in other instructions (OUT, SET, RST, KEEP and other F instructions) is not verified by FPWIN Pro and will not be detected.

  • To set a PLC output to FALSE that was previously set to TRUE by this instruction, use an RST or MOVE instruction.

  • To cancel execution of a pulse output instruction, set bit 2 of the data register storing the pulse output control code (sys_wHscOrPulseControlCode) to TRUE. The pulse output control flag will then change to FALSE. To reenable execution of the instruction, reset bit 2 to FALSE.

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

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

Error flags

sys_bIsOperationErrorHold (turns to TRUE and remains TRUE)
  • if channel number or values of the data table are outside the permissible range
  • if pulse output has not been set in the system registers
sys_bIsOperationErrorNonHold (turns to TRUE for one scan)
  • if channel number or values of the data table are outside the permissible range
  • if pulse output has not been set in the system registers

Example

Global variables

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

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
		out_0: BOOL:=FALSE;
			(*output Y0 of PLC*)
	END_VAR
	VAR 
		start: BOOL:=FALSE;
			(*start condition*)
		@'': @'';
	END_VAR

POU body

When the variable start is set to TRUE, the function is carried out.

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_F,F166_PulseOutput_Set!,Instance,12,1,26,6,,?DEN?Hn_diPulseOutputChannel?Ds_diTargetValue?AENO?Cd_Y);
B(B_VARIN,,0,10,3,12,5,);
B(B_VARIN,,10,10,4,12,6,);
B(B_VAROUT,,out_0,26,3,28,5,);
B(B_CONTACT,,start,5,2,7,4,R);
L(1,3,5,3);
L(7,3,12,3);
L(1,0,1,6);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

IF DF(start) then
    F166_PulseOutput_Set(n_diPulseOutputChannel := 0, 
          s_diTargetValue := 10, 
          d_Y => out_0);
END_IF;

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