| | |
| | | public static final int BYTE_LEN = 5;
|
| | |
|
| | | public static final short CMD_TYPE_READ = 0x03; //读
|
| | | public static final short CMD_TYPE_READ_INPUT = 0x04; //读输入寄存器
|
| | |
|
| | | public static final short CMD_TYPE_WRITE_YC = 0x05;
|
| | | public static final short CMD_TYPE_WRITE_STD = 0x06; //单点写入
|
| | |
| | | if(CMD_TYPE_READ == this.Cmd) {
|
| | | this.data_count = tmpbuf.get()&0xFF;
|
| | |
|
| | | }else if(CMD_TYPE_WRITE_STD == this.Cmd || CMD_TYPE_WRITE_MULTY == this.Cmd || CMD_TYPE_WRITE_SysUpdate == this.Cmd){
|
| | | }else if(CMD_TYPE_READ_INPUT == this.Cmd){
|
| | | this.data_count = tmpbuf.get()&0xFF;
|
| | | }else if(CMD_TYPE_WRITE_STD == this.Cmd || CMD_TYPE_WRITE_YC == this.Cmd || CMD_TYPE_WRITE_MULTY == this.Cmd || CMD_TYPE_WRITE_SysUpdate == this.Cmd){
|
| | |
|
| | | this.reg_addr = tmpbuf.getShort()&0xFFFF; //寄存器地址
|
| | | this.result = tmpbuf.getShort()&0xFFFF;
|