为了设定或是使用智能扩展班板需要使用spc_request_dev或是spc_request_sys函数。
spc_request_dev($sid, $cmd)
spc_request_sys($sid, $cmd)
所有智能扩展板共同支持的命令是spc_request_sys函数,命令目录如下。
命令 | 选项 | 说明 |
---|---|---|
get | did | get a device ID |
get | uid | get a unique ID |
按各个智能扩展板适应的命令使用spc_request_dev函数,命令目录如下。
cmd | arg1 | arg2 | arg3 | arg4 |
---|---|---|---|---|
set | mode | full | - | - |
half | - | - | ||
vref | stop | (0~15) | - | |
drive | (0~15) | - | ||
lock | (0~15) | - | ||
rsnc | (low_pps) | (high_pps) | ||
speed | (pps) | - | - | |
accel | (accel) | [decel] | - | |
pos | (-2147483648 ~ +2147483647) | - | - | |
get | state | - | - | - |
pos | - | - | - | |
move | step | [speed] | [accel] | [decel] |
goto | pos | [spped] | [accel] | [decel] |
sw(0~3) | [speed] | [accel] | [decel] | |
stop | [decel] | - | - | - |
eio | get | (0~3) | - | - |
set | (0~3) | mode | input | |
lock |
※ (): mandatory, []: optional