beautypg.com

Xylem Expert 7060_7070_Modbus User Manual

Page 28

background image

Communication protocol Serie30

Page 34/37

6.5

Description of the software driver (DLL)

6.5.1 General
The available DLL s30c.dll has been tested on the Windows 95, 98, NT and 2000 operating systems.

Examples of the use of this DLL are available for the following programming languages:

- LabVIEW

- C++

- Delphi

- VB

- VBA

The call convention stdcall is used for assigning the parameters to the functions. This means that:

all parameters are passed via the stack,

the parameter furthest to the right is calculated and passed first, the parameter furthest to the left is calculated and passed

last,

the function itself deletes the parameters from the stack.

As the declarations for the functions presented below show, many variables are declared with the prefixed word var. This means

that these variables are passed as pointers and not as values.

The types employed for declaration purposes are described below:

Type

Range

Format

Byte

0..255

8-bit without sign

Word

0..65535

16-bit without sign

Smallint

-32768..32767

16-bit with sign

Longint

-2147483648.. 2147483647

32-bit with sign

Pbyte

Pointer to byte

Single

+/- 1.5x10

-45

..3.4x10

38

32-bit

6.5.2 The functions of the DLL
Each function returns a value which indicates whether the desired function has been successfully executed or not. All the

possible return values are specified below. The returned parameters are only valid and may only be processed if the function

concerned has been successfully executed.

Return value

Description

RS_OK

0

Function successfully executed; return parameters are valid

RS_EX1

1

Function successfully executed; but exception error 1 has occurred

RS_EX2

2

Function successfully executed; but exception error 2 has occurred

RS_EX3

3

Function successfully executed; but exception error 3 has occurred

RS_EX32

32

Function successfully executed; but exception error 32 has occurred

RS_BROADCAST 100 Broadcast

RS_ERROR

-1

General error

RS_TXERROR

-2

Transmit error

RS_RXERROR

-3

Receive error in UART

RS_TIMEOUT

-4

No data or insufficient data received

RS_BADDATA

-5

Data erroneous (e.g. CRC16 erroneous)