MailServerPort

Write Read TwinCAT TIA
Network E-Mail SmtpServerSettings

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

Port of 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:

    bReadMailServerPort
    A boolean variable that can be used to trigger the execution of the ReadMailServerPort command.
    bWriteMailServerPort
    A boolean variable that can be used to trigger the execution of the WriteMailServerPort command.
    hrMailServerPort
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    MailServerPort
    A DINT variable that sets the server port.
    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 server port is stored.
    SizeOfNodeValue
    A UINT variable that specifies the size of the variable in which the server port is stored.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
    bReadMailServerPort       : BOOL;
    bWriteMailServerPort      : BOOL;
    hrMailServerPort       : HRESULT;
    MailServerPort        : DINT;

    fbSmtpServerSettings      : FB_SmtpServerSettings;
END_VAR

hrMailServerPort := fbSmtpServerSettings.ReadMailServerPort(
      bExecute    := bReadMailServerPort,
      ConnectionHandle  := depragSmartConnection.ConnectionHandle,
      Output     => MailServerPort);
IF hrMailServerPort <> S_FALSE THEN 
    bReadMailServerPort := FALSE;
END_IF
  
hrMailServerPort := fbSmtpServerSettings.WriteMailServerPort(
      bExecute    := bWriteMailServerPort,
      ConnectionHandle  := depragSmartConnection.ConnectionHandle,
      PointerToNodeValue  := ADR(MailServerPort),
      SizeOfNodeValue  := SIZEOF(MailServerPort));
IF hrMailServerPort <> S_FALSE THEN 
    bWriteMailServerPort := 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".