Download Command 0x19 - Tech: Device parameter settings

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Download Command 0x19 - Tech: Device parameter settings

'Neal Singh
Administrator
Each device will have  an address where the Setting of that Device will be stored. These will control the comms process.


Download Command 0x19 -  Tech: Device parameter settings

Field Name

Description

Example [#of Bytes]          

DeviceCode,BaudSettings,SerialType,  Poll , Read delay, ResponseLength, SpareControl1, SpareControl2, SpareControl3.

Each control of the device will be stored is one location for easier access

Serial Type  =

R-RS485  S-RS232 –F-CC1310

A,40,R,30,15,0,0

DeviceCode,BaudSettings,SerialType,  Poll , Read delay, ResponseLength, SpareControl1, SpareControl2, SpareControl3.

 

U,9600,8,N,1,R,30,15,0,0 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Below a sample of the comms from the Web to the M/C

STX

[1] Hex

SiteID[3]

Hex

Packet Type[2] Hex

Payload length [1] Hex

Payload

 

CRC [1]

Hex

ETX

 [1]Hex

0x32

0x04FD00

0x02

0xnn

A,19200,8,N,1,R,30,15,0,0|U,9600,8,N,1,R,30,15,0,0  etc

XX

0x33

Reply | Threaded
Open this post in threaded view
|

Re: Download Command 0x19 - Tech: Device parameter settings

juanchigarin
Administrator
Is this command as all the subfields between '|' are all bytes, the optimum is that the ',' separator be removed and only there is a byte(char) array of 9 between each separator '|'.

Regarding to BaudSettings, the best is that field would be a byte code nd then into the arduino code configure a baudrate for each one, as in MID. Because the Arduino only accept on serial port configs this two values:
Speed: in bits per second (baud) - long
Config: sets data, parity, and stop bits

And Configs is a predefined code like SERIAL_8N2, SERIAL_8E1, SERIAL_8E2

As example in the MID->hardware config there are some defines:

#define BD_1200_8_E_1             0
#define BD_2400_8_N_1             1
#define BD_4800_8_E_1             2
#define BD_4800_8_N_1             3
#define BD_5787_8_E_1             4
#define BD_9600_8_N_1             5
#define BD_4800_8_O_1             6
#define BD_38400_8_N_1            7