Below are command values and status values used by or returned by DNP3 Master function blocks. You can directly copy & paste these definitions in the "Global Defines" editor.

// Qualifier

#define RANGE_NONE 16#00

#define RANGE_STARTSTOP 16#01

#define RANGE_COUNT 16#02

// Function code

#define COMMAND_SBO 16#00

#define COMMAND_DIRECTOPERATE 16#01

#define COMMAND_DIRECTOPERATE_NOACK 16#02

// Values for control code of CROB

// CR : Clear field

#define CR_CLEAR 16#01 //< Clear the command on Binary Outputs

// OpType : Operation type Field (control code for CROB)

#define OPERATION_NUL 16#00

#define OPERATION_PULSEON 16#01 //< The point is turned on for the specified onTime, turned off for the specified offTime, and left in the off state

#define OPERATION_PULSEOFF 16#02 //< The point is turned off for the specific offTime, then turned on for the specified onTime, and left in the on state

#define OPERATION_LATCHON 16#03 //< The point is latched on

#define OPERATION_LATCHOFF 16#04 //< The point is latched off

#define TCC_NUL 16#00

#define TCC_CLOSE 16#01

#define TCC_TRIP 16#02

attention Attention

The CONTROL input to use for the DNP3M_CMDBIN block is an association of the Operation Type Field, Trip-Close Code and Clear Field.

Eg. the CONTROL input of the DNP3M_CMDBIN block must be 16#0100 if you want to send a Pulse_On with TCC=NUL

The code to generate the control variable must follow this principle: 'ControlVar := SHL(ClearField, 15) OR SHL(OpTypeField, 8) OR TripCloseCode;’

 

// Response values

// RC_CMD : Result command

#define COMMAND_SELECTACTIVATE 16#01 ///< command select has been sent

#define COMMAND_SELECTOK 16#02 ///< command select completed

#define COMMAND_ACTIVATE 16#03 ///< actual command has been sent

#define COMMAND_OK 16#04 ///< command completed successfully

#define COMMAND_INVALID 16#05 ///< command PDU cannot be created, the command contains invalid elements

#define COMMAND_CONNEG 16#06 ///< command completed with negative acknowledge

#define COMMAND_ERROR 16#07 ///< command completed with error (timeout, auth error)

#define COMMAND_CANCEL 16#08 ///< command canceled as command queue has been cleared

// RC_FT : Result file transfer

#define FTSTATUS_OPENING 16#01 ///< File open initiated

#define FTSTATUS_OPEN 16#02 ///< File open completed successfully

#define FTSTATUS_INPROGRESS 16#03 ///< File transfer initiated

#define FTSTATUS_OK 16#04 ///< File transfer completed successfully

#define FTSTATUS_SENDERROR 16#05 ///< Error sending file transfer request, building or sending failed

#define FTSTATUS_REQUESTFAILED 16#06 ///< Received negative acknowledge

#define FTSTATUS_REQUESTTIMEOUT 16#07 ///< Request timeout or authentication error

#define FTSTATUS_ABORT 16#08 ///< File transfer has been aborted either internally or initiated by the user

#define FTSTATUS_DATATIMEOUT 16#0A ///< File transfer timeout occurred

#define FTSTATUS_LOCAL_FAIL 16#0B ///< local file system access failed / denied

#define FTSTATUS_CANNOTABORT 16#0C ///< cannot abort

#define FTSTATUS_BUFFEREXCEEDED = 16#0D ///< Expected file size exceeded

#define FTSTATUS_MAXFILESIZE_EXCEEDED 16#0E ///< Maximum file size exceeded

#define FTSTATUS_OUT_OF_MEMORY 16#0F ///< could not create receive buffer

#define FTSTATUS_FTSTATUSOFFSET > 1000 ///< Fail

File transfer return codes (RC_FT)

1: PERMISSION_DENIED (Permission was denied due to improper authentication key, user name or password.)

2: INVALID_MODE (An unsupported or unknown operation mode was requested.)

3: FILE_NOT_FOUND (The requested file does not exist.)

4: FILE_LOCKED (The requested file is already in use by another user.)

5: TOO_MANY_OPEN (File could not be opened because the number of simultaneously opened files would be exceeded.)

6: INVALID_HANDLE (There is no file opened with the handle in the request.)

7: WRITE_BLOCK_SIZE(The outstation is unable to negotiate a suitable write block size.)

8: COMM_LOST (Communications were lost or cannot be established with the end device where the file resides.)

9: CANNOT_ABORT (An abort request was unsuccessful because the outstation is unable or not programmed to abort, or the outstation knows that aborting the file would make it unusable.)

16: NOT_OPENED (File handle does not reference an opened file.)


Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation