GetScrewdrivingRelatedSetting

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/GetScrewdrivingRelatedSetting

Retrieves the settings of the screwdriving process.

Returns:

    GetScrewdrivingRelatedSetting
    A variable of type OpcMethodReturnValueScrewdrivingRelatedSettingSmart.
      Result
      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.

Examples:

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

Beckhoff parameter:

    bAstGetScrewdrivingRelatedSetting
    A boolean variable that can be used to trigger the execution of the GetScrewdrivingRelatedSetting command.
    outputAstGetScrewdrivingRelatedSetting
    An instance of the ST_AstGetScrewdrivingRelatedSettingOutputData structure into which the return value of the GetScrewdrivingRelatedSetting method is written.
    hrAstGetScrewdrivingRelatedSetting
    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 fetched.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
     bAstGetScrewdrivingRelatedSetting  : BOOL;
     outputAstGetScrewdrivingRelatedSetting : ST_AstGetScrewdrivingRelatedSettingOutputData;                                          
     hrAstGetScrewdrivingRelatedSetting  : HRESULT;

     fbAst   : FB_AST;
END_VAR

hrAstGetScrewdrivingRelatedSetting := fbAst.GetScrewdrivingRelatedSetting(
       bExecute    := bAstGetScrewdrivingRelatedSetting,   
       ConnectionHandle := depragSmartConnection.ConnectionHandle,
       sDeviceId   := '0',
       OutputData   => outputAstGetScrewdrivingRelatedSetting);
IF hrAstGetScrewdrivingRelatedSetting <> S_FALSE THEN 
 bAstGetScrewdrivingRelatedSetting := 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".