SaveScrewdrivingRelatedSetting

TwinCAT TIA
Devices DEPRAG devices Sequence controller ActiveDevices One client Settings Screwdriving sequence

ns=2;s=DEPRAG Smart/Devices/DEPRAG/AST/ActiveDevices/0/Settings/ScrewdrivingRelated/SaveScrewdrivingRelatedSetting

The command sets the settings that affect the screwdriving process.

Parameters:

    ScrewdrivingRelatedSetting
    A variable of the type ScrewdrivingRelatedSettingSmart, this contains the settings concerning the screwdriving process.
      MainDirection
      Main direction of rotation of the sequence controller:
      Right
      Left
      StartMode
      Start mode of the sequence controller:
      I/O interface: the start signal is given via the I/O interface.
      Fieldbus: the start signal is given via the fieldbus (only available if your sequence control AST12 has a built-in fieldbus module)
      Process control: if process control is active, the start signal is given by the process control (only available if the process control extension is enabled)
      Handheld screwdriver: depending on the type of the connected MINIMAT®-EC screwdriver, the start of the screwdriving is done via pressure or key (this setting is not available for built-in screwdrivers)
      PrgChoice
      Program selection of the sequence controller:
      I/O interface: the selection of the program number is made via the I/O interface.
      Fieldbus: the selection of the program number is done via the fieldbus
      Process control: if process control is active, the program selection is made via the process control
      Handheld screwdriver: the selection of the program number is done via the setting program handheld screwdriver 1 and program handheld screwdriver 2
      Display: the selection of the program number is done via the input field
      Barcode: the program number is selected depending on the barcode that has been read in.
      StartEnableMode
      Source of the external start enable.
      I/O interface: the start enable signal is given via the I/O interface.
      Fieldbus: the start enable signal is given via the fieldbus.
      Process control: if process control is active, the start enable signal is given via the process control
      PrgHandtool1
      Only for handheld screwdriver: Screwdriving program that is executed when the handheld screwdriver program is selected if no reversal is active.
      PrgHandtool2
      Only for handheld screwdriver: Screwdriving program that is executed when the handheld screwdriver program is selected and the reversing function is active.
      ProcessDisplay
      Indication of the process visualization on the display:
      Variant 1
      Variant 2
      Variant 3
      CanReloadByDisplay
      Reloading via the display active or not. Only for handheld screwdrivers:
      If the AST12 sequence controller is operated with a screw feeder, manual reloading of a screw can be activated via key on the display. If "Reloading via display" is active, the reloading key is shown on the process display.

Returns:

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bAstSaveScrewdrivingRelatedSetting
    A boolean variable that can be used to trigger the execution of the SaveScrewdrivingRelatedSetting command.
    outputAstSaveScrewdrivingRelatedSetting
    An instance of the ST_VoidOutputData structure into which the return value of the SaveScrewdrivingRelatedSetting method is written.
    hrAstSaveScrewdrivingRelatedSetting
    This can be used to monitor the execution of the command. Error codes have the type HRESULT.
    fbAst
    An instance of the FB_AST function block supplied with the DEPRAG Smart library.
    sDeviceId
    A string value that specifies the device for which the settings that affect the screwdriving process are to be saved.
    ScrewdrivingRelatedSettingSmart
    A variable of type ST_ScrewdrivingRelatedSettingSmart, this contains the settings related to the screwdriving process.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
     bAstSaveScrewdrivingRelatedSetting  : BOOL;
     outputAstSaveScrewdrivingRelatedSetting : ST_VoidOutputData;                                          
     hrAstSaveScrewdrivingRelatedSetting  : HRESULT;
    
     screwdrivingRelatedSetting    : ST_ScrewdrivingRelatedSettingSmart := (
            MainDirection     := MainDirection.Right,
            SpeedReduction     := ActiveInactiveEnum.Inactive,
            StartMode      := StartMode.StartScrewdriver,
            PrgChoice      := ProgramChoice.PgChoiceSetup,
            StartEnable      := StartEnable.Inactive,
            StartEnableMode     := StartEnableMode.SEInternalLogic,
            PrgHandtool1     := 1,
            PrgHandtool2     := 2,
            ProcessDisplay     := ProcessDisplay.ProcessDisplay1,
            StartSignalTimeout    := 0,
            ReloadDurationInMilliseconds := 50,
            CanReloadByDisplay    := ActiveInactiveEnum.Inactive);

     fbAst   : FB_AST;
END_VAR

hrAstSaveScrewdrivingRelatedSetting := fbAst.SaveScrewdrivingRelatedSetting(
       bExecute       := bAstSaveScrewdrivingRelatedSetting,   
       ConnectionHandle    := depragSmartConnection.ConnectionHandle,
       sDeviceId      := '0',
       ScrewdrivingRelatedSettingSmart := screwdrivingRelatedSetting,
       OutputData   => outputAstSaveScrewdrivingRelatedSetting);
IF hrAstSaveScrewdrivingRelatedSetting <> S_FALSE THEN 
 bAstSaveScrewdrivingRelatedSetting := FALSE;
END_IF 
                                                    

For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".