Password

Write Read TwinCAT TIA
Network E-Mail SmtpServerSettings

ns=2;s=DEPRAG Smart/Network/EMailClient/SmtpServerSettings/Password

Password with which the application authenticates itself to the SMTP server.

Examples:

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

Beckhoff parameter:

    bReadPassword
    A boolean variable that can be used to trigger the execution of the ReadPassword command.
    bWritePassword
    A boolean variable that can be used to trigger the execution of the WritePassword command.
    hrPassword
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    Password
    A STRING(80) variable containing the password.
    fbSmtpServerSettings
    An instance of the "FB_SmtpServerSettings" function block supplied with the DEPRAG Smart library.
    PointerToNodeValue
    A variable of the type "POINTER TO BYTE" in which the password is stored.
    SizeOfNodeValue
    A UINT variable that specifies the length of the variable in which the password is stored.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
    bReadPassword        : BOOL;
    bWritePassword        : BOOL;
    hrPassword         : HRESULT;
    Password         : STRING(80);

    fbSmtpServerSettings      : FB_SmtpServerSettings;
END_VAR

hrPassword := fbSmtpServerSettings.ReadPassword(
     bExecute    := bReadPassword,
     ConnectionHandle  := depragSmartConnection.ConnectionHandle,
     Output    => Password);
IF hrPassword <> S_FALSE THEN 
    bReadPassword := FALSE;
END_IF
  
hrPassword := fbSmtpServerSettings.WritePassword(
     bExecute    := bWritePassword,
     ConnectionHandle  := depragSmartConnection.ConnectionHandle,
     PointerToNodeValue  := ADR(Password),
     SizeOfNodeValue  := SIZEOF(Password));
IF hrPassword <> S_FALSE THEN 
    bWritePassword := 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".