3 controlling the matrix from the pc – Videotec SM328B User Manual

Page 30

Advertising
background image

4.3 Controlling the matrix from the PC

4.3.1

Macro Protocol

4.3.1.1

Description

The Macro protocol is characterised by messages consisting only of printable ASCII characters, delimited
by two terminator characters ‘[‘ and ‘]’. Upper and lower case letters are differentiated within the message.
Parameters are usually numerical and separated by commas. There are no spaces (blanks) inside a

macro command.

A typical message format could be a string of characters [VA0PC1VidS1,12Z], which would be
interpreted as follows:

Characters

Meaning

Meaning in the example

[

Start of message

VA

Type of receiver

Addressee: video matrix...

0

Receiver number

1

...number 0 (single matrix)

PC

Type of transmitter

Sender: personal computer...

1

Transmitter number

1

...number 1 (dummy)

VidS

Command

Switch...

1

First parameter

2

...on monitor 1...

,

Parameter separator

12

Second parameter

2

...request for camera 12

Z

Checksum

]

End of message

1

)A receiver/transmitter ID-number should be given even when unnecessary: if it is not available (for a

single matrix, for example) use number 0. For the PC use number 1.

2

)Depending on the command there are up to 4 numeric parameters (from 0 to 65535) separated by

commas. An ASCII character should be transmitted for each digit (0: ASCII 48, 1: ASCII 49, etc.)

4.3.1.2

Control from the PC

The personal computer is only able to control the matrix if dip 5 is ON.

If dip 5 is OFF the PC is only able to receive data and cannot transmit commands.

4.3.1.3

Calculating the checksum

1. Sum the ASCII codes for all characters in the message, except for the terminators‘[‘ and ‘]’

2. Calculate the value of the sum MOD 26 (the remainder after division by 26, an integer from 0 to 25)

3. Add 65 to the result of the MOD calculation and find the corresponding letter in the ASCII table: the

result should by an upper case letter between ‘A’ and ‘Z’.

The matrix will only interpret the message if the checksum is correct.

NOTE

Videotec products recognise a certain number of different protocols and baud rates: make sure the setting actually

corresponds to the Macro protocol (at a suitable baud rate) before continuing with the connection.

4.3.1.4

Device codes

Each transmitting and receiving device is identified by 2 characters:

VA: video matrix

PC: personal computer

4. Advanced Functions

Page 28/65

MNVCSM328A_0438

Advertising