Télécharger Imprimer la page

Eneo EKR-8/4 Manuel D'instructions page 33

Publicité

Les langues disponibles

Les langues disponibles

9 APPENDI X
9.1 Macro Pro tocol: description
The Macro protocol is characterized by messages consisting only of printable ASCII characters, delimited by
two terminator characters '[' and ']'. Within the message, upper and lower case letters are differentiated and
there are NEVER any space separators. The format of a typical message consists of a character string
'[VA1PC1VidS1,12A]' which can be interpreted as follows:
[
Start of message
Receiver of message
VA1
PC1
Sender of message
VidS
Command
1
First parameter
,
Parameter separator
12
Second parameter
A
Checksum
End of message
]
(1)
Even though in this case the Receiver and Sender units have no address it is necessary to insert an
imaginary id. number.
(2)
Depending on the command, there are a maximum of 4 numeric parameters separated by a comma: to transmit
the number 123 it is necessary to send the three characters '1' (ASCII 49), '2' (ASCII 50) and '3' (ASCII 51).
9.1.1 Checksum calculation procedures
Calculate the sum of the ASCII codes of all the message characters, excluding the terminators '[' and ']'
1) calculate the value of the sum (mod 26) (the remainder after division by 26, always a whole number between
0 and 25)
2) add 65 to the calculated modulus and find the corresponding character in the ASCII table: the result should
be an upper case letter of the alphabet from 'A' to 'Z'.
The message will only be interpreted by the matrix if the checksum is correct.
9.1.2 Test progra m example
The following is a simple test program in BASIC, which can be used as the basis to create more complicated
control systems. The program uses the serial port COM1 with baudrate 9600.
OPEN "COM1:9600,N,8,1,BIN,RB1000,DS0,CS0,CD0,RS" FOR RANDOM AS #1
COM(1) ON
ON COM(1) GOSUB Reception
DO WHILE (1)
A$ = UCASE$(INKEY$)
SELECT CASE A$
CASE "1":
' switch camera 1 to monitor 1
PRINT #1, "[VA1PC1VidS1,1C]";
CASE "2":
'switch camera 2 to monitor 1
PRINT #1, "[VA1PC1VidS1,2D]";
CASE "S":
'automatic switching sequence on monitor 1
PRINT #1, "[VA1PC1VidA1V]";
CASE CHR(27):
END
END SELECT
LOOP
Reception:
DO WHILE NOT(EOF(1))
B$ = INPUT$(1,1)
IF B$ = "[" THEN PRINT
PRINT B$;
LOOP
RETURN
All manuals and user guides at all-guides.com
(1)
(1)
(2)
(2)
(2)
' recognises a key being pressed down
' exit program with ESC
Pag. 31
Video unit number 1
PC number 1
Switch
Monitor 1
Camera 12
MNNAEKR_0408

Publicité

loading

Ce manuel est également adapté pour:

Ekr-16/4