現(xiàn)有一個java腳本,通過串口發(fā)兩ASCII字符到PLC,用串口監(jiān)控看確定有發(fā),但PLC收不到,用串口助手用同樣的格式發(fā)就可以收到,請高人指點。
19230 08:56:01 java.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial2 SUCCESS StopBits: 1 Parity: EVEN WordLength: 7
19231 08:56:01 java.exe IOCTL_SERIAL_SET_CHAR Serial2 SUCCESS EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13
19232 08:56:01 java.exe IOCTL_SERIAL_SET_HANDFLOW Serial2 SUCCESS Shake:1 Replace:40 XonLimit:16 XoffLimit:1024
19233 08:56:01 java.exe IRP_MJ_WRITE Serial2 SUCCESS Length 2: VU
19234 08:57:26 java.exe IRP_MJ_WRITE Serial2 SUCCESS Length 2: VD
19235 08:57:29 java.exe IRP_MJ_WRITE Serial2 SUCCESS Length 2: PS
上面是java發(fā)的
72 08:50:35 CommAssistant.e IOCTL_SERIAL_GET_COMMSTATUS Serial2 SUCCESS
173 08:50:35 CommAssistant.e IOCTL_SERIAL_GET_COMMSTATUS Serial2 SUCCESS
174 08:50:35 CommAssistant.e IOCTL_SERIAL_GET_COMMSTATUS Serial2 SUCCESS
175 08:50:35 CommAssistant.e IRP_MJ_WRITE Serial2 SUCCESS Length 2: VU
176 08:50:35 CommAssistant.e IOCTL_SERIAL_GET_COMMSTATUS Serial2 SUCCESS
177 08:50:35 CommAssistant.e IOCTL_SERIAL_GET_COMMSTATUS Serial2 SUCCESS
這是串口調(diào)試助手發(fā)的
PLC的格式:MOV H82 D8120
RS D200 K4 D300 K4