Bonjour je suis actuellement en train d'essayer de remplacer un programme basic qui controle un robot via le port serie RS232 par un programme c++. Je ne comprend pas, mon programme c++ envoie les commande et le robot ne bouge pas... Pourtant j'ai réglé la bonne vitesse en baud le bon nombre de bits de parité et de stop et le bon wordlength.
J'ai utilisé le logiciel portmon pour capturer les agissemnts des deux programmes et je ne comprend pas ce qui cloche, les deux me semblent faire la même chose(alors que seul le programme en basic arrive a faire bouger le robot).

Voici ce que m'affiche portmon pour chaque programme

programme en basic :


0.00018187 NTVDM.EXE IRP_MJ_CREATE Serial0 SUCCESS Options: Open
0.00002095 NTVDM.EXE IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
0.00000922 NTVDM.EXE IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
0.00000838 NTVDM.EXE IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
0.00000838 NTVDM.EXE IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
0.00000754 NTVDM.EXE IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
0.00000670 NTVDM.EXE IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
0.00000670 NTVDM.EXE IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
0.00000670 NTVDM.EXE IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
0.00002179 NTVDM.EXE IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 9600
0.00003520 NTVDM.EXE IOCTL_SERIAL_CLR_RTS Serial0 SUCCESS
0.00002598 NTVDM.EXE IOCTL_SERIAL_CLR_DTR Serial0 SUCCESS
0.00001341 NTVDM.EXE IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
0.00000838 NTVDM.EXE IOCTL_SERIAL_SET_CHAR Serial0 SUCCESS EOF:1a ERR:3f BRK:3f EVT:10 XON:11 XOFF:13
0.00002263 NTVDM.EXE IOCTL_SERIAL_SET_HANDFLOW Serial0 SUCCESS Shake:0 Replace:0 XonLimit:2048 XoffLimit:512
0.00001090 NTVDM.EXE IOCTL_SERIAL_LSRMST_INSERT Serial0 SUCCESS Char: ffffffff
0.00002263 NTVDM.EXE IOCTL_SERIAL_SET_QUEUE_SIZE Serial0 SUCCESS InSize: 8192 OutSize: 100
0.00000838 NTVDM.EXE IOCTL_SERIAL_GET_TIMEOUTS Serial0 SUCCESS
0.00000754 NTVDM.EXE IOCTL_SERIAL_SET_TIMEOUTS Serial0 SUCCESS RI:-1 RM:0 RC:0 WM:0 WC:300
0.00003352 NTVDM.EXE IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
0.00001173 NTVDM.EXE IOCTL_SERIAL_CLR_RTS Serial0 SUCCESS
0.00002011 NTVDM.EXE IOCTL_SERIAL_CLR_RTS Serial0 SUCCESS
0.00001006 NTVDM.EXE IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
0.00016008 NTVDM.EXE IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 5
0.00000838 NTVDM.EXE IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
0.00001090 NTVDM.EXE IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
0.00002011 NTVDM.EXE IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 9600
0.00003771 NTVDM.EXE IOCTL_SERIAL_SET_WAIT_MASK Serial0 SUCCESS Mask: RXCHAR CTS DSR RLSD ERR RING
0.40091118 NTVDM.EXE IOCTL_SERIAL_WAIT_ON_MASK Serial0 SUCCESS
0.00004358 NTVDM.EXE IOCTL_SERIAL_GET_MODEMSTATUS Serial0 SUCCESS
0.00008381 NTVDM.EXE IRP_MJ_WRITE Serial0 SUCCESS Length 1: @
0.00089928 NTVDM.EXE IRP_MJ_WRITE Serial0 SUCCESS Length 1: 0
0.00185219 NTVDM.EXE IRP_MJ_WRITE Serial0 SUCCESS Length 1: r
0.00282354 NTVDM.EXE IRP_MJ_WRITE Serial0 SUCCESS Length 1: 7
0.00005196 NTVDM.EXE IRP_MJ_WRITE Serial0 SUCCESS Length 1: .
0.00002850 NTVDM.EXE IRP_MJ_READ Serial0 SUCCESS Length 4: .."0
0.00001090 NTVDM.EXE IRP_MJ_READ Serial0 SUCCESS Length 0:
0.00000000 NTVDM.EXE IOCTL_SERIAL_WAIT_ON_MASK Serial0


programme en c++ :



0.00017097 main.exe IRP_MJ_CREATE Serial0 SUCCESS Options: Open
0.00001928 main.exe IOCTL_SERIAL_SET_QUEUE_SIZE Serial0 SUCCESS InSize: 4096 OutSize: 4096
0.00000922 main.exe IOCTL_SERIAL_SET_TIMEOUTS Serial0 SUCCESS RI:5000 RM:0 RC:5000 WM:0 WC:0
0.00000922 main.exe IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
0.00000922 main.exe IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
0.00000754 main.exe IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
0.00000838 main.exe IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
0.00002179 main.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 9600
0.00001341 main.exe IOCTL_SERIAL_SET_RTS Serial0 SUCCESS
0.00001173 main.exe IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
0.00001257 main.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
0.00000754 main.exe IOCTL_SERIAL_SET_CHAR Serial0 SUCCESS EOF:1a ERR:3f BRK:3f EVT:10 XON:11 XOFF:13
0.00001509 main.exe IOCTL_SERIAL_SET_HANDFLOW Serial0 SUCCESS Shake:1 Replace:40 XonLimit:256 XoffLimit:256
0.00002766 main.exe IOCTL_SERIAL_PURGE Serial0 SUCCESS Purge: TXABORT RXABORT TXCLEAR RXCLEAR
0.00001257 main.exe IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
0.00010225 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: @
0.00093448 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: 0
0.00098811 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: z
0.00099817 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: .
0.00002263 main.exe IRP_MJ_CLEANUP Serial0 SUCCESS
0.01165623 main.exe IRP_MJ_CLOSE Serial0 SUCCESS
0.00016762 main.exe IRP_MJ_CREATE Serial0 SUCCESS Options: Open
0.00002095 main.exe IOCTL_SERIAL_SET_QUEUE_SIZE Serial0 SUCCESS InSize: 4096 OutSize: 4096
0.00001006 main.exe IOCTL_SERIAL_SET_TIMEOUTS Serial0 SUCCESS RI:5000 RM:0 RC:5000 WM:0 WC:0
0.00000838 main.exe IOCTL_SERIAL_GET_BAUD_RATE Serial0 SUCCESS
0.00000838 main.exe IOCTL_SERIAL_GET_LINE_CONTROL Serial0 SUCCESS
0.00000754 main.exe IOCTL_SERIAL_GET_CHARS Serial0 SUCCESS
0.00000670 main.exe IOCTL_SERIAL_GET_HANDFLOW Serial0 SUCCESS
0.00002095 main.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 9600
0.00001173 main.exe IOCTL_SERIAL_SET_RTS Serial0 SUCCESS
0.00001173 main.exe IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
0.00001257 main.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8
0.00000838 main.exe IOCTL_SERIAL_SET_CHAR Serial0 SUCCESS EOF:1a ERR:3f BRK:3f EVT:10 XON:11 XOFF:13
0.00001425 main.exe IOCTL_SERIAL_SET_HANDFLOW Serial0 SUCCESS Shake:1 Replace:40 XonLimit:256 XoffLimit:256
0.00001928 main.exe IOCTL_SERIAL_PURGE Serial0 SUCCESS Purge: TXABORT RXABORT TXCLEAR RXCLEAR
0.00001173 main.exe IOCTL_SERIAL_SET_DTR Serial0 SUCCESS
0.00010392 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: @
0.00095543 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: 0
0.00097638 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: z
0.00099398 main.exe IRP_MJ_WRITE Serial0 SUCCESS Length 1: .
0.00003269 main.exe IOCTL_SERIAL_GET_COMMSTATUS Serial0 SUCCESS
5.00010979 main.exe IRP_MJ_READ Serial0 TIMEOUT Length 1: 1
0.00002263 main.exe IRP_MJ_CLEANUP Serial0 SUCCESS
0.01035383 main.exe IRP_MJ_CLOSE Serial0 SUCCESS


une idée?

Merci beaucoup de votre aide.