Common board communication protocol (hw:serial port)
baudrate : 115200 bps 8,1,None
command & feedback end with “\r\n”
Board summy
* standard board rules
Format:slaver_address(addr) + ‘,’ + cmd (end with “\r\n”)
Herring board
| index |
cmd |
para |
return |
eg. |
description |
| 01 |
get_curr |
ch |
0.0123 |
get_curr,[ch] |
get [ch] csa chip current |
| 02 |
get_volt |
ch |
12.345678 |
get_volt,[ch] |
get [ch] csa chip voltage |
| 03 |
get_pwr |
ch |
2.345678 |
TBD |
TBD |
| 04 |
set_ovp |
ch,volt |
null |
set_ovp,[ch],[volt] |
set [ch] ovp voltage as [volt] |
| 05 |
read_ovp |
ch |
1.2345 |
read_ovp,[ch] |
read [ch] ovp voltage |
| 06 |
set_curr_rate |
ch,rate |
null |
set_curr_rate,[ch],[rate] |
set [ch] csa rate as [rate] |
| 07 |
set_curr_range |
ch,range |
null |
set_curr_range,[ch],[range] |
set [ch] csa rate as [range] |
| 08 |
cat_io_set |
io,state |
null |
cat_io_set,[ch],[state] |
set [io] as [state] |
| 09 |
cat_io_read |
io |
state |
cat_io_read,[io] |
read [io] state |
| 99 |
*idn? |
- |
- |
read back version |
|
USB DAQ-S1 board
| index |
cmd |
para |
return |
eg. |
description |
| 01 |
get_volt |
ch |
[pass],volt |
get_volt,[ch] |
get [ch] voltagech 1:AI1 2:AI2 3:AI3 4:AI4 5:reserve 6:reserve 7:reserve 8:AO1 9:AO2 |
| 02 |
set_volt |
ch,volt |
[pass] |
set_volt,[ch],[volt] |
set dac [ch] chip voltch 1:reserve 2:reserve 3:reserve 4:reserve 5:reserve 6:reserve 7:reserve 8:AO1 9:AO2 |
| 03 |
relay_get |
relay |
[pass],state |
relay_get,[relay] |
get [relay] [state] relay1:Rp1&Rn12:Rp2&Rn23:Rp3&Rn34:Rp4&Rn45:Rp&Rn |
| 04 |
relay_set |
relay,state |
[pass] |
relay_set,[relay],[state] |
set [relay] as [state]… |
| 05 |
di_get |
di |
[pass],state |
di_get,[di] |
get [di] statedi1:DI_ISO12:DI_ISO23:DI_ISO34:DI_ISO4 |
| 06 |
dio_get |
io |
[pass],state |
dio_get,[io] |
get [io] stateio1:DIO12:DIO23:DIO3x:DIOx8:DIO8 |
| 07 |
dio_set |
io,state |
[pass] |
dio_set,[io],[state] |
set [io] as [state]… |
| 08 |
dio_cfg |
io,mode |
[pass] |
dio_cfg,[io],[mode] |
iomode 0:output pull-push 1:output open drain 2:input 3:input analog 4:input pull-up 5:input pull-down 6:input floating 7:pwm output 8:pwm open-drain 9:comp intput |
| 9 |
cal_get |
ch |
[pass],k,b,g |
cal_get,[ch] |
ch default:g=1.0 b=0.00:Vreference 1:AI1 2:AI2 3:AI3 4:AI4 5:reserve 6:reserve 7:reserve 8:AO1 9:AO2 |
| 10 |
cal_set |
ch,k,b |
[pass] |
cal_set,[ch],[k],[b] |
ch default:g=1.0 o=0.0 … |
| 99 |
*idn? |
- |
version |
- |
- |
Voltage balance board [nonstandard]
| index |
cmd |
return |
description |
| 1 |
cell_close |
ok |
close all relay |
| 2 |
cell_now |
cellxnull |
get now relay is cellx, or null |
| 3 |
cell1 |
ok |
set cell1 ch relay |
| 4 |
cell2 |
ok |
set cellx ch relay |
| … |
… |
ok |
set … ch relay |
| 18 |
cell16 |
ok |
set cell16 ch relay |
| remark |
- |
- |
1. whole channel only support set a channel2. others channel will auto close when set a channel3. out of cmd list cmd_str will not feedback |
经典示例