Supported platforms: CODESYS 3.5 SAFETY

 

List of Library's Data Types

 

PULL_DOWN_RESISTANCE (ENUM)

Name of the Member

Data Type

Default value

Description

NONE

DINT

0

None defined

R_82K

DINT

82000

Resistance value

R_2K2

DINT

2200

Resistance value

 

PULL_UP_RESISTANCE (ENUM)

Name of the Member

Data Type

Default value

Description

NONE

DINT

0

None defined

R_2K2

DINT

2200

Resistance value

 

VALUE_AT_AD_MAXIMUM (ENUM)

Name of the Member

Data Type

Default value

Description

U_TYPE091_10V

DINT

10500

I/O type091 10V measurement, 10500 mV

I_TYPE091_20mA

DINT

22721

I/O type091 20mA measurement, 22721 uA

U_TYPE093_5V

DINT

5556

I/O type093 5V measurement, 5556 mV

U_TYPE093_10V

DINT

11880

I/O type093 10V measurement, 11880 mV

I_TYPE093_20mA

DINT

22731

I/O type093 20mA measurement, 22731 uA

U_TYPE096_5V

DINT

6000

I/O type096 5V measurement, 6000 mV

U_REF5V

DINT

5900

Internal type103 +5V measurement, 5900 mV

U_REF10V

DINT

10900

Not used in SC52 I/O, compatibility for SHWD lib

U_SUPPLY

DINT

38333

Internal type078 Safety switch supply measurement, 38333 mV

U_IN

DINT

52000

Internal type102 Supply voltage measurement, 52000mV

U_PCB

DINT

5000

Internal type090 PCB temperature's voltage measurement, 5000mV

 

PWMChannelStatus (STRUCT)

Name of the Member

Data Type

Default value

Description

InitOk

BIT

FALSE

PWM channel inited ok

ParameterError

BIT

FALSE

One of the PWM channel parameter is out of the limits

OverCurrent

BIT

FALSE

Over current is occured in PWM channel

 

PWMChannelStatus (STRUCT)

Name of the Member

Data Type

Default value

Description

InitOk

BIT

FALSE

PWM channel inited ok

ParameterError

BIT

FALSE

One of the PWM channel parameter is out of the limits

OverCurrent

BIT

FALSE

Over current is occured in PWM channel

 

  PiChannelStatus (STRUCT)

Structure defines status bits for PI channel. This strúcture can be mapped to channel input variable status. 24 first bits are used for hw-specific status bits and 8 last ones for PI-channel status.

 

Name of the member

Type

Default value

Comment

HwSpecificSt1

BIT

FALSE

Hw specific status bit

HwSpecificSt2

BIT

FALSE

Hw specific status bit

HwSpecificSt3

BIT

FALSE

Hw specific status bit

HwSpecificSt4

BIT

FALSE

Hw specific status bit

HwSpecificSt5

BIT

FALSE

Hw specific status bit

HwSpecificSt6

BIT

FALSE

Hw specific status bit

HwSpecificSt7

BIT

FALSE

Hw specific status bit

HwSpecificSt8

BIT

FALSE

Hw specific status bit

HwSpecificSt9

BIT

FALSE

Hw specific status bit

HwSpecificSt10

BIT

FALSE

Hw specific status bit

HwSpecificSt11

BIT

FALSE

Hw specific status bit

HwSpecificSt12

BIT

FALSE

Hw specific status bit

HwSpecificSt13

BIT

FALSE

Hw specific status bit

HwSpecificSt14

BIT

FALSE

Hw specific status bit

HwSpecificSt15

BIT

FALSE

Hw specific status bit

HwSpecificSt16

BIT

FALSE

Hw specific status bit

HwSpecificSt17

BIT

FALSE

Hw specific status bit

HwSpecificSt18

BIT

FALSE

Hw specific status bit

HwSpecificSt19

BIT

FALSE

Hw specific status bit

HwSpecificSt20

BIT

FALSE

Hw specific status bit

HwSpecificSt21

BIT

FALSE

Hw specific status bit

HwSpecificSt22

BIT

FALSE

Hw specific status bit

HwSpecificSt23

BIT

FALSE

Hw specific status bit

HwSpecificSt24

BIT

FALSE

Hw specific status bit

PiDrvStatusBit1

BIT

FALSE

PI driver specific status bit. Unused.

PiDrvStatusBit2

BIT

FALSE

PI driver specific status bit. Unused.

PiDrvStatusBit3

BIT

FALSE

PI driver specific status bit. Unused.

PiDrvStatusBit4

BIT

FALSE

PI driver specific status bit. Unused.

PiDrvStatusBit5

BIT

FALSE

PI driver specific status bit. Unused.

PiDrvStatusBit6

BIT

FALSE

PI driver specific status bit. Unused.

PiDrvStatusBit7

BIT

FALSE

PI driver specific status bit. Unused.

PiChnPwNotValid

BIT

FALSE

Pulsewidth measurement not valid.

 

 

DrvDiagData (STRUCT)

Data structure for diagnostic handles. Handle is pointer to driver specific diagnostic data.

 

Name of the Member

Data Type

Default value

Description

pFpuDiagData

POINTER TO FpuDiag

FALSE

Handle array for different drivers, which offer extra diagnostic.

 

FpuDiag (STRUCT)

Diagnostic data structure for FPU driver diagnostic.

 

Name of the Member

Data Type

Default value

Description

lastAddedIndex

DWORD

0

Last added index in array events.

fieldSize

DWORD

0

Size of the FpuDiagField. This can be used to check if data definition matches in Applciation and in firmware side.

totalCount

DWORD

0

Total count of the exceptions from the start of the unit.

NOTE : This count is not reset if the application is reloaded in debug mode.

events

ARRAY [0..9] OF FpuDiagField

0

Array of the lates 10 exception events.

 

FpuDiagfield (STRUCT)

Data structure for one FPU exception event.
 

Name

Type

Default value

Comment

drvType

DRV_DIAG_TYPE

1

Driver type

timeStamp

DWORD

0

Time stamp of the event

ErrCode

EPEC_SYSTEM.SYSTEM_ERROR_CODES

0

Possible error code

SpeStatusRegister

DWORD

0

Value of the FPU status register

instructions

DWORD

0

Used instruction

excpAddress

DWORD

0

Address of the line where exception occured.

operandA

REAL

0

Used operand A

operandB

REAL

0

Used operand B

reservation1

DWORD

0

Reservation for future use

reservation2

DWORD

0

Reservation for future use

reservation3

DWORD

0

Reservation for future use

DRV_DIAG_TYPE (ENUM)

Enumeration for different drivers which offer extra diagnostic.

 

Name of the Member

Data Type

Default value

Description

DRV_DIAG_TYPE_FPU

DINT

1

FPU driver

 

FpuStRef (STRUCT)

FPU status register flags for core
 

Name of the member

Type

Default value

Comment

SOVH

BOOL

FALSE

Summary Integer Overflow High. Defined by SPE.

OVH

BOOL

FALSE

Integer Overflow High. Defined by SPE.

FGH

BOOL

FALSE

Embedded Floating-Point Guard Bit High

FGH is supplied for use by the floating-point round exception handler. FGH is zeroed if a floating-point data exception occurs for the high element(s). FGH corresponds to the high element result. FGH is cleared by a scalar floating-point instruction.

FXH

BOOL

FALSE

Embedded Floating-Point Sticky Bit High

FXH is supplied for use by the Floating-point round exception handler. FXH is zeroed if a floating-point data exception occurs for the high element(s). FXH corresponds to the high element result. FXH is cleared by a scalar floating-point instruction.

FINVH

BOOL

FALSE

Embedded Floating-Point Invalid Operation/Input Error High

In mode 0, the FINVH Bit is set to 1 if the A or B high element operand of a floating-point instruction is Infinity, NaN, or Denorm, or if the operation is a divide and the high element dividend and divisor are both 0. In mode 1, the FINVH Bit is set on an IEEE Std 754 invalid operation (see IEEE 754-1985, Section 7.1) in the high element. FINVHH is cleared by a scalar floating-point instruction.

FDBZH

BOOL

FALSE

Embedded Floating-Point Divide by Zero High

The FDBZH Bit is set to 1 when a floating-point divide instruction executed with a high element divisor of 0, and the high element dividend is a finite non-zero number. FDBZH is cleared by a scalar floating point instruction.

FUNFH

BOOL

FALSE

Embedded Floating-Point Underflow High

The FUNFH Bit is set to 1 when the execution of a floating-point instruction results in an underflow in the high element. FUNFH is cleared by a scalar floating-point instruction.

FOVFH

BOOL

FALSE

Embedded Floating-Point Overflow High

The FOVFH Bit is set to 1 when the execution of a floating-point instruction results in an overflow in the high element. FOVFH is cleared by a scalar floating-point instruction.

RES_1

BOOL

FALSE

Reserved

RM

BOOL

FALSE

Rounding Mode—Fixed point

Defined by SPE

FINXS

BOOL

FALSE

Embedded Floating-Point Inexact Sticky Flag.

The FINXS Bit is set to 1 whenever the execution of a floating-point instruction delivers an inexact result for either the low or high element and no floating-point data exception is taken for either element, or if the result of a floating-point instruction results in overflow (FOVF = 1 or FOVFH = 1), but floating-point overflow exceptions are disabled (FOVFE = 0), or if the result of a floating-point instruction results in underflow (FUNF=1 or FUNFH=1), but floating-point underflow exceptions are disabled (FUNFE = 0), and no floating-point data exception occurs. The FINXS BOOL remains set until it is cleared by a mtspr instruction specifying the SPEFSCR register.

FINVS

BOOL

FALSE

Embedded Floating-Point Invalid Operation Sticky Flag.

The FINVS Bit is set TO a 1 when a floating-point instruction sets the FINVH OR FINV BOOL TO 1. The FINVS BOOL remains set UNTIL it is cleared BY a mtspr instruction specifying the SPEFSCR register.

FDBZS

BOOL

FALSE

Embedded Floating-Point Divide by Zero Sticky Flag

The FDBZS Bit is set to 1 when a floating-point divide instruction sets the FDBZH or FDBZ BOOL to 1. The FDBZS BOOL remains set until it is cleared by a mtspr instruction specifying the SPEFSCR register.

FUNFS

BOOL

FALSE

Embedded Floating-Point Underflow Sticky Flag

The FUNFS Bit is set to 1 when a floating-point instruction sets the FUNFH or FUNF BOOL to 1. The FUNFS BOOL remains set until it is cleared by a mtspr instruction specifying the SPEFSCR register.

FOVFS

BOOL

FALSE

Embedded Floating-Point Overflow Sticky Flag

The FOVFS Bit is set to 1 when a floating-point instruction sets the FOVFH or FOVF BOOL to 1. The FOVFS Bit remains set until it is cleared by a mtspr instruction specifying the SPEFSCR register.

MODE

BOOL

FALSE

Embedded Floating-Point Operating Mode

0 Default hardware results operating mode 1 IEEE 754 standard hardware results operating mode (not supported by the e200) This Bit controls the operating mode of the EFPU. The e200 supports only mode 0. Software should read the value of this BOOL after writing it to determine if the implementation supports the selected mode. Implementations will return the value written if the selected mode is a supported mode, otherwise the value read will indicate the hardware supported mode.

SOV

BOOL

FALSE

Summary Integer Overflow. Defined by SPE.

OV

BOOL

FALSE

Integer Overflow. Defined by SPE.

FG

BOOL

FALSE

Embedded Floating-Point Guard Bit

FG is supplied for use by the floating-point round exception handler. FG is zeroed if a floating-point data exception occurs for the low element(s). FG corresponds to the low element result.

FX

BOOL

FALSE

Embedded Floating-Point Sticky Bit

FX is supplied for use by the floating-point round exception handler.FX is zeroed if a floating-point data exception occurs for the low element(s). FX corresponds to the low element result.

FINV

BOOL

FALSE

Embedded Floating-Point Invalid Operation/Input Error

In mode 0, the FINV Bit is set to 1 if the A or B low element operand of a floating-point instruction is Infinity, NaN, or Denorm, or if the operation is a divide and the low element dividend and divisor are both 0. In mode 1, the FINV Bit is set on an IEEE 754 standard invalid operation (IEEE 754-1985, Section 7.1) in the low element.

FDBZ

BOOL

FALSE

Embedded Floating-Point Divide by Zero

The FDBZ Bit is set to 1 when a floating-point divide instruction executed with a low element divisor of 0, and the low element dividend is a finite non-zero number.

FUNF

BOOL

FALSE

Embedded Floating-Point Underflow

The FUNF Bit is set to 1 when the execution of a floating-point instruction results in an underflow in the low element.

FOVF

BOOL

FALSE

Embedded Floating-Point Overflow

The FOVF bit is set to 1 when the execution of a floating-point instruction results in an overflow in the low element.

RES_2

BOOL

FALSE

Reserved

FINXE

BOOL

FALSE

Embedded Floating-Point Inexact Exception Enable

0 Exception disabled 1 Exception enabled If the exception is enabled, a floating-point round exception is taken if for both elements, the result of a floating-point instruction does not result in overflow or underflow, and the result for either element is inexact (FG | FX = 1, or FGH | FXH = 1), or if the result of a floating-point instruction does result in overflow (FOVF = 1 or FOVFH = 1) for either element, but floating-point overflow exceptions are disabled (FOVFE = 0), or if the result of a floating-point instruction results in underflow (FUNF = 1 or FUNFH = 1), but floating-point underflow exceptions are disabled (FUNFE = 0), and no floating-point data exception occurs.

FINVE

BOOL

FALSE

Embedded Floating-Point Invalid Operation/Input Error Exception Enable

0 Exception disabled 1 Exception enabled If the exception is enabled, a floating-point data exception is taken if the FINV or FINVH bit is set by a floating-point instruction.

FDBZE

BOOL

FALSE

Embedded Floating-Point Divide by Zero Exception Enable

0 Exception disabled 1 Exception enabled If the exception is enabled, a floating-point data exception is taken if the FDBZ or FDBZH bit is set by a floating-point instruction.

FUNFE

BOOL

FALSE

Embedded Floating-Point Underflow Exception Enable

0 Exception disabled 1 Exception enabled If the exception is enabled, a floating-point data exception is taken if the FUNF or FUNFH bit is set by a floating-point instruction.

FOVFE

BOOL

FALSE

Embedded Floating-Point Overflow Exception Enable

0 Exception disabled 1 Exception enabled If the exception is enabled, a Floating-point data exception is taken if the FOVF or FOVFH bit is set by a floating-point instruction.

FRMC

BYTE

FALSE

Combination of the FRMC1 + FRMC2

Embedded Floating-Point Rounding Mode Control 00 Round to nearest 01 Round toward zero 10 Round toward +infinity 11 Round toward –infinity

VersionInfo (STRUCT)

Name of the Member

Data Type

Default value

Description

HeaderTag

DWORD

0

Must be aways 0xA5AAAA55

BinarySize

DWORD

0

Size of the version info binary.

Crc

DWORD

0

 CRC is calculated over defined version fields in this structure Versions.

 This is calculated by usage of the CRC32 in firmware

 CRC start value is   0.

Value can be calculated in application by using CRC32 in library CAA Memory

NbrOAddedVersions

DWORD

0

Number of added versions.

VersionFieldType

DWORD

0

Type of the version field. Currently only TYPE 1 in use.

SizeOfTheField

DWORD

0

Size of the version field

Versions

ARRAY [1..10] OF VersionInfoVerField

0

Array of the versions.

 

VersionInfoVerField (STRUCT)

Name of the Member

Data Type

Default value

Description

Version Id

DWORD

0

Version id

Major

DWORD

0

Major version

Minor

DWORD

0

Minor version

SP

DWORD

0

Service pack

Patch

DWORD

0

Patch

 

ProductionData (STRUCT)

Structure depicts production data. This data is stored to unit protected flash are when it is manufactured.

It is read only and it is not possible to change on the field.

 

More detailed information look topic Reading production data.

 

Name of the Member

Data Type

Default value

Description

checkSum

DWORD

0

CRC32 checksum which is calculated over data excluding check sum field.

sizeOfTheData

DWORD

0

Size of the producion data. Size doesn't include CRC32 field.

dataVersion

DWORD

0

Member depict data version. This value can be used to handle data correctly.

Current data version is 1.

serialNumber

DWORD

0

Serial number for unit.

productCode

DWORD

0

Product code of the unit. Field contains product code for unit. Because field is DWORD it can differ from unit product code in Multitool.

For example SC52 (Multitool Creator) vs. 8916 (in production code).

hwVersion

DWORD

0

Hw-revision for unit.

Code is in format.

0xAAAABBCC

 

AAAA = Unit product code 2024,8916, etc.

BB = Letter from unit hardware revision (01 = A, 02=B, 03 = C, ...)

CC = Number from unit hardware version

 

For example:

0x22D40400 --> 8916D00

 

vendorId

DWORD

0

CiA vendor id for unit.

This member is not used for SC52 unit.

Customer specific Vendor id is defined when software is downloaded to unit in production. In this phase is also loaded default values for system parameters which can contain value for Vendor Id. This value is used when unit has no application. If unit contains CODESYS application it is duty of the application to add CANopen index which defines Vendor Id.

MAC

ARRAY [1..40] OF BYTE

0

MAC address if unit contains ethernet MAC address.

Data is valid only if unit contains ethernet connection.

licenses

ARRAY [1..40] OF BYTE

0

Possible license bytes.

This field defines values for possible licensed features.

Currently not used in SC52 and value is always 0.

prodDate

DWORD

0

Date of the production.

Can be used in CODESYS enviroment by chaning DWORD type to DATE type.

hwFunctionality

DWORD

0

HW functionality.

Not used for SC52 and values is always 0.

FirmWareId

ARRAY [1..16] OF BYTE

0

Firmware ids which are used to prevent to start wrong firmware binaries to unit

SafetySwicthesCount

BYTE

0

Number of safety switches in unit.

CANinterfafes

BYTE

0

Number of CAN interfaces in unit.

Reserved1

BYTE

0

Reservation for future use

Reserved

BYTE

0

Reservation for future use