现有一个java脚本,通过串口发两ASCII字符到PLC,用串口监控看确定有发,但PLC收不到,用串口助手用同样的格式发就可以收到,请高人指点。
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发的
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
这是串口调试助手发的
PLC的格式:MOV H82 D8120
RS D200 K4 D300 K4