Sei sulla pagina 1di 52
Graphic Control System (GCS): MODBUS PROTOCOL SUPPORT Revsion 2.0 - March 2003

Graphic Control System (GCS):

MODBUS PROTOCOL SUPPORT

Revsion 2.0 - March 2003

Table of Contents OVERVIEW 3 INTRODUCTION 3 FUNCTION CODE SUPPORT 3 READ INPUT STATUS (F

Table of Contents

OVERVIEW

3

INTRODUCTION

3

FUNCTION CODE SUPPORT

3

READ INPUT STATUS (FUNCTION CODE 02)

4

READ OUTPUT REGISTERS (FUNCTION CODE 03)

5

READ INPUT REGISTERS (FUNCTION CODE 04)

5

FORCE SINGLE COIL (FUNCTION CODE 05)

6

PRESET SINGLE REGISTER (FUNCTION CODE 06)

6

WRITE MULTIPLE COILS (FUNCTION CODE 15)

7

WRITE MULTIPLE OUTPUT REGISTERS (FUNCTION CODE 16)

7

ERROR / EXCEPTION RESPONSE

22

ERROR RESPONSE FUNCTION CODE

22

EXCEPTION RESPONSE CODE

22

OUTPUT FREQUENCY CONTROL VIA MODBUS

23

KEYPAD FREQUENCY MODE

23

ANALOG FOLLOWER MODE

24

PID CONTROL MODE

24

STATUS AND REGISTER ADDRESSES

27

TABLE 1: INPUT STATUS REGISTERS

27

TABLE 2: OUTPUT STATUS REGISTERS

30

TABLE 3: INPUT REGISTERS

35

TABLE 4: OUTPUT REGISTERS

39

DATABASE POINT IDENTIFIERS

49

TABLE 5: SHUTDOWN AND LOCKOUT CAUSES

49

TABLE 6: EVENT NUMERICS

52

OVERVIEW

This document provides the technical specifications of the Modbus RTU protocol support included with all Centrilift’s Graphic Control System (GCS) control units. All modules within the GCS group utilize the same register address map to facilitate exchanging model types with minimal disruptions to the central SCADA system’s configuration.

INTRODUCTION

The Graphic Control System products support a subset of the functions of Modicon Modbus Protocol in RTU (or binary) format as described in Modicon Modbus Protocol Reference Guide PI-MBUS-300, Rev C, dated January 1991. Specifically, the supported Modbus function codes are:

Function Code 01 Function Code 02 Function Code 03 Function Code 04 Function Code 05 Function Code 06 Function Code 15

Write Multiple Output Registers: Function Code 16

Read Output Coil Status :

Read Input Status:

Read Output Registers:

Read Input Registers:

Force Single Coil:

Preset Single Register:

Write Multiple Coils:

This document describes the supported functions and the response to each valid request from the host. It is intended to be used in conjunction with the Modicon Modbus protocol definition and applies to GCS (Graphic Control System) system controller software revision 6.44 or higher. All numeric values shown in the function code request and response examples are in hexadecimal (base 16) format, even when not denoted with an “H”.

FUNCTION CODE SUPPORT

This portion of the document provides examples of each MODBUS function code that is supported by the GCS controllers. For a complete list of register address, refer to table 1 through 4 in this manual.

READ OUTPUT COIL STATUS (FUNCTION CODE 01)

Digital output states are read by the host via Function Code 01, "Read Output Status". The first “coil” of this block reflects the state of the motor contactor or RUN state of the controller. If the motor is shut down Coil 0200 H will be set; if it has been requested to start, Coil 0200 H will be clear. All other output status coils will return their status in the same fashion.

For a complete list of the registers, see the tables at the end of this document.

Example - Function Code 01

Query:

RTU

FUNCTION

START

START

#

OF COILS

#

OF COILS

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

01H

02H

00H

00H

 

01H

FCH 72H

Response:

RTU

FUNCTION

BYTE COUNT

DATA COIL

 

CRC

 

ADDRESS

CODE

STATUS

01H

01H

01H

00H

51H 88H

READ INPUT STATUS (FUNCTION CODE 02)

Status inputs are accessed by the host via Function Code 02H, "Read Input Status". These status locations receive their values from devices connected to the I/O channels available or internal processes such as alarms, and can only be read, not altered within the system unit or via Modbus protocol.

For a complete list of the registers, see the tables at the end of this document.

Example: Function Code 2

Query:

RTU

FUNCTION

START

START

#

OF COILS

#

OF COILS

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

02H

01H

00H

00H

 

10H

78H 3AH

Response:

RTU

FUNCTION

BYTE COUNT

DATA COIL

 

DATA COIL

CRC

 

ADDRESS

CODE

STATUS

STATUS

01H

02H

02H

00H

15H

78H 77H

READ OUTPUT REGISTERS (FUNCTION CODE 03)

Output registers are read via Function Code 03, "Read Output Registers". Up to 125 registers can be obtained by one request.

For a complete list of the registers, see the tables at the end of this document.

Example: Function Code 3

Query:

RTU

FUNCTION

START

START

 

#

OF REGS

#

OF REGS

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

03H

02H

34H

 

00H

 

02H

84H 7DH

Response:

RTU

FUNCTION

BYTE COUNT

RETURNING

 

CRC

 

ADDRESS

CODE

DATA

 

01H

03H

04H

00

01 00 00

ABH F3H

READ INPUT REGISTERS (FUNCTION CODE 04)

Analog inputs are read via Function Code 04, "Read Input Registers". These registers locations receive their values from devices connected to the I/O channels available to the GCS controller and can only be read, not altered directly within the controller or via Modbus protocol. The GCS controller allows up to 125 registers to be obtained by one request. For a complete list of the registers, see the tables at the end of this document.

Example: Function Code 4

Query:

RTU

FUNCTION

START

START

#

OF REGS

#

OF REGS

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

 

01H

04H

01H

30H

00H

06H

 

71H FBH

Response:

RTU

FUNCTION

BYTE COUNT

RETURNING DATA

 

CRC

 

ADDRESS

CODE

 

01H

04H

0CH

00

00 00 00 00 00 00 00 00 00 00 00

95H B7H

FORCE SINGLE COIL (FUNCTION CODE 05)

Individual digital outputs (coils) are modified by the Modbus host via Function Code 05, "Force Single Coil". The GCS controller has only three physical digital outputs onboard (relay contacts) but many virtual digital outputs that are used to control various processes in the controller. Expansion I/O modules can be connected to a GCS control unit thereby increasing the available physical digital outputs (relay contacts)

Example: Function Code 5

Query:

RTU

FUNCTION

COIL ADDR

COIL ADDR

DATA ON/OFF

DATA

CRC

ADDRESS

CODE

HIGH

LOW

01H

05H

02H

00H

FFH

00H

8DH 82H

Response:

RTU

FUNCTION

COIL ADDR

COIL ADDR

DATA ON/OFF

DATA

CRC

ADDRESS

CODE

HIGH

LOW

01H

05H

02H

00H

FFH

00H

8DH 82H

PRESET SINGLE REGISTER (FUNCTION CODE 06)

 

Individual output registers are modified by the host via Function Code 06, "Preset Single Register".

 

For a complete list of the registers, see the tables at the end of this document.

 

Example: Function Code 6

 

Query:

RTU

FUNCTION

REG. ADDR

REG. ADDR

DATA VALUE

 

DATA VALUE

CRC

ADDRESS

CODE

HIGH

LOW

HIGH

LOW

01H

06H

02H

34H

00H

 

00H

C9H BCH

Response:

RTU

FUNCTION

COIL ADDR

COIL ADDR

DATA ON/OFF

DATA

CRC

ADDRESS

CODE

HIGH

LOW

01H

06H

02H

03H

00H

50H

78H 4EH

WRITE MULTIPLE COILS (FUNCTION CODE 15)

Multiple digital outputs are modified by the host in a single message via Function Code 15, "Write Multiple Coils". The GCS controller has only three physical digital outputs (relay contacts) but many virtual digital outputs that are used to control various processes in the controller. Additional digital outputs can be added to a GCS system by using Expansion I/O modules. For a complete list of the output status points, see the tables at the end of this document.

Example: Function Code 15

Query:

RTU

FUNCTION

FIRST

FIRST

# OF

# OF

BYTE

DATA

CRC

ADDRESS

CODE

COIL

COIL

COILS

COILS

COUNT

@

ADDR

ADDR

HIGH

HIGH

COIL

HIGH

LOW

202H

01H

0FH

02H

02H

00H

01H

01H

00H

56H B5H

Response:

RTU

FUNCTION

FIRST COIL

FIRST COIL

# OF COILS HIGH

# OF COILS HIGH

 

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

01H

0FH

02H

02H

 

00H

01H

34H 73H

WRITE MULTIPLE OUTPUT REGISTERS (FUNCTION CODE 16)

Multiple output registers are modified by the host via Function Code 16, "Write Multiple Output Registers". For a complete list of the registers, see the tables at the end of this document.

Example: Function Code 16

Query:

RTU

FUNCTION

START

START

#

OF

#

OF

BYTE

DATA

CRC

ADDRESS

CODE

ADDR

ADDR

REGS

REGS

COUNT

HIGH

LOW

HIGH

LOW

01H

10H

02H

20H

00H

01H

02H

00H 22H

F0H 78H

Response:

RTU

FUNCTION

START

START

#

OF

#

OF

CRC

 

ADDRESS

CODE

ADDR

ADDR

REGS

REGS

HIGH

LOW

HIGH

LOW

01H

10H

02H

20H

00H

01H

01H BBH

GCS support of user Modbus function code 65

Modicon’s modbus protocol states that Modbus function codes 65 through 72 inclusive will be reserved for user functions and will not be used by any Modicon products. GCS system controllers use function code 65 to enable the transfer of:

Shutdown history records. Startup current waveform records. Event records. Ampchart records.

In the following documentation, the following data type definitions apply:

unsigned char

8 bits, 0 to 255

signed char

8 bits, -128 to +127

unsigned short 16 bits, 0 to 65535

signed short

16 bits, -32768 to + 32767

Pvalue

signed short, 16 bits, -32768 to + 32767

PointId

signed short, 16 bits, -32768 to + 32767

Time

unsigned 32 bits, 0 to 4294967295

When retrieving information from a GCS unit using function code 65, the query will always adhere to the following form:

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

00H

00H

00H

3DH C5H

Where:

rtuAddress is the modbus address of the GCS unit being queried functionCode is always 65 (41 HEX) startingAddress is:

0: to retrieve shutdown history records. 1: to retrieve startup current waveform records. 2: to retrieve event records. 3: to retrieve ampchart data (with 4 minute average plus 4 minute minimum & maximum readings.) 6: to retrieve ampchart data (with 4 minute average plus 4 x 1 minute minimum & maximum readings.)

pointCount is 0 if the packet marks the first packet of an exchange and is 1 if the packet is the continuation of the exchange.

The first four bytes of the GCS’s response will always be the RTU address, the function code and a block count. The block count will be positive as long there is un-transferred data within the GCS unit. To signal the last packet, the block count (signed short integer) goes negative. The negative number is to be interpreted as ( –1 * (the number of records within the packet)). For example, if the block count was returned as FFEC hex, convert that value into the decimal equivalent as follows:

FFEC = 65,516 ------ 0x10000= 65,536 ------ 65,516 – 65536 = -20 ------ -20 * -1 = 20 records

The following describes the data dependant responses by the GCS controller to Modbus 65 packets.

SHUTDOWN HISTORY

Shutdown history data is transferred in a packet formatted as:

typedef struct

{

unsigned char rtuAddress; unsigned char functionCode; signed short blockCount; shutDownHistory data[HISTORY_RECORDS_PER_PACKET]; unsigned short crc; }aHistoryResponse;

where, HISTORY_RECORDS_PER_PACKET is 10 .

The structures data, of type shutDownHistory is organized as:

typedef struct historyTag

{

time_t timeStamp; PValue ampsA; PValue ampsB; PValue ampsC; PValue voltAB; PValue voltBC; PValue voltCA; PValue analogIn1; PValue analogIn2; PointId causeOfShutdown; PointId lockout; }shutDownHistory;

where,

ampsA, ampsB and ampsC are the three phase current at the time of the decision to shutdown. VoltAB, voltBC and voltCA are the phase to phase voltage at the time of the decision to shutdown. AnalogIn1 and analogIn2 are the value at the analog inputs of the GCS system controller. CauseOfShutdown is a number indicating why the shutdown happened. Lockout is a number indicating if the motor start was locked out because of the shutdown.

Note: The CauseOfShutdown and Lockout numbers are defined in Table 5.

The timeStamp is a signed 32bit integer that holds the number of seconds since January 1, 1970 and can be de-coded using the library routines supplied with most C compilers.

Example - Function Code 65 (Read Shutdown History Records)

Query:

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

00H

00H

00H

3DH C5H

Response: (only part of the response is shown)

RTU Address

Function Code

Block Count

(high)

Block Count

(Low)

Start of Shutdown

History record #1

Shutdown History

(time STamp)

Shutdown History

(time STamp)

Shutdown History

(time STamp)

Shutdown History

(time STamp)

Amps Phase A

(high)

Amps Phase A

(low)

amps Phase b

(high)

amps Phase b

(low)

01H

41H

00H

0AH

 

3EH

A6H

65H

2DH

00H

4FH

00H

4EH

Amps Phase c (high)

amps Phase c (low)

Voltage phase Ab

(high)

Voltage phase Ab

(low)

Voltage phase bc

(high)

Voltage phase bc

(low)

Voltage phase ca

(high)

Voltage phase ca (low)

Analog input #1 (high)

Analog input #1 (low)

Analog input #2 (high)

Analog input #2 (low)

Cause of shutdown

(point-id--high)

00H

50H

01H

E1H

01H

E4H

01H

E3H

04H

7EH

01H

2CH

00H

Cause of shutdown

(point-id--low)

Cause of lockout

(point-id--high)

Cause of lockout

(point-id low)

Start of Shutdown

History record #2

Shutdown History

(time STamp)

Shutdown History

(time STamp)

Shutdown History

(time STamp)

Shutdown History

(time STamp)

Amps Phase A

(high)

Etcetera…

AFH

00H

ADH

 

3EH

2FH

DDH

74H

00H

Convert the hexadecimal values into decimal notation and history record #1 in the above example yields the following information:

Shutdown occurred on April 23, 2003 at the time of 10:04:29. (Time integer value: 3E A6 65 2D hex.)

The three phase currents were: Phase A = 79 amps (004F hex) Phase B = 78 amps (004E hex) Phase C = 80 amps (0050 hex)

The three phase volts were:

Analog input #1’s value was:

Analog input #2’s value was:

The cause of shutdown was:

The cause of lockout was:

Phase AB = 481 volts AC (01E1 hex) Phase BC = 484 volts AC (01E4 hex) Phase CA = 483 volts AC (01E3 hex)

1150 (047E hex)

300

(012C hex)

Overload (point ID # 175) (00AF hex) Overload Lockout (point ID # 173) (00AD hex).

STARTUP WAVEFORM

Startup waveform data consists of the three motor currents and voltages sampled at 600 readings per second for 2 seconds after the start of the motor.

The response packet composition for this data is:

typedef struct

{

unsigned char rtuAddress; unsigned char functionCode; signed short blockCount; highSpeedTrend data[TREND_RECORDS_PER_PACKET]; unsigned short crc; }aStartupWaveformResponse;

where TREND_RECORDS_PER_PACKET is 20

The structures data, of type highSpeedTrend is organized as:

typedef struct HSTrend

{

PValue ampsA; PValue ampsB; PValue ampsC; PValue voltAB; PValue voltBC; PValue voltCA; }highSpeedTrend;

where,

ampsA, ampsB and ampsC are the instantaneous values of the three phase currents and VoltAB, voltBC and voltCA are the phase to phase voltage at the time of the sample.

To fetch the time at which the motor was started, build a request packet with its startingAddress field set to 1 and its pointCount set to –1. The GCS units will return a packet formatted as

typedef struct

{

unsigned char rtuAddress; unsigned char functionCode; signed short blockCount; time_t timeStamp; unsigned short crc; }aStartupTimestampResponse;

Example - Function Code 65 (Startup Waveform Records)

First, send a message with a point count of -1 (FFFE hex), to retrieve the “start time” of the last motor start.

Query:

RTU

FUNCTION

 

START

 

START

     

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

 

ADDR HIGH

 

ADDR LOW

HIGH

 

LOW

 

01H

41H

   

00H

 

01H

     

FFH

 

FEH

 

ACH 75H

Response: (Last motor start time stamp)

 

RTU Address

Function Code

Block Count

(high)

Block Count

(Low)

Time of last motor

start attempt

Last Motor start

(time STamp)

Last Motor start

(time STamp)

Last Motor start

(time STamp)

 

Last Motor start

(time STamp)

CRC

(high)

CRC

(low)

 

01H

41H

00H

01H

   

3EH

 

64H

BEH

 

86H

51H

36H

The time integer “3E64BE86” converts to March 4, 2003 at 14:56:06.

 

Query: Next, retrieve the first 20 of 1200 samples by using function code 65.

 

RTU

FUNCTION

 

START

 

START

     

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

 

ADDR HIGH

 

ADDR LOW

HIGH

 

LOW

 

01H

41H

   

00H

 

01H

     

00H

 

00H

 

6CH 05H

Response: (only part of the response is shown)

RTU Address

Function Code

Block Count

(high)

Block Count

(Low)

Start of High Speed

Trend packet #1

Current Phase A

(high)

Current Phase A

(low)

Current Phase B

(high)

Current Phase B

(low)

Current Phase C

(high)

Current Phase C

(low)

Voltage Phase AB

(high)

Voltage Phase AB

(low)

01H

41H

00H

14H

 

00H

08H

00H

10H

FFH

EBH

01H

15H

Voltage Phase BC

(high)

Voltage Phase BC

(low)

Voltage Phase CA

(high)

Voltage Phase CA

(low)

Start of High Speed

Trend packet #2

Current Phase A

(high)

Current Phase A

(low)

Current Phase B

(high)

Current Phase B

(low)

Current Phase C

(high)

Current Phase C

(low)

Voltage Phase AB

(high)

Voltage Phase AB

(low)

FEH

CDH

00H

1EH

 

00H

00H

FFH

F0H

00H

10H

00H

69H

Voltage Phase BC

(high)

Voltage Phase BC

(low)

Voltage Phase CA

(high)

Voltage Phase CA

(low)

Start of High Speed

Trend packet #3

Current Phase A

(high)

Current Phase A

(low)

Etcetera…

FEH

BFH

00H

D8H

 

FFH

F0H

Query: Now retrieve the remaining data by setting the point count to 0001 and repeat the request for data until the block count value in the response switches to a negative number as shown below.

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

01H

00H

01H

ADH C5H

Response: (only part of the response is shown)

RTU Address

Function Code

Block Count

(high)

Block Count

(Low)

Start of High Speed

Trend packet

Current Phase A

(high)

Current Phase A

(low)

Current Phase B

(high)

Current Phase B

(low)

Current Phase C

(high)

Current Phase C

(low)

Voltage Phase AB

(high)

Voltage Phase AB

(low)

Etcetera…

01H

41H

FFH

ECH

 

00H

73H

FFH

59H

00H

35H

FFH

B9H

As illustrated in the example above, the GCS responded with a block count of FFEC hex or -19 decimal. This indicates that there are no more un-retrieved waveforms packets and that this message contains the normal 20 records

The instantaneous values of the current and voltage can be graphed by using common PC software such as MS Excel spreadsheet.

EVENTS

Event data is transferred in a packet formatted as:

typedef struct

{

unsigned char rtuAddress; unsigned char functionCode; signed short blockCount; anEventRecord eventRecord[EVENT_RECORDS_PER_PACKET]; unsigned short crc; }anEventRecordResponse;

where, EVENT_RECORDS_PER_PACKET is 20

The structures data of type anEventRecord are organized as:

typedef struct

{

time_t timeStamp; unsigned char EventType; unsigned char Exponent; PointId PointIdent; PValue ValueBeforeEvent; PValue ValueAfterEvent; }anEventRecord;

where, the field EventType is a numeric that identifies the event. Exponent is a number used to locate the decimal point when displaying the before and after values. PointIdent is a number describing an entity associated with the event. ValueBeforeEvent is the entities’ value before it was changed. ValueAfterEvent is the entities’ value after it was changed.

Note: The event type numbers are defined in Table 6.

Query: Retrieve the first packet of event history by setting the point count to 0000H.

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

02H

00H

00H

9CH 05H

Response: (First packet of event history, only the first portion of the reply is shown)

RTU Address

Function Code

Block Count (high)

Block Count (Low)

Start of Event #1

Event Occurrence

(time STamp)

Event Occurrence (time STamp)

Event Occurrence (time STamp)

Event Occurrence (time STamp)

Event Type

Exponent

Point ID (high)

Point ID (low)

Value before event

Value after event

Start of Event #2

Event Occurrence

(time STamp)

01H

41H

00H

14H

 

3EH

A6H

7AH

4FH

02H

00H

00H

A7H

0H

0H

 

……

The time integer “3EA67A4F” converts to April 23, 2003 at 11:34:39 am. The Event type is reported as a “02” which is defined as an “Alarm return to normal” or Alarm_RTN The exponent is reported as a “00” which means there is no decimal point in the value. The Event Point Identifier is reported as 00A7 or 167 decimal. Table 5 lists Point ID 167 as being Overload Alarm. Since this event had no data values associated with it, the before and after values are left at zero.

Query: Continue to retrieve the next 20 event records by setting the point count to 0001H, until the block count in the reply turns negative as shown in the example below.

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

02H

00H

01H

5DH C5H

Response: (Last packet of event history, only part of the reply is shown)

RTU Address

Function Code

Block Count (high)

Block Count (Low)

Start of Event #1

Event Occurrence

(time STamp)

Event Occurrence (time STamp)

Event Occurrence (time STamp)

Event Occurrence (time STamp)

Event Type

Exponent

Point ID (high)

Point ID (low)

Value before event

Value after event

Start of Event #2

01H

41H

FFH

F1H

 

3EH

A6H

63H

9EH

03H

00H

00H

5BH

00H

02H

 

The reply illustrated above shows a block count of FFF1H (-15 decimal). That means there are no more event records to be retrieved and that this packet does contain 15 event records.

AMPCHARTING

The GCS motor controllers record the motor current present of Phase B of the power system. This current data is sampled at high speeds and converted to RMS values. The high speed values are averaged over a four minute period and the minimum and maximum values are recorded in each 1 minute portion of the four minute period. There are two tables of amp chart data that are available via the function code 65. The first, accessed with a starting address of 3 in the function code 65 query is comprised of four minute packets containing the minimum, maximum and average current during each time period. The second table, access with a starting address of 6, is comprised of a single four minute average and four one minute minimum and maximum values. The second table contains more data and is correspondingly longer. The following will describe the two methods separately.

Ampchart: Four minute average, minimum and maximum values

The ampchart data consisting of four minute averages and minimum / maximum values is accessed using a starting address of 3, within a Function Code 65 query.

This Ampchart data is transferred in packets formatted as:

typedef struct

{

unsigned char rtuAddress; unsigned char functionCode; signed short blockCount; aFourMinuteAmpchartRecord data[FOUR_MINUTE_AC_RECORDS_PER_PACKET]; unsigned short crc; }anAmpchartRecordResponse;

where, FOUR_MINUTE_AC_RECORDS_PER_PACKET is 24.

The structures data, of type aOneMinuteAmpchartRecord, are organized

typedef struct

{

time_t timeStamp; PValue average; PValue minimum; PValue maximum; }aFourMinuteAmpchartRecord;

the field of this structure are defined as:

timeStamp is the time of the current recording Average is the average of the current over a four minute period. Minimum and Maximum are the lowest and high currents measured during the four minute period.

Query: Retrieve the first packet of four minute ampchart records by setting the point count to 0000H.

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

03H

00H

00H

5DH C5H

Response:

(Only the first portion is shown)

RTU Address

Function Code

Block Count (high)

Block Count (Low)

Start of Record #1

Amp Chart recorded

(time STamp)

(time STamp)

(time STamp)

(time STamp)

Average (high)

Average (Low)

Minimum (High)

Minimum (low)

Maximum (High)

Maximum (Low)

01H

41H

00H

18H

 

3EH

A6H

9FH

ACH

00H

16H

00H

15H

00H

17H

Start of Record #2

Amp Chart recorded

(Time Stamp)

Amp Chart recorded (Time Stamp)

Amp Chart recorded (Time Stamp)

Amp Chart recorded

(Time Stamp)

Average (high)

Average (Low)

Minimum (High)

Minimum (low)

Maximum (High)

Maximum (Low)

Start of Record #3

Amp Chart recorded (Time Stamp)

Amp Chart recorded (Time Stamp)

Amp Chart recorded (Time Stamp)

 

3EH

A6H

A0H

9CH

00H

18H

00H

17H

00H

19H

 

3EH

A6H

……

In the example response above:

The block count 0018H indicates that 24 ampchart records are contained in this packet.

Record #1 reports a time stamp of 3EA69FAC Hex or 2003/04/23 14:14:04 The average current during the four minute period was 0016Hex = 22 amps (decimal) The minimum current value was 0015Hex = 21 amps (decimal) The maximum current value was 0017Hex = 23 amps (decimal)

Record #2 reports a time stamp of 3EA6A09C Hex or 2003/04/23 14:18:04 The average current during the four minute period was 0018Hex = 24 amps (decimal) The minimum current value was 0017Hex = 23 amps (decimal) The maximum current value was 0019Hex = 25 amps (decimal)

Ampchart: Four minute average, plus one minute minimum and maximum values

The ampchart data consisting of a four minute average and four, one minute minimum / maximum values is accessed using a starting address of 6, within a Function Code 65 query.

This Ampchart data is transferred in packets formatted as:

typedef struct

{

unsigned char rtuAddress; unsigned char functionCode; signed short blockCount; aOneMinuteAmpchartRecord data[ONE_MINUTE_AC_RECORDS_PER_PACKET]; unsigned short crc; }anAmpchartRecordResponse;

where, ONE_MINUTE_AC_RECORDS_PER_PACKET is 11.

The structures data, of type aOneMinuteAmpchartRecord, are organized typedef struct

{

time_t timeStamp; PValue average; anAmpChartReadingRecord oneMinuteReadings[ONE_MINUTE_READINGS_PER_RECORD]; }aOneMinuteAmpchartRecord;

where, ONE_MINUTE_READINGS_PER_RECORD is 4

the fields in this structure are defined as:

timeStamp is the time of the most recent reading. This field is updated every minute. Average is the average of the current over a four minute period.

the structures: oneMinuteReadings, of type anAmpChartReadingRecord, are organized as

typedef struct

{

PValue minimum; PValue maximum; }anAmpChartReadingRecord;

where minumum and maximum are the extremes of phase B current in amps measured during the one minute period.

Query: The first message requesting ampchart data must have a point count value of zero, as shown below.

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

06H

00H

00H

DDH C4H

Response: (only part of the response is shown)

RTU Address

Function Code

Block Count (high)

Block Count (Low)

Start of Ampchart

#1

Ampchart recorded

(Time Stamp)

Ampchart recorded

(Time Stamp)

Ampchart recorded

(Time Stamp)

Ampchart recorded

(Time Stamp)

Average (high)

Average (low)

Minimum1 st minute

 

Minimum 1 st minute

 

Maximum 1 st minute

 

Maximum 1 st minute (low)

record

(high)

(low)

(high)

01H

41H

00H

0BH

 

3EH

A6H

9FH

ACH

00H

16H

00H

15H

00H

17H

Minimum 2 nd minute

 

Minimum 2 nd minute

 

Maximum 2 nd minute

 

Maximum 2 nd minute

 

Minimum 3 rd minute

 

Minimum 3 rd minute

 

Maximum 3 rd minute

 

Maximum 3 rd minute

 

Minimum 4 th minute

 

Minimum 4 th minute

 

Maximum 4 th minute

 

Maximum 4 th minute

 

Start of Ampchart

#2

Ampchart recorded

(Time Stamp)

(high)

(low)

(high)

(low)

(high)

(low)

(high)

(low)

(high)

(low)

(high)

(low)

record

00H

15H

00H

17H

00H

15H

00H

17H

00H

15H

00H

17H

 

….

In the example response above:

The block count 000BH indicates that 11 ampchart records are contained in this packet.

Record #1 reports a time stamp of 3EA69FAC Hex or 2003/04/23 14:14:04 The average current during the four minute period was 0016Hex = 22 amps (decimal) The minimum current value during all four one minute sample periods was 0015Hex = 21 amps The maximum current value during all four one minute sample periods was 0017Hex = 23 amps )

After using a point count of 0000H to initiate the transfer of the ampchart records, use a point count of 0001 for all subsequent queries until the block count value is returned as a negative value. As in all function code 65 transfers, a negative block count indicates that the response contains the final records to be transferred and the negative value multiplied by negative 1 represents the number of records in this message. An example is shown below:

Query: The point count is set to one to continue the transfer of ampchart records.

RTU

FUNCTION

START

START

POINT COUNT

POINT COUNT

CRC

ADDRESS

CODE

ADDR HIGH

ADDR LOW

HIGH

LOW

01H

41H

00H

06H

00H

01H

DDH C4H

Response: (only part of the response is shown)

RTU Address

Function Code

Block Count (high)

Block Count (Low)

Start of Ampchart

#1

Ampchart recorded

(Time Stamp)

Ampchart recorded

(Time Stamp)

Ampchart recorded

(Time Stamp)

Ampchart recorded

(Time Stamp)

Average (high)

Average (low)

Minimum1 st minute

 

Minimum 1 st minute

 

Maximum 1 st minute

 

Maximum 1 st minute (low)

record

(high)

(low)

(high)

01H

41H

FFH

FEH

 

3EH

A9H

5DH

A3H

00H

06H

00H

06H

00H

06H

Minimum 2 nd minute

 

Minimum 2 nd minute

 

Maximum 2 nd minute

 

Maximum 2 nd minute

 

Minimum 3 rd minute

 

Minimum 3 rd minute

 

Maximum 3 rd minute

 

Maximum 3 rd minute

 

Minimum 4 th minute

 

Minimum 4 th minute

 

Maximum 4 th minute

 

Maximum 4 th minute

 

Start of Ampchart

#2

Ampchart recorded

(Time Stamp)

(high)

(low)

(high)

(low)

(high)

(low)

(high)

(low)

(high)

(low)

(high)

(low)

record

00H

06H

00H

06H

00H

06H

00H

06H

00H

06H

00H

06H

 

….

In the example response above:

The block count FFFEH indicates that this response contains the last un-transferred records of the ampchart and that a total of 2 records are contained in this packet. (10000H – FFFEH) = 2

Record #1 reports a time stamp of 3EA95DA3 Hex or 2003/04/25 16:09:07 The average current during the four minute period was 0006Hex = 06 amps (decimal) The minimum current value during all four one minute sample periods was 0006Hex = 06 amps The maximum current value during all four one minute sample periods was 0006Hex = 06 amps )

ERROR / EXCEPTION RESPONSE

When an error or exception occurs within the GCS controller in response to a host request, it sends a response message to the host consisting of the slave address, an error response code, the function code with the high order bit set to one, an exception response code and the CRC error detection word. The following tables list the error response function code and the exception response code.

ERROR RESPONSE FUNCTION CODE

Function Code

ERROR RESPONSE FUNCTION CODE

02

82

03

83

04

84

05

85

06

86

0F

8F

10

90

EXCEPTION RESPONSE CODE

EXCEPTION RESPONSE CODE

NAME

DESCRIPTION

01

Illegal Function

The requested function is not supported

02

Illegal Data Address

The request contains an out of range data address

03

Illegal Data Value

The request contains out of range data values

Output Frequency Control via Modbus

The Electrospeed GCS is a variable frequency controller and as listed below, has three methods of controlling its output frequency.

Keypad Frequency Setpoint In this method of speed control, the user enters a desired output frequency, and the drive will ramp its output up or down in frequency to achieve the setpoint.

Analog Follower Frequency control In this method of speed control, the GCS drive is provided with an analog signal to one of its analog inputs. The drive reads the present value of this signal and retrieves the zero and span values associated with that input. The present value of the analog signal is converted into a percentage of full scale value by the following function:

Percentage of full scale = (Present Value of input / full scale value of input) * 100

Next the GCS drive's High Speed clamp and Low Speed clamp settings are determined. The Low Speed clamp is designated as 0 % speed, while the High Speed Clamp is designated as 100% speed. The controller then calculates the actual frequency value that corresponds to the percentage of full scale and uses that value as the desired output frequency. Additionally, the drive can be set to react in forward or reverse. In forward acting, as the analog setpoint signal is increased, the drive frequency increases. In reverse acting, as the analog setpoint is increased, the drive frequency decreases.

Proportional, Integral, Derivative (PID) Frequency Control In this method of speed control, the GCS drive is provided with a setpoint signal and a feedback signal. Using the industry standard PID control algorithm, the drive will increase or decrease its output frequency in order to cause the feedback signal to equal the setpoint signal. In this control method, the setpoint signal can be a manually entered value or a varying analog signal. The feedback signal must be analog signal. In this control mode, the drive can also be set to forward or reverse acting as described in the previous Type 2. To calibrate or tune the drive's reactions to varying input signals, the user can enter gain factors for each of the proportional, integral and derivative terms of the PID algorithm.

Modbus access to the speed control parameters:

The GCS drives provide support for Modbus RTU protocol. Using this communication capability, the user can modify the variables using the following modbus address registers.

Control Type: Modbus Address 40811 (0x032A)

Keypad Frequency Setpoint Analog Followermode PID Control mode

= Modbus Address 40811 = 1 = Modbus Address 40811 = 2 = Modbus Address 40811 = 3

KEYPAD FREQUENCY MODE

If Keypad Frequency Setpoint is selected, (Modbus Address 40811 = 1), the user can set the frequency by writing 10 times the desired value (in decimal) to Modbus address: 40784 (0x030F).

For example:

to set the frequency to 59.5 Hz, write the value of 595 to address 40784 to set the frequency to 22.9 Hz, write the value of 229 to address 40784

ANALOG FOLLOWER MODE

If Analog Follower Mode is selected, (Modbus Address 40811 = 2), the user can configure which analog input is used as the setpoint and whether the controller is forward or reverse acting.

Setpoint input for Analog Follower mode is located at Modbus address 40761 (0x02F8). This setpoint can accept the following decimal values:

OnBoard Analog Input #1:

42

(Modbus address 40761 =

42 decimal)

OnBoard Analog Input #2:

67

(Modbus address 40761 =

67 decimal)

Expansion I/O Module 1, Analog Input #1:

1213

(Modbus address 40761 =

1213 decimal)

Expansion I/O Module 1, Analog Input #2:

1214

(Modbus address 40761 =

1214 decimal)

Expansion I/O Module 2, Analog Input #1:

1215

(Modbus address 40761 =

1215 decimal)

Expansion I/O Module 2, Analog Input #2:

1216

(Modbus address 40761 =

1216 decimal)

Expansion I/O Module 3, Analog Input #1:

1217

(Modbus address 40761 =

1217 decimal)

Expansion I/O Module 3, Analog Input #2:

1218

(Modbus address 40761 =

1218 decimal)

Trident Channel #1:

770

(Modbus address 40761 =

770 decimal)

Trident Channel #2:

771

(Modbus address 40761 =

771 decimal)

Trident Channel #3:

772

(Modbus address 40761 =

772 decimal)

Trident Channel #4:

773

(Modbus address 40761 =

773 decimal)

Trident Channel #5:

774

(Modbus address 40761 =

774 decimal)

Trident Channel #6:

775

(Modbus address 40761 =

775 decimal)

Trident Channel #7:

842

(Modbus address 40761 =

842 decimal)

Trident Channel #8:

843

(Modbus address 40761 =

843 decimal)

Controller direction:

The controller is set to be forward acting by writing Modbus Address 45822 (0x16BD) = 0 The controller is set to be reverse acting by writing Modbus Address 45822 (0x16BD) = 1

PID CONTROL MODE

If PID Control mode is selected, (Modbus Address 40811 = 3), the user can configure which analog input is used as the setpoint, which analog input is used as the feedback, the values of proportional, integral and derivative gains and whether the controller is forward or reverse acting.

Setpoint input for PID Control mode is located at Modbus address 40762 (0x02F9). This setpoint can accept the following decimal values:

OnBoard Analog Input #1:

42