C-Power External Calls Communication Protocol
C-Power External Calls Communication Protocol
2012.8.4
Version V1.9
Recension Log:
Version Date Changes Executor
V1.0 2009.9.1 The first version
V1.1 2009.12.28 Increase the protocol of select play stored
program and set variable value
V1.2 2010.2.3 Increase the introduction of network data
package
V1.3 2010.2.24 Increase the introduction of cancel select play
stored program
V1.4 2010.5.20 Add protocol for setting user variable
V1.5 2010.6.22 Add protocol for setting global display zone
V1.6 2010.10.9 Add protocol for stopwatch timer
V1.7 2011.5.14 Add protocol for template box play
V1.8 2012.6.1 Improvement
V1.9 2012.8.4 Improvement
1、Intruction
Data packet is used to communicate between the PC and the controller, in order to enhance
the reliability of data, expanding capabilities to deal with images and other data.
Communication process:
a).PC send a data packet to the controller;
b).The controller received the data packet, analysis and processing of data packet ,and then
return a data packet to PC if necessary;
c). PC receives the data packets returned from the control card, and analysis the received data
packets to determine whether communication is successful.
Serial setting:
Baud rate: 115200, 57600, 38400, etc. selected by the selected tool.
Format string: "115200, 8, N, 1", you can change the baud rate value 115200 according to
what you set to the controller.
2 Stretch
3 tile
Code Effect
0 Draw
1 Open from left
2 Open from right
3 Open from center(Horizontal)
4 Open from center(Vertical)
5 Shutter(vertical)
6 Move to left
7 Move to right
8 Move up
9 Move down
10 Scroll up
11 Scroll to left
12 Scroll to right
13 Flicker
14 Continuous scroll to left
15 Continuous scroll to right
16 Shutter(horizontal)
17 Clockwise open out
18 Anticlockwise open out
9 Windmill
20 Windmill(anticlockwise)
21 Rectangle forth
22 Rectangle entad
23 Quadrangle forth
24 Quadrangle endtad
25 Circle forth
26 Circle endtad
27 Open out from left up corner
28 Open out from right up corner
29 Open out from left bottom corner
30 Open out from right bottom
corner
31 Bevel open out
32 AntiBevel open out
33 Enter into from left up corner
34 Enter into from right up corner
35 Enter into from left bottom
corner
36 Enter into from lower right
corner
37 Bevel enter into
38 AntiBevel enter into
39 Horizontal zebra crossing
40 Vertical zebra crossing
41 Mosaic(big)
42 Mosaic(small)
43 Radiation(up)
44 Radiation(downwards)
45 Amass
46 Drop
47 Combination(Horizontal)
48 Combination(Vertical)
49 Backout
50 Screwing in
51 Chessboard(horizontal)
52 Chessboard(vertical)
53 Continuous scroll up
54 Continuous scroll down
55 Reserved
56 Reserved
57 Gradual bigger(up)
58 Gradual smaller(down)
59 Reserved
60 Gradual bigger(vertical)
61 Flicker(horizontal)
62 Flicker(vertical)
63 Snow
64 Scroll down
65 Scroll from left to right
66 Open out from top to bottom
67 Sector expand
68 Reserved
69 Zebra crossing (horizontal)
70 Zebra crossing (Vertical)
Clock format:
Represent by one byte:
bit 0: Signal timing(0: 12signal timing;1: 24 signal timing)
bit 1: Year by bit(0: 4 bit;1: 2 bit)
bit 2: Line folding(0: single-row;1: multi-row)
bit 3~5: Reserved(set to 0)
bit 6: Show time scale ”Hour scale、Minute scale”
bit 7: Reserved(set to 0)
Data composition:
Data head Red data(optional) Green Blue
data(optional) data(optional)
Data description:
The color of the data is order by red、green、blue. If the identify bit of the property is 0,
the color data is not exist.
For one color data, order by ” left to right, top to bottom”. First put the data to the first line,
then second line and so on.
Rich3 Text
Each character is 3 bytes, the specific meaning of each byte are as follows:
Byte no Byte data
1 Said the color and font size: 4bits (1-7) represent the color (red green
yellow blue purple cyan white), low 4bits (= 0 indicates that 8-point text;
= 2 16-point text; = 3 24-point text; = 4 32point text; = 5 40-point text; =
6 48-point text; = 7 56-point text).
2 High byte of the text encoding. For single-byte characters, the value is 0.
3 Low byte of the text encoding. For single-byte characters, the value of its
ASCII code.
RS232/RS485 sender:
The following process is done sending and receiving low-level functions, If you write your own
PC side of the sending and receiving programs, you must implementation as below conventions.
Use the without transcoding code to calculation checksum.
Send:
Between start code and end code, if there is 0xA5, 0xAA or 0xAE, it should be converted to two
code:
0xa5 0xaa 0x05。The purpose is to avoid the same with the start character 0xa5
0xae 0xaa 0x0e。The purpose is to avoid the same with the end of the symbol 0xae。
0xaa 0xaa 0x0a。The purpose is to avoid the same with the escape character 0xaa。
Receive:
Received symbol 0xa5, said that the beginning of a packet
Received symbol 0xae, said that the end of a packet
When PC receive data from controller, if there is 0xA5, 0xAA or 0xAE, it should convert two
code to one code, specifically for
0xaa 0x05 0xa5
0xaa 0x0e 0xae
0xaa 0x0a 0xaa
network sender
If the data needs to be divided into several packages, command sub-code only in the first data
packet appears, the other only contains the data content of data packets。
data:
2: right Alignment
Display area X 0x0000~0xfff 2 The X coordinate of upper left corner of the
f display area。Upper left corner of the window
relative
Display area Y 0x0000~0xfff 2 The Y coordinate of upper left corner of the
f display area。Upper left corner of the window
relative
Display area 0x0000~0xfff 2 The width of display area 。 High byte in the
width f former.
Display area 0x0000~0xfff 2 The height of display area 。 High byte in the
height f former.
Font 1 Bit0~3: font size
Bit4~6: font style
Bit7: Reserved
Text color R 0~255 1 The red color component
Text color G 0~255 1 The green color component
Text color B 0~255 1 The blue color component
Text Variable-length Text string to the end of 0x00.
Send clock:CC=0x05:
CC=0x0b
Example 2:A5 68 32 01 7B 01 13 00 00 00 12 00 00 01 00 00 03 02 ff 00 00 61 62 63 0d 63 62 61 00 9a 04 AE
The program template agreement is a set of relatively independent of the agreement, the basic
concept of this agreement are as follows:
"Program" is a standalone player within a certain time, a message is displayed on the screen
can be divided into multiple regions, each region can be specified individually.
The maximum number of programs is 100, corresponding to an effective program number
from 1 to 100.Send program information, new information covering the same program number.
Send data:
Data Item Value Lenght(byte) Description
CC 0x83 1 Describe the package is the data of query
program template status parameter.
Options 0x00 1 Bit0: Whether to query program template status
parameter
Bit1:Whether to return the template definition
color gray, screen size information
Bit2~7: Reserved
Return data
Data Item Value Lenght(byte) Description
CC 0x83 1 Describe the package is the return data of query
program template status parameter.
Options 1 The same value with send value of “Options”.
Template mode 1 0: Not program template
1: program template
Template status 1 Bit0~1: template availability
0: the template is not available
1: the template can be used
others: Reserved
Bit2~7: Reserved
Delete program:CC=0x84:
CC=0x85:
Send data
Data Item Value Lenght(byte) Description
CC 0x85 1 Describe the package is the data which to send
text to the specified window of the specified
program
Append code 4 The user’s append code, high byte previous.
Program No 1 Valid value:1~100
Window No 1 Valid value:1 ~ 10 , Invalid when out of
program template definition.
Property 1 Bit0~3: Text type
0:Common Text ; 1:Format Text
Bit4: Display format.
0: default format 1:specify format
Bit5~7: Reserved
Show format Stay time/ 2 Stay time/Scroll times: High byte first。When
Scroll times the show effect is scroll , it means
(Note : When scroll times(0 scroll one times,1 scroll
the “Property " two times,…) , for others , it means
display format stay time, unit is second.
is zero, do not Speed 1 The smaller the faster
need this data ) Font size 1 Bit 0~3:Font size, Font size code
Bit 4~6:Font style , Font style code
Font color. 1 Font color.。Text color code
Show effect 1 Show effect。Special effect for text and picture
Text 1 Text alignment and line space
alignment Bit0~1: the horizontal alignment (
0: Left-aligned
1: Horizontal center
2: Right- aligned)
Bit2~3: vertical alignment (
0:Top-aligned
1:Vertically center,
2: Bottom- aligned)
Bit4~7: Line space 0~15point
Reserved 1 Reserved,fill in 0
Text Variable-length Text data according to different types of text,
the text type to see the definition of the "
Property ".
Common Text :The text string, the end to 0x00
Format text: The first byte is 0x01, the
followed Rich3 text, a detailed description see
Formatted text data format
Return data
Data Item Value Lenght(byte) Description
CC 0x83 1 Describe the package is the return data of send
text to the specified window of the specified
program
Append code 4 The user’s append code, high byte previous.
Program no 1 The same value with send value “Program no”.
Valid value:1~100
Window No 1 The same value with send value “Window no”.
Valid value:1~10,Invalid when out of program
template definition.
Packet loss 1 The number of packets that have not yet
number received. Sends the first packet loss number is
the total number of packets minus one.
The packet Variable-length Packet loss packet number. Always in
number of the accordance with small to large; the first packet
packet loss packet number is 0. Each package a byte.
*Must first send the first packet. Best to confirm the first packet sent successfully, and then send
subsequent packets.
* The meaning of "return value" in the return packet:
0x01 program template is invalid
0x11 program number is out of range
0x12 window number out of range
0x80 currently is not program template way
program:CC=0x86:
Send data
Data Item Value Lenght(byte) Description
CC 0x86 1 Describe the package is the data which to send
picture to the specified window of the
specified program
Append code 4 The user’s append code, high byte previous.
Program No 1 Valid value:1~100
Window No 1 Valid value:1 ~ 10 , Invalid when out of
program template definition.
Picture type 1 Bit0~3: Picture type
1:gif image file format
2:gif image file references
4 : simple image format , see Simple
picture data format
Bit4: Display format.
0: default format 1:specify format
Bit5: Do you play immediately. (1:Now
Playing)
Bit6~7: Reserved
Show format Stay time/ 2 Stay time/Scroll times: High byte first。When
Scroll times the show effect is scroll , it means
(Note : When scroll times(0 scroll one times,1 scroll
the “Property " two times,…) , for others , it means
display format stay time, unit is second.
is zero, do not Speed 1 The smaller the faster
need this data ) Show effect 1 Show effect。Special effect for text and picture
Picture mode 1 Picture mode。Picture effect code
Reserved 3 Reserved,fill in 0
Picture data Variable-length Picture data
Return data
Data Item Value Lenght(byte) Description
CC 0x83 1 Describe the package is the return data of send
picture to the specified window of the
specified program
Append code 4 The user’s append code, high byte previous.
Program No 1 The same value with send value “Program no”.
Valid value:1~100
Window No 1 The same value with send value “Window no”.
Valid value:1~10,Invalid when out of program
template definition.
Packet loss 1 The number of packets that have not yet
number received. Sends the first packet loss number is
the total number of packets minus one.
The packet Variable-length Packet loss packet number. Always in
number of the accordance with small to large; the first packet
packet loss packet number is 0. Each package a byte.
*Must first send the first packet. Best to confirm the first packet sent successfully, and then send
subsequent packets.
* The meaning of "return value" in the return packet:
0x01 program template is invalid
0x11 program number is out of range
0x12 window number out of range
0x80 currently is not program template way
specified program:CC=0x87:
Send data
Data Item Value Lenght(byte) Description
CC 0x87 1 Describe the package is the data which to
show clock/temperature in the specified
window of the specified program
Append code 4 The user’s append code, high byte previous.
Program No 1 Valid value:1~100
Window No 1 Valid value:1 ~ 10 , Invalid when out of
program template definition.
Type 1 Bit0~3: Type
2:Clock ; 3:Temperature
Bit4: Display format.
0: default format 1:specify format
Bit5~7: Reserved, fill in 0
Format Variable-length The meaning of the attribute data according to
different types
Type=2:Data see appendix 1 Clock/Calendar
type
Type=3 : Data see appendix 1 Temperature
and Humidity type
Return data
Data Item Value Lenght(byte) Description
CC 0x87 1 Describe the package is the return data which
to show clock/temperature in the specified
window of the specified program
Append code 4 The user’s append code, high byte previous.
Program No 1 The same value with send value “Program no”.
Valid value:1~100
Window No 1 The same value with send value “Window no”.
Valid value:1~10,Invalid when out of program
template definition.
Packet loss 1 The number of packets that have not yet
number received. Sends the first packet loss number is
the total number of packets minus one.
The packet Variable-length Packet loss packet number. Always in
number of the accordance with small to large; the first packet
packet loss packet number is 0. Each package a byte.
Send data
Data Item Value Lenght(byte) Description
CC 0x88 1 Describe the package is the data which to send
alone program
Alone program is independent of the program
template, it can split windows.
Append code 4 The user’s append code, high byte previous.
Program No 1 Valid value:1~100
Option 1 Bit0~4: Reserved, fill in 0.
Bit5: Do you play immediately.(1 Now
Playing)
Bit6~7: Reserved, fill in 0.
Reserved 3 Reserved, fill in 0.
Window 1 Valid value 1~10
number
Window 22* Window Every window information table has a 22
information number bytes length parameter. The 1~16 bytes are
table window position and property, You can see the
detail at Appendix 1 : Window position and
property; The 17~19 bytes are window data
offset; The 20~22 bytes are window data
length. High byte first.
If no data ,then window data offset and
window data length all are 0.
The total length of the data is: the number of
the window*22.
Send data:
Data Item Value Lenght(byte) Description
CC 0x89 1 Describe the package is the data which to query
program info
Info flag 1 Special which program info will to be query
1: Query valid programs count and program
number
2: Query specifies program information.
Other: Reserved
parameters 5 The meaning of the parameters according to the
info flag different.
Parameter and return data description
Query“valid program count and program number”
Parameter
Byte 1~5 Reserved, fill 0
Return data
Data Item Value Lenght(byte) Description
CC 0x89 1 Describe the package is the return data packet
of query program info
Info flag 1 Same with send value ”info flag”
parameters 5 Same with send value ”parameters”
Valid program 1 Valid program count
count
Valid program Variable-length Each byte identifies an effective
number program。Valid value 1~100。
* The meaning of "return value" in the return packet:
0x01 Controller not running in program template mode
0x10 Unknown info flag
Query specifies program information
Parameter
Byte 1 Program number
Byte 2~5 Reserved, fill 0
Return data
Data Item Value Lenght(byte) Description
CC 0x89 1 Describe the package is the return data packet
of query program info
Info flag 1 Same with send value ”info flag”
parameters 5 Same with send value ”parameters”
Information 1 Now only return one information
count
Program 1 Program number
number
User append 4 User append code
code
* The meaning of "return value" in the return packet:
0x01 Controller not running in program template mode
0x10 Unknown info flag
0x11 Invalid programs
0x12 Can’t get program information
0: All programs
1: Specify program
Other: Reserved
Program 0/1 The count of the program. When it sets all
number program property , don’t need this data.
Program list Variable-length The list of the program. When it sets all
program property , don’t need this data.
Length number of bytes equal to the number of
programs. Each program is 1 byte, program
number from 1
Property flag 1 1 marked which property you want to set by
Bit4~7: Reserved
Property flag 2 1 Bit0~4: valid time. >0 the count of the valid
time.<=4
Bit5~7: Reserved
Program level 1 The program level. 1~3 level, The high level
of the program is priority.
Play loop 2 Loop count, High byte previous(big-endian).
count 0: Do not play the program, use to shield
program temporarily.
Send data
Data Item Value Lenght(byte) Description
CC 0x8d 1 Describe the package is the data which to query
play plan
Append code 4 The user’s append code, high byte previous.
Query type 1 0: Query all valid play plan.
1: Query specified play plan no
Other: Reserved
Play plan No 1 Valid value:1~100。
When query type is 0,this data fill in 0。
Total support 100 plans。
Return data
Data Item Value Lenght(byte) Description
CC 0x8d 1 Describe the package is the return data which
to query play plan
Append code 4 The user’s append code, high byte previous.
Query type 1 0: Query all valid play plan.
1: Query specified play plan no
Other: Reserved
Count/Number 1 When query type is 0,this value is valid play
schedule count
When query type is 1 , this value is play
schedule number.
Play schedule Variable-length When query type is 0,this value is valid play
number table/ schedule number table
play schedule When query type is 1 , this value is play
content schedule content. Data format like command
0x8B.
You must deal with the return data according to the different query type.
The meaning of "return value" in the return packet:
0x01 program template is invalid
0x11 Don’t support the query type.
0x12 Invalid play plan no.
0x80 currently is not program template way
Appendix 1 : Window position and
property
0 1 2 3 4 5 6 7 8 9 A B C D E F
0x00 x y cx cy Window property
Description:
Data Item Data Description
Size(BYTE)
x 2 Window start point x, high byte previous (big
endian).
y 2 Window start point Y, high byte previous (big
endian).
cx 2 Window width. High byte previous (big endian).
cy 2 Window height. High byte previous (big endian).
Window property 8 Window default type and parameters.
Blank type
0 1 2 3 4 5 6 7
0x00 0 Reserved
Text type
0 1 2 3 4 5 6 7
0x00 1 Effect Font Font Speed Stay Align
size color time
Clock/Calendar type
0 1 2 3 4 5 6 7
0x00 2 Font Font Stay calendar Format Content
size color time
Data Item Value Length(BYTE) Description
Font size 1 Bit0~2: Font size, see in Font size code
Bit 4~6:Font style , Font style code
Font color 1 Bit0~2: Font color , see 1-byte color value
in Text color code
Stay time 0x0000~0xffff 2 High byte previous(big endian), unit
is second.
Calendar 1 0: The gregorian calendar
Format 1 Clock format: See in Clock format and
display content
Content 1 Clock content: see in Clock format and
display content
0 1 2 3 4 5 6 7
0x00 3 Font Font Stay Format Reserved
size color time
0 1 2 3 4 5 6 7
0x00 4 Effect Speed Stay Reserved
time
Data Item Value Length(BYTE) Description
Effect 1 Effect: See in Special effect for text
and picture
Speed 0~9 1 The smaller of the value, the faster.
Invalid when display immediately.
Stay time 0x0000~0xffff 2 Stay time/Scroll times: High byte
first 。 When the show effect is scroll , it
means scroll times(0 scroll one times,1
scroll two times,…) , for others , it means
stay time, unit is second.