LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to prevent/Minimize WindowsXP interference

I have an application that is troubled by Windows occasionally interputing a two step process and need to eliminate or minimize this interuption.  More specifically  I have an instrument that I need to obtain two pieces of information from- counts and livetime.  This must occur by first requesting the livetime then the counts in separate calls to the instrument.  Unfortunately, Windose often interputs the process with its own calls (that can last for a second or more) and completly messes things up.
 
My question is there anyway to (even briefly) lock the system resources so that for my two critical call no other process can interupt my code?  These calls are quick and painless (less than 50ms) total time consumed, and occur only once every half second (or more).
 
Any suggestions or help would be greatly appreciated?
 
John
 
0 Kudos
Message 1 of 11
(4,015 Views)
The easy things: turn off XP annoyances/ eye candy/ etc

http://www.tweakhound.com/xp/xptweaks/supertweaks1.htm

On the labview side go to

file>vi properties> execution

and set to highest priority.


0 Kudos
Message 2 of 11
(4,016 Views)
thanks fro the suggestions.  However I was under the impression that the priority settings affected the overall application (not sub vi). And in general setting the application priority that high has caused more problems that it has solved.  Are you saying that I can set the priority of a subiv to TimeCritical so that the execution of the code within the subvi (and only the subvi) executes at the higher priority?
 
 
0 Kudos
Message 3 of 11
(4,005 Views)
Yes you can. In the properties of a VI you can select the priority of the VI. This is the minimal priority the VI runs with. If the VI is called from a VI with deeper priority, it (the SubVI) is executed with higher priority.
Check the LabVIEW help for further informations. A good start is here: http://zone.ni.com/reference/en-XX/help/371361B-01/lvdialog/execution/
 
I hope this helps
 
Greetings
shb
0 Kudos
Message 4 of 11
(3,987 Views)
Is this a GPIB/SCPI type instrument? Does it support buffering?

Even if your instrument supports buffering, the driver you're using may not be written to take advanage of this. You might need to write a simple vi that would send the commands together (typically separated by a semicolon) , then a second vi to read the value(s) from the instrument. You might need to parse the return string to separate the values.

If you can tell us more about the instrument, someone here may be able to help...

0 Kudos
Message 5 of 11
(3,986 Views)

The instrument in question is the Digibase from Ortec.  It does not support buffering (unfortunately).

I have tried optimizing some of the windows stuff related to the eye-candy (no shadows, classic style etc).  Though I have not yet optimized the services (or removing services).  The computer I am using for the data collection is Fujistu lifebook (one of the P1500 series ultra small computers).  This variant has 512 Mb RAM.

In addtion to my data acquisition program I have a database (MYSQL) running which I write the data into.

I have tried the option of setting the execution priority to "Time Critical" for the portion of the code that reads the various pieces of data from the Digibase.  However it seem that windows/other processes still manage to get in between my calls to the Digibase.  To recap I need to read the livetime and the total counts (or spectra)  this requires that I send a command to the digibase to stop the data acquisition , I then send a command to read the live time, and read the return value.  Then send a command to read the spectra (or total counts) and the read the return, and finally send a command to start the data collection.  However to aid in diagnosing the windows interuption problem I do not stop and restart data acquisition thus any time delays caused by excessive delays between the two reads becomes readily apparant.  (The Digibase is set to count at a high data rate which is nominally constant so that the calculated count rate   (counts/livetime) should be a constant -minus statisical flucuations).  The results indicate that windows/or other processes manage to sneak in between my calls to read the data about once every 50 to 200 trys no matter what I do. Bottom line is that there does not seem to be a shurefire way to prevent other process from interrupting my data acquisition even for a very brief time.  Or is there??  I sure long for the days of cooperive (or uncooperative) multitasking.

I am still pursuing the optimization of windows services and background tasks.  If anyone has a good reference I would love to hear it.  Presently I have explored a number of the on-line references such as the extreme tech tuneup hints such as(www.extremetech.com/article2/0,1558,5155,00.asp)

In the end I am affraid I may be asking the impossible of Windows, and since this equipment does not have drivers truly compatible with QNX, I may simply have to find a plan B.  But I can't help but think that this should be possible since the actual computation and bandwidth requirements of this application are very modest.

Thanks again for all the help and suggestions

0 Kudos
Message 6 of 11
(3,954 Views)
0 Kudos
Message 7 of 11
(3,941 Views)
Without seeing your code. Do you open a session with a comm port?? Do you close this session after each command?? Maybe you could Open the session in a while loop by passing the refnum around with a shift register. Then Close the session outside the while loop, when the program terminates.
0 Kudos
Message 8 of 11
(3,936 Views)

The device is a USB device, and I open the connection once then close when I am exiting the program. 

I will try the Application versus Background process settings and post the results.

0 Kudos
Message 9 of 11
(3,916 Views)
Well, I tried to set the optimization for background services instead of applications as suggested.  Unfortunately this made no noticable difference.  There seems to be no point in dragging this out further so I will simply have to live with what I have got.  Looking towards the future I will have to move away from anything windows to a more real-time system.
 
Thanks to all for the help.
 
John
0 Kudos
Message 10 of 11
(3,747 Views)