Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

switch executive memory leak

 
I have a LV program with switch executive session and it goes by the flow like this
 
 
  NISE Open session -> Open all switches -> switch a selected one -> [perform some acquisition tasks] -> open the switch -> NISE Close session
 
The above task should be performed for more than thousand time in a while loop.
 
Now the problem with the program is, after about 700 times of loop it will stop
saying memory is available.
 
Does this means each time when I open a NISE Session will it allocate new memory?
in the acquistion side I am using DAQ clear task so memory allocated in the acquistion section is
cleared out?
 
I want to know whether do you have perform some similar things to the NISE sesion also?
I couldnt find any KBs on this matter?
 
Please some one help in this matter.
If quick I am really grateful...
 
Naushica
 
 
 
 
 
0 Kudos
Message 1 of 5
(7,336 Views)
I have a LV program with switch executive session and it goes by the flow like this
 
 
  NISE Open session -> Open all switches -> switch a selected one -> [perform some Data acquisition tasks] -> open the switch -> NISE Close session
 
The above task should be performed for more than thousand time in a while loop.
 
Now the problem with the program is, after about 700 times of loop it will stop
saying not enough memory
 
Does this means each time when I open a NISE Session it will allocate new memory?
in the acquistion side I am using DAQ clear task so memory allocated in the acquistion section is
cleared out.
 
I want to know whether do you have perform some similar things to the NISE sesion also?
I couldnt find any KBs on this matter?
 
Please some one help in this matter.
If quick I am really grateful...
 
Naushica
 
0 Kudos
Message 2 of 5
(7,330 Views)
The quickest solution to use in this case (without getting into why you get a leak which may or may not be in switch executive library, probably not) is to stop opening and closing your session in the loop.

Your program flow should be:
open session -> loop ( close necessary switches, acquire, open switches) -> close session.

NISE calls into specific driver for the instrument you use, which gets loaded and unloaded. The effects of loading and unloading the specific driver may be adverse, too.

Hope this helps,
0 Kudos
Message 3 of 5
(7,314 Views)
Ok,
Is there a vi like "NISE session clear"  like for the acquistion you have "DAQmx Clear task.vi"?
Putting the NISE start  & NISE stop outside the loop is one option, but It seems unless you
completely shutdown the LabVIEW session you cant clear out the memory allocated by the
NISE session.
 
Is there any vi to clear out?
 
Rg Naushica
 
0 Kudos
Message 4 of 5
(7,296 Views)
I appreciate the efforts you are willing to put in discovering the cause of the leak here. To really establish where is the leak, i.e. what component causes it, we would need to start by isolating different parts of the system.

So, your current loop includes three (at least) independent libraries, and we need to test one by one. The three libraries mentioned are NI Switch Executive (please specify version), the specific driver(s) that you use (please list those as well), and the DAQmx (veersion?).

To start the discovery, please comment out the DAQ acquisition calls, and instead of using your virtual device, use the sample virtual device that relies on the installed "SampleSwitch" simulated switch module that we will assume at this time has no memory leaks.

Adjust the channel names (so that the sample configuration can recognize those) and rerun your loop.

For this test, you want to keep the nise open session and nise close session VIs in the loop, but please, in your applications, don't do that. Avoid doing unnecessary repetitive work as often as possible.

Once you establish that there is no leak with using NISE alone, include the specific driver (by using your original configuration), retest, and then in the end include the data acquisition portion.

Also, let us know the results of the intermediary steps and the versions/types of switches you use I asked about above.

best regards,

-Serge
0 Kudos
Message 5 of 5
(7,285 Views)