Steve Drake wrote:
>
> Hello, has anyone had a problem with a LabView program hanging on an
> NT platform?
>
> We have a fairly simple app that uses the serial port to receive
> data and a DIO-6503 card to control some actions. We used appbuilder
> to create an executable and now the program sometime hangs. I have
> seen the program run for 5 days in a row without a problem.
>
> Just some more about the app. We received packages of 8 bytes every
> 32ms and they are transmitted at 19.2k. After taking apart a 1/2
> second of this data we plot the values on a graph. If we get an event
> we will save the information to a file on a network drive but for now
> we have been saving on the local drive.
>
> We also noticed that the NT machine says the program is taking just
> about 100% of the CPU time. Is that normal, I kept all my priorites
> at normal.
>
> How would you trouble shoot this, I wanted to see if NISpy would
> help but I was told it was used for VISA and GPIB spying. I'm not
> using any of those.
>
> Thanks in advance for any tips or places to look.
>
> Regards,
>
> Steve Drake
Steve,
As Kent mentioned, any while loops (user interface or serial port
polling) definitely need waits under NT. NT acts significantly
different in this regard than W9x, and a while loop without a wait can
almost lock up an NT machine.
Since you said you are not using VISA, I'm guessing the problem may
be with how you implemented the serial port reads. Since the basic
serial port read has no time-out capability, you need to build that up
on your own. (Or you can down-load some serial port utilities from
various archives.) Basically, in your serial port read section, put a
while loop (with at least a 1ms wait) and a Bytes at Serial Port
function. Exit the while loop when you get enough bytes to read a full
data set or when a timer you set up expires. This is easiest if you
expect a fixed number of bytes to be returned. If you need to wait
until a particular end-of-transmission character, then put the Serial
Port Read inside a case inside the while loop, and read whenever there
are 1 or more bytes available. Append what you read to anything you
read on previous iterations, and search the string for the termination
character. You can also save any extra characters that might have been
read after the termination character for the next call, but that may not
be necessary.
Hope that helps,
Dave Thomson
-------------------------------------------------------------
David Thomson 303-499-1973 (voice and fax)
Original Code Consulting dthomson@originalcode.com
www.originalcode.com
National Instruments Alliance Program Member
-------------------------------------------------------------
Research Scientist 303-497-3470 (voice)
NOAA Aeronomy Laboratory 303-497-5373 (fax)
Boulder, Colorado dthomson@al.noaa.gov
-------------------------------------------------------------