Sending serial commands and data – Omega Vehicle Security PTC900 User Manual

Page 22

Advertising
background image

22

SENDING SERIAL COMMANDS AND DATA

When sending commands to the meter, a string containing at least one

command character must be constructed. A command string consists of a
command character, a value identifier, numerical data (if writing data to the
meter) followed by the command terminator character * or $.

Command Chart

Command String Construction

The command string must be constructed in a specific sequence. The meter

does not respond with an error message to invalid commands. The following
procedure details construction of a command string:

1. The first characters consist of the Node Address Specifier (N) followed by a

1 or 2 character address number. The address number of the meter is
programmable. If the node address is 0, this command and the node address
itself may be omitted. The address suffix , “?” is the global broadcast address
specifier. A command string that is sent with N? prefix will be accepted by
all PAXCKs on the RS485 network (software code version 2.3 or greater).
This is useful for setting all meters to the current time, date or day that may
have unique meter addresses on a bus. It is important not to send (P)rint or
(T)ransmit commands using N? prefix, as it will result in multiple meters
responding at the same time. This is the only command that may be used in
conjunction with other commands.

2. After the optional address specifier, the next character is the command

character.

3. The next character is the Register ID. This identifies the register that the

command affects. The P command does not require a Register ID character.
It prints according to the selections made in print the options. If constructing
a value change command (writing data), the numeric data is sent next.

4. All command strings must be terminated with the string termination

characters * or $. The meter does not begin processing the command string
until this character is received. See Timing Diagram figure for differences
between terminating characters.

Note: On a change value command (V), if the command string is terminated

with the * character, all values are stored in E

2

PROM memory. Values are

not stored if the $ terminator is used.

Register Identification Chart

1. Register Names are also used as Register Mnemonics during full transmission.
2. The registers associated with the P command are set up in Print Options (Module 7).
3. Unless otherwise specified, the Transmit Details apply to both T and V

Commands.

Command String Examples:

1. Address = 17, Write 350 to Setpoint 1

String: N17VE350$

2. Address = 5, Cycle Counter value, response time of 50 to 100 msec. min.

String: N05TB*

3. Address = 0, Reset Timer value

String: RA*

Transmitting Data To the Meter

Numeric data sent to the meter must be limited to Transmit Details listed in the

Register Identification Chart. Leading zeros are ignored. The meter ignores any
decimal point and conforms the number to the scaled resolution. (ie. The meter’s
scaled decimal point position is set for 0.0 and 25 is written to a register. The value
of the register is now 2.5. In this case, write a value of 250 to equal 25.0).

For RTC Time [C] and Date [D] Value:

Time - 24 Hours, Minutes, Seconds (HHMMSS)

Ex: 083000 = 8:30 AM, 144500 = 2:45 PM

Date - Month, Day, Year (mmddyy)

Ex: 123101 = December 31, 2001

Day - 1 = Sunday through 7 = Saturday

EX: 3 = Tuesday

Notes:

1. Since the meter does not issue a reply to value change commands, follow

with a transmit value command for readback verification.

2. The date and day must be set separately.

Transmitting Data From the Meter

Data is transmitted from the meter in response to either a transmit command

(T), a print block command (P) or User Function print request. The response
from the meter is either a full field transmission or an abbreviated transmission.
The meter response is established in Module 7.

Full Transmission

(

=

)

These characters only appear in the last line of a block print.

The first two characters transmitted are the unit address. If the address

assigned is 0, two spaces are substituted. A space follows the unit address field.
The next three characters are the register mnemonic.

The numeric data is transmitted next. The numeric field is 12 characters long

(decimal points are loaded depending on timer range selected). The data is right-
aligned with leading spaces for any unfilled positions.

The end of the response string is terminated with <CR> and <LF>. When a

block print is finished, an extra <SP>, <CR>, and <LF> are used to provide
separation between the transmissions.

<LF> (Line feed)

23

<CR> (Carriage return)

22

<SP> (Space)

21

<LF> (Line feed)

20

3 byte Register Mnemonic field

4-6

<SP> (Space)

3

12 byte numeric data field: 6 bytes for number, up to 3 for decimal points.

7-18

2 byte Node (Meter) Address field [00-99]

1, 2

<CR> (Carriage return)

19

DESCRIPTION

BYTE

COMMAND DESCRIPTION

NOTES

N

Node (Meter) Address
Specifier

Address a specific meter. Must be followed by
node address. Not required when address = 00.

T

Transmit Value (read)

Read a register from the meter. Must be
followed by register ID character.

V

Value change (write)

Write to register of the meter. Must be followed
by register ID character and numeric data.

R

Reset

Reset a register or output. Must be followed
by register ID character

P

Block Print Request
(read)

Initiates a block print output. Registers are
defined in programming.

ID

VALUE DESCRIPTION

REGISTER

NAME

1

COMMAND

2

A

Timer Value

TMR

6 digit

B

Cycle Counter Value

CNT

6 digit

C

RTC Time Value

TIM

6 digit

D

RTC Date Value

DAT

6 digit

E

Setpoint 1

SP1

6 digit

F

Setpoint 2

SP2

6 digit

G

Setpoint 3

SP3

6 digit

H Setpoint 4

SP4

6 digit

I

Setpoint 1 Off Value

SO1

6 digit

J

Setpoint 2 Off Value

SO2

5 digit

T, V, R

TRANSMIT DETAILS

3

T, V, R
T, V
T, V
T, V, R
T, V, R
T, V, R
T, V, R
T, V
T, V

K

Setpoint 3 Off Value

SO3

6 digit

L

Setpoint 4 Off Value

SO4

6 digit

M Timer Start Value

TST

6 digit

O

Cycle Counter Start Value

CST

6 digit

Q

Timer Stop Value

TSP

6 digit

S

Cycle Counter Stop Value

CSP

6 digit

U

Auto/Man Register

MMR

0 - auto, 1 - manual

W Day of Week Value

DAY

1 = Sun....7 = Sat

X

Setpoint Register

SOR

0 - not active, 1 - active

T, V
T, V
T, V
T, V
T, V
T, V
T, V
T, V
T, V

Advertising