PulseOutput_Home_FB

Home return

This instruction performs a home return according to the parameters in the function block and in the specified DUT. Pulses are output from the specified channel when the control flag for this channel is FALSE and the execution condition is TRUE.

Parameters

Input

bExecute (BOOL)

A rising edge activates the function block

bReverse (BOOL)

Movement direction: Forward = FALSE, Reverse = TRUE

diInitialSpeed, diTargetSpeed (DINT)

Initial speed/Target speed: Set this value according to the frequency range selected in PulseOutput_Channel_Configuration_DUT:

FPS, FP-X: 1 to 9800 (1.5Hz–9.8kHz)

48 to 100000 (48Hz–100kHz)

191 to 100000 (191–100kHz)

F171_PulseOutput_Trapezoidal: 1 to 50000 (1Hz–50kHz)

FP0, F168_PulseOutput_Trapezoidal: 40 to 5000 (40Hz–5kHz)

diAccelerationTime (DINT)

Acceleration/deceleration time (FPS, FP-X):

With 30 steps: 30ms–32760ms (specify in steps of 30)

With 60 steps: 60ms–32760ms (specify in steps of 60)

Acceleration/deceleration time (FP0, F168_PulseOutput_Trapezoidal): 30ms–32760ms

Acceleration time (F171_PulseOutput_Trapezoidal): 1ms–32760ms

diDecelerationTime (DINT)

Deceleration time (F171_PulseOutput_Trapezoidal): 1ms–32760ms

diCreepSpeed (DINT)

Creep speed (F171_PulseOutput_Trapezoidal): 1 to 50000 (1Hz–50kHz)

dutChannelConfigurationPredefined system DUT for channel configuration: PulseOutput_Channel_Configuration_DUT

Output

bError (BOOL)

TRUE if an applied input value is invalid. Execution of the function block stops.

Remarks

This non-inline instruction is part of the tool instructions for pulse output. For a detailed description of the instruction(s) used internally, please refer to:

  • FPS, FP-X: F171_PulseOutput_Home

  • FP-e, FP0: F168_PulseOutput_Home

Use PulseInfo_IsActive to check if the control flag for the selected channel is FALSE.Use PulseInfo_IsHomeInputTrue to check if the home input is TRUE.

NOTE

Avoid malfunctions or an operation error:

  • Make sure to set the system register to pulse output mode when using a home input.

  • The home input may not be occupied by other instructions like pulse-catch input, interrupt input or high-speed counter.

Example

DUT

With a Data Unit Type (DUT) you can define a data unit type that is composed of other data types. A DUT is first defined in the DUT pool and then processed like the standard data types (BOOL, INT, etc.) in the list of global variables or the POU header.

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.

POU body

	VAR
		PulseOutput_Home: PulseOutput_Home_FB;
		bExecute: BOOL:=FALSE;
		bReverse: BOOL:=FALSE;
		bError: BOOL:=FALSE;
		ChannelConfiguration_DUT: PulseOutput_Channel_Configuration_DUT;
		bConfigureDUT: BOOL:=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 := 32 ;
        NETWORK_BODY
B(B_CONTACT,,bConfigureDUT,4,1,6,3,);
B(B_F,E_MOVE!,,15,0,21,4,,?DEN?D?AENO?C);
B(B_VARIN,,1,13,2,15,4,);
B(B_F,E_MOVE!,,15,8,21,12,,?DEN?D?AENO?C);
B(B_VARIN,,FALSE,13,10,15,12,);
B(B_VAROUT,,ChannelConfiguration_DUT.bOutput_Pulse_SignReverse,21,10,23,12,);
B(B_F,E_MOVE!,,15,12,21,16,,?DEN?D?AENO?C);
B(B_F,E_MOVE!,,15,4,21,8,,?DEN?D?AENO?C);
B(B_VARIN,,TRUE,13,6,15,8,);
B(B_VAROUT,,ChannelConfiguration_DUT.bOutput_Pulse_SignForward,21,6,23,8,);
B(B_VARIN,,TRUE,13,14,15,16,);
B(B_VAROUT,,ChannelConfiguration_DUT.iChannel,21,2,23,4,);
B(B_F,E_MOVE!,,15,16,21,20,,?DEN?D?AENO?C);
B(B_VARIN,,FALSE,13,18,15,20,);
B(B_VAROUT,,ChannelConfiguration_DUT.bDutyRatio25,21,18,23,20,);
B(B_F,E_MOVE!,,15,20,21,24,,?DEN?D?AENO?C);
B(B_VAROUT,,ChannelConfiguration_DUT.bAccelerationSteps60,21,14,23,16,);
B(B_VAROUT,,ChannelConfiguration_DUT.bFrequencyRange_191Hz_100kHz,21,22,23,24,);
B(B_VARIN,,TRUE,13,22,15,24,);
B(B_F,E_MOVE!,,15,24,21,28,,?DEN?D?AENO?C);
B(B_VARIN,,FALSE,13,26,15,28,);
B(B_VAROUT,,ChannelConfiguration_DUT.Home_bEnableHomeOnlyAfterNearHomeDeceleration,21,26,23,28,);
B(B_F,E_MOVE!,,15,28,21,32,,?DEN?D?AENO?C);
B(B_VAROUT,,ChannelConfiguration_DUT.Home_iDeviationCounterClearSignalOutputTime_in_0p5ms,21,30,23,32,);
B(B_VARIN,,5,13,30,15,32,);
L(10,2,10,6);
L(10,10,10,14);
L(10,6,10,10);
L(10,14,10,18);
L(10,18,10,22);
L(10,22,10,26);
L(6,2,10,2);
L(1,2,4,2);
L(10,26,10,30);
L(10,30,15,30);
L(10,26,15,26);
L(10,22,15,22);
L(10,18,15,18);
L(10,6,15,6);
L(10,14,15,14);
L(10,10,15,10);
L(10,2,15,2);
L(1,0,1,32);
        END_NETWORK_BODY
    END_NET_WORK
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 11 ;
        NETWORK_BODY
B(B_FB,PulseOutput_Home_FB!,PulseOutput_Home,15,1,28,11,,?BbExecute?BbReverse?BdiInitialAndFinalSpeed?BdiTargetSpeed?BdiAccelerationTime?BdiDecelerationTime?BdiCreepSpeed?BdutChannelConfiguration?AbError);
B(B_VARIN,,bExecute,13,2,15,4,);
B(B_VARIN,,bReverse,13,3,15,5,);
B(B_VARIN,,1500,13,4,15,6,);
B(B_VARIN,,12000,13,5,15,7,);
B(B_VARIN,,300,13,6,15,8,);
B(B_VARIN,,600,13,7,15,9,);
B(B_VARIN,,500,13,8,15,10,);
B(B_VARIN,,ChannelConfiguration_DUT,13,9,15,11,);
B(B_VAROUT,,bError,28,2,30,4,);
L(1,0,1,11);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

(* Used DUT parameters *)
ChannelConfiguration_DUT.iChannel := 1;
ChannelConfiguration_DUT.bOutput_Pulse_ForwardTrue := TRUE;
ChannelConfiguration_DUT.bOutput_Pulse_ForwardFalse := FALSE;
ChannelConfiguration_DUT.bAccelerationSteps60 := FALSE;
ChannelConfiguration_DUT.bDutyRatio25 := TRUE;
ChannelConfiguration_DUT.bFrequencyRange_191Hz_100kHz := TRUE;
ChannelConfiguration_DUT.Home_bEnableHomeOnlyAfterNearHomeDeceleration := FALSE;
ChannelConfiguration_DUT.Home_iDeviationCounterClearSignalOutputTime_in_0p5ms := 5;
ChannelConfiguration_DUT.bExecuteInInterrupt := FALSE;
(* FB *)
PulseOutput_Home(bExecute := bExecute,
         bReverse := bReverse,
         diInitialAndFinalSpeed := 1500,
         diTargetSpeed := 12000,
         diAccelerationTime := 300,
         diDecelerationTime := 600,
         diCreepSpeed := 500,
         dutChannelConfiguration := ChannelConfiguration_DUT,
         bError => bError);

Modified on: 2019-01-25Feedback on this pagePanasonic hotline