SetTighteningProgram

TwinCAT TIA
Devices Multi-vendor devices Open Protocol devices OpenProtocolDevices One device

ns=2;s=DEPRAG Smart/Devices/General/OpenProtocol/OpenProtocolDevices/0/SetTighteningProgram

Selects a screwdriving program.

Parameters:

    ProgramNumber
    Program number of the screwdriving program to be selected on the device.

Returns:

    SetTighteningProgram
    A variable of the OpcMethodReturnValueVoid type. The method has no command-specific return values.

Examples:

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

Beckhoff parameter:

    bOpenProtocolSetTighteningProgram
    A boolean variable that can be used to trigger the execution of the SetTighteningProgram command.
    OutputDataOpenProtocolSetTighteningProgram
    An instance of the "ST_VoidOutputData" structure into which the return value of the SetTighteningProgram method is written.
    hrOpenProtocolSetTighteningProgram
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    fbOpenProtocol
    An instance of the "FB_OpenProtocol" function block supplied with the DEPRAG Smart library.
    sDeviceId
    A DINT value that identifies the device in the list of devices registered with the DEPRAG Smart OPC UA Server.
    nProgramNumber
    A DINT variable containing the program number of the tightening program to be selected on the instrument.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
       bOpenProtocolSetTighteningProgram    : BOOL;
       OutputDataOpenProtocolSetTighteningProgram  : ST_VoidOutputData;
       hrOpenProtocolSetTighteningProgram    : HRESULT;

       fbOpenProtocol   : FB_OpenProtocol;
END_VAR

hrOpenProtocolSetTighteningProgram := fbOpenProtocol.SetTighteningProgram(
        bExecute    := bOpenProtocolSetTighteningProgram,
        ConnectionHandle := depragSmartConnection.ConnectionHandle,
        sDeviceId   := '0',
        nProgramNumber  := 1,
        OutputData   => OutputDataOpenProtocolSetTighteningProgram);
IF hrOpenProtocolSetTighteningProgram <> S_FALSE THEN 
       bOpenProtocolSetTighteningProgram := 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".