LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

device get stuck when using the RS-232

Hi,
I am using the RS-232 library commands to control my UUT - sometimes sending a command to the UUT causes the UUT CLI to stop functionning. This kind of problem does not happen when using it manually. I need your help in trying to understand what might cause such a problem since it looks like I am sending some illegal character or string that causes the UUT to get stuck. I am using the FlashInQ and FlushOutQ in order to clean my buffers.
Please - Any Idea from your previous experience is weilcome, I am out of ideas.
Thanks in advance,
Moshik
 
 
 
0 Kudos
Message 1 of 7
(3,951 Views)

Can it be possible that your message is sometimes incomplete and the UUT is waiting for completion? This may happen if you miss some termination character under some condition in your code, or even if you have legal NUL characters inside your message and calculate number of bytes to send using strlen on the command string.

In any case, you may want to print all messages on the debug window or on a file and study the last ones after the abnormal condition is met, at least to discriminate wether all messager are sintactically correct or no.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 7
(3,934 Views)

I got a problem a few times where the bytes sent to my UUT by ComWrt are not actually sent until the code hits a Delay function.
I found the problem to be that the operating system, somehow, queues the messages sent by ComWrt but does not let them out of the buffer.
Similarly, maybe your UUT does not respond because it did not receive any commands at all.

I solved it by configuring the port output buffer size as 0 (using OpenComConfig). In that case the bytes are written directly to the output not to a buffer.
Could you please try this?

When my application caused the problem I mentioned the CVI's sample project serial.prj was working properly. You can also use it as a troubleshooting tool.
You can send ASCII commands easily with it.

Hope this helps.

Message Edited by ebalci on 06-07-2007 05:10 PM

S. Eren BALCI
IMESTEK
0 Kudos
Message 3 of 7
(3,921 Views)
I'm having simular problem that's driving me nuts.  Using Labview 8.2.   I'm communicating with several items in a control situation. 
System hardware.
PC P4 running XP Pro
National Instruments 4 port com board to give me 5 ports.
NI-DAQ
6B Digital I/O
Using Visa vis to set-up com ports
6B vis to communicate

This system is designed to run at night.  At some point in it's 12 to 14 hour run cycle an error crops up.
CODE -1073807339
TEXT -  Visa Read in data collect.vi->main.vi

Main.vi is the top level vi.  data collect is a subvi.

Hope somebody can shed some light.

Thanks
0 Kudos
Message 4 of 7
(3,912 Views)
I forgot to add then when the error message shows up all communication via that com port stops.
0 Kudos
Message 5 of 7
(3,905 Views)
Error -1073807339 can also be due to a missing termination character as Roberto B mentioned earlier,  it be possible that your message is sometimes incomplete and the UUT is waiting for completion.  You may want to "print all messages on the debug window or on a file and study the last ones after the abnormal condition is met, at least to discriminate wether all messager are sintactically correct or no."  If this doesn't solve the problem let us know.
John E.
Applications Engineering
National Instruments
0 Kudos
Message 6 of 7
(3,861 Views)

I discovered the problem. 

I'm taking several readings from product via visa vis.  When one stops talking it set a failure in the error cluster.  When that failure is passed to a control visa vi it stops.

Work around... Put dumming error in and error out clusters and don't pass it along.  So far that seems to work.  

I wish the Visa vis wouldn't just stop when there's an incoming error,  but alas, I don't have control over that.

 

Thanks for your input.

 

Byron Kinnaman

0 Kudos
Message 7 of 7
(3,854 Views)