02-07-2011 05:31 PM - edited 02-07-2011 05:34 PM
Are your responses terminated? If so, use the termination character to read the responses correctly. You have it enabled in your initialization but you may need to change the character that is being used as the termination character. Also, if you are sending multiple commands at one time that will generate multiple responses the "Bytes At Port" is not a good way to go. Since the device may send the responses one right after the other it is easy for your application to see x bytes available. This x bytes could be the complete first response and the partial second response. If you use the termination character correctly this shouldn't happen.
Also, you should look at using a the Format String VI to build your commands. The massive concatenate string is not a good way to go. It works, but it is much more difficult to modify if you have to insert something in the middle of the command.
02-07-2011 09:28 PM
Your VI is designed to only run once. Initialize, Write, Wait, Read, Close. You aren't using the Run Continuous button are you?
Normal serial port communication should initialize first before a while loop, Write, Wait Read in a while loop. Only close the port after the while loop ends at the end of the program.
02-07-2011 10:41 PM
hi
thank you all for your help i found the solution for my problem.... i was not terminating commands properly so that was the reason ...
thanks
best of luck
imran iqbal