UserName

Write Read TwinCAT TIA
Network E-Mail SmtpServerSettings

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

The user name 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:

    bReadUserName
    A boolean variable that can be used to trigger the execution of the ReadUserName command.
    bWriteUserName
    A boolean variable that can be used to trigger the execution of the WriteUserName command.
    hrUserName
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    UserName
    A STRING(80) variable containing the user name.
    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 user name is stored.
    SizeOfNodeValue
    A UINT variable that specifies the length of the variable in which the user name is stored.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
    bReadUserName        : BOOL;
    bWriteUserName        : BOOL;
    hrUserName         : HRESULT;
    UserName         : STRING(80);

    fbSmtpServerSettings      : FB_SmtpServerSettings;
END_VAR

hrUserName := fbSmtpServerSettings.ReadUserName(
     bExecute    := bReadUserName,
     ConnectionHandle  := depragSmartConnection.ConnectionHandle,
     Output     => UserName);
IF hrUserName <> S_FALSE THEN 
    bReadUserName := FALSE;
END_IF

hrUserName := fbSmtpServerSettings.WriteUserName(
     bExecute    := bWriteUserName,
     ConnectionHandle  := depragSmartConnection.ConnectionHandle,
     PointerToNodeValue  := ADR(UserName),
     SizeOfNodeValue  := SIZEOF(UserName));
IF hrUserName <> S_FALSE THEN 
    bWriteUserName := 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".