LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 message truncated

HI,
Iam driving a motor drive with CVI truth rs232c communication functions , over modbus RTU.
Using my software in debug or realease configuration works fine, but when I start my application from the exe file created by CVI, Modbus messages are not sent toroughly, so the drive does not answer my modbus message.
Does somebody have already seen that behaviour?

I am using Aspycom to spy RS232 message


0 Kudos
Message 1 of 5
(3,736 Views)

Try calling the OpenComConfig function with output queue size set to -1.

This disables the queue so that bytes are written directly to the port, instead of being buffered to be sent at an indeterminate time.
I've seen this behaviour, such that the data is sent only when I call the Delay function after ComWrt.

Hope this helps.

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 5
(3,723 Views)
HI,
First thanks for your answer but I have tried what you said and I still got the same behaviour.

Thanks
 
Olivier
0 Kudos
Message 3 of 5
(3,716 Views)
Here are some other possibilities:
  • Double check the 3rd input parameter (specifies the number of bytes to write) to be sure it does not get different values within the program flow.
  • You may also check the return value of ComWrt to see if the function is aware that it is sending partial data.
  • Call ComWrtByte successively to send the command byte-by-byte.
  • Try another COM port if your computer supports it. If there is no COM2 on the motherboard, you may try a USB-RS232 converter.
S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 5
(3,714 Views)
HI,

I have tried what you said and it still deos not work, I have located the problem as the Buffer used in my program to send RS232 message seems to be containing only  the 8  bytes  in executable.

I attach my file generating the modbus frames , maybe you'll see what is wrong with it.

Thanks

Olivier
0 Kudos
Message 5 of 5
(3,667 Views)