ETH_PORT_CTRL: Executing a Security Command in an Application
Original instructions
Function Description
Use the ETH_PORT_CTRL function block to control the FTP TFTP, HTTP, and DHCP / BOOTP protocols when they are enabled in the Security screen of the Control Expert DTM. (By default, these protocols are disabled.) Map the inputs on variables and on unlocated variables in which the HMI property is disabled (the variable is not in the data dictionary.
The additional parameters EN and ENO may also be configured.
FBD Representation
Representation:
LD Representation
Representation:
IL Representation
CAL ETH_PORT_CTRL_Instance (ENABLE := EnableSecurityChange, ABORT := AbortSecurityChange, ADDR := ModuleAddress, ETH_SCE := ServiceToChange, DONE => BlockExecutionDone, ACTIVE => BlockExecutionInProgress, ERROR => BlockExecutionError, STATUS => BlockErrorStatus, ETH_SCE_STATUS => ChangeServiceStatus)
ST Representation
ETH_PORT_CTRL_Instance (ENABLE := EnableSecurityChange, ABORT := AbortSecurityChange, ADDR := ModuleAddress, ETH_SCE := ServiceToChange, DONE => BlockExecutionDone, ACTIVE => BlockExecutionInProgress, ERROR => BlockExecutionError, STATUS => BlockErrorStatus, ETH_SCE_STATUS => ChangeServiceStatus);
Description of Parameters
The following table describes the input parameters:
Parameter
Type
Comment
ENABLE
BOOL
Set to 1 to enable the operation.
ABORT
BOOL
Set to 1 to abort the currently active operation.
ADDR
ANY_ARRAY_INT
This array contains the address of the entity for which you want to change the security state (the result of the ADDMX or ADDM function). For example:
  • ADDM(‘0.0.10’) for a M580 CPU
  • ADDM(‘0.3.0’) for a BMENOC in slot 3 of the main rack
  • ADDMX(‘0.0.3{192.168.10.2}SYS) for a BMXCRA with the IP address 192.168.10.2
NOTE:
  • To address a module in the local rack, enter 0.0.10 (CPU main server address).
  • In M580 Hot Standby systems, ADDR represents the address of the primary controller. If you disable TFTP you disable the synchronization of the FDR service.
ETH_SCE
WORD
For each protocol, use these binary values to control the protocol:
  • 00: The protocol is unchanged.
  • 01: Enable the protocol.
  • 10: Disable the protocol.
  • 11: reserved
    NOTE: A value of 11 reports a detected error in ETH_SCE_STATUS.
These bits are used for the different protocols:
  • 0, 1: FTP
  • 2, 3: TFTP (Only available for Modicon M580)
  • 4, 5: HTTP
  • 6, 7: DHCP / BOOTP
  • 8...15: reserved (value = 0)
The following table describes the output parameters:
Parameter
Type
Comment
DONE
BOOL
Operation completed indication. Set to 1 when the execution of the operation is completed successfully.
ACTIVE
BOOL
Operation in progress indication. Set to 1 when the execution of the operation is in progress.
ERROR
BOOL
Set to 1 if an error is detected by the function block.
STATUS
WORD
Code providing the detected error identification.
ETH_SCE_STATUS
WORD
For each protocol, these values contain the response to any attempt to enable or disable the FTP, TFTP, HTTP, or DHCP / BOOTP protocols:
  • 0: command executed
  • 1: command not executed
Reasons for not executing the command can be:
  • The communication service has been disabled by the configuration.
  • The communication service is already in the state requested by the command (Enabled or Disabled).
  • The communication service (x) is not supported by the module or is a non-existing service.
These bits are used for the different protocols:
  • 0: FTP
  • 1: TFTP
  • 2: HTTP
  • 3: DHCP / BOOTP
  • 4 ... 15: reserved (value = 0)
Execution Type
When used on a BMENOC0301/11 module, the ETH_PORT_CTRL function block is executed asynchronously and may take several cycles until the DONE output turns ON. Therefore, the ACTIVE output is set to ON until the completion of the ETH_PORT_CTRL function block.
How to Use the ETH_PORT_CTRL EFB
Follow these steps to use the ETH_PORT_CTRL EFB.
Step
Action
1
Set the bits of the services you want to activate in ETH_SCE.
2
Set ENABLE input to activate the EFB.
3
Reset ENABLE input as soon as the ACTIVE output is reset by the EFB.
4
Check STATUS output value:
  • STATUS<>0: There is a communication status code.
  • STATUS = 0: Check ETH_SCE_STATUS. The services for which the bits are set haven’t been modified as they should be.