FB_RAIDGetStatus

FB_RAIDGetStatus 1:

This function block returns the RAID set index, the RAID type, the RAID status, the number of RAID drives and the status of the RAID drives.

Notice

Call once per second at the most!

The system performance can be dramatically affected by the cyclic calling of this function block.

VAR_INPUT

VAR_INPUT
    sNETID          : T_AmsNetId;
    bWrtRd          : BOOL;
    stRAIDConfigReq : ST_RAIDConfigReq;
    tTimeOut        : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

sNETID: A string containing the AMS network ID of the target device to which the ADS command is sent (type: T_AmsNetID).

bWrtRd: The command is triggered by the rising edge of this input.

stRAIDConfigReq: RAID configuration request parameters are defined in this structure (type: ST_RAIDConfigReq). It contains the controller ID and the index of the RAID set.

tTimeOut: States the length of the timeout that may not be exceeded during execution of the command.

VAR_OUTPUT

VAR_OUTPUT
    stRAIDStatusRes  : ST_RAIDStatusRes;
    nBytesRead       : UDINT;
    bBusy            : BOOL;
    bError           : BOOL;
    nErrorID         : UDINT;
END_VAR

stRAIDStatusRes: This structure contains the RAID status response, the RAID set index, the RAID type, the RAID status, the number of RAID drives and the status of the RAID drives (type: ST_RAIDStatusRes).

nBytesRead: Number of successfully returned data bytes.

bBusy: This output remains TRUE until the block has executed a command, but no longer than the time present at the ‘Timeout’ input. No new command will be accepted at the inputs as long as bBusy = TRUE. Please note that it is not the execution of the service, but the time during which it be may executed that is monitored here.

bError: This output is set to TRUE if an error occurs during the execution of a command. The command-specific error code is located in ‘nErrorId’. If the block has an timeout error, ‘bError’ is set to TRUE and ‘nErrorId’ is 1861 (hexadecimal 0x745). It is set to FALSE if a command is executed at the inputs.

nErrorID: Contains the command-specific error code of the commands executed last; it is reset to 0 by a command at the inputs.

Requirements

Development environment

Target platform

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_IoFunctions (IO)