Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Close NI Swtich Executive Session

If I have a software crash, is there a way I can close any open NI Switch Executive sessions similar to doing a reset on hardware so I can run my LabVIEW and/or TestStan routines again? 

 

So far the only way I can figure out to use Switch Executive again is to shut down LabVIEW and open it again to remove the open session.  I couldn't find anything in MAX to reset my virtual device and in LabVIEW if I open the close session VI I cannot run it without knowing the reference to the open session.  Other instrument drivers often have a pull down type list so you can find an open session this way and run the close VI but the session control in Switch Executive is not a pull down type control.

0 Kudos
Message 1 of 6
(6,457 Views)

Hello Brian, this is Paul with Applications Engineering at NI.

 

First, I'd like to understand a little more about your crash.  Is this a LabVIEW or TestStand crash?  Is this happening frequently?  Have you troubleshot it yet?  Obviously we would like to never have you be in the position of having to recover after a crash, but we understand that not everything is perfect.

 

Since you are experiencing a crash, that eliminates the possibilities to use variables etc for what you need to.  The first idea that came to mind was to store that reference in a file, which could be loaded later.  I successfully tested the very simple VI below to do what I am talking about.  In the first part I open a session to a NISE VirtualDevice.  Once that reference is opened, then I save it to a binary file.  I skipped on generating the prompts and options, etc, but you could configure yours as necessary.  In the second half I perform a read of that binary file that I created in the first half and feed it to the Close function.  The constant going into the Data Type input of the 'Read Binary File' was created from the reference that came out of the Open function.  Note that this is only specifying the data type here, the data inside that constant is irrelevant.  On my system this opens and closes the NISE session without error.  I'd recommend giving something like it a try, and seeing if it works for you.  We'd still rather narrow in on why you are experiencing crashes, and address that first though.

 

Save NISE reference to file.png

 

 

 

Paul Davidson
National Instruments
Product Owner - ni.com Chat
0 Kudos
Message 2 of 6
(6,450 Views)

I realized after the fact that I forgot an all-important step in the code. Closing out the binary files reference!  Below is the code with the close references included, and I also went ahead and threw in some labels also.

 

Save NISE reference to file.png

Paul Davidson
National Instruments
Product Owner - ni.com Chat
0 Kudos
Message 3 of 6
(6,443 Views)

Hi Paul,

 

The crashes are sometimes a hard crash of LabVIEW or TestStand but usually where I have to click on abort on my LabVIEW VIs during development where something is hung up somewhere and my code is not complete to account for smooth recovery of such events so I am left with clicking the abort or the x on the particular VI.  TestStand is a bit more forgiving as generally I can get it to do the cleanup which will close out my switch session.  

 

I realize the saving to file would work but was hoping there was something easier like right clicking somewhere in MAX and selecting an option or running a VI in LabVIEW that can find and close an open session.  As a feature suggestion for Switch Executive, I would like to see pull down controls for the sessions as well as the Virtual Device names and the routes/route groups.  I found it odd that this is not there already for Switch Executive since it is farily standard in all the drivers such as NI-DAQ or NI-Switch for sessions and device names.  Is there a reason they do not use controls like this for Switch Executive?

 

If you or anyone can think of anything else that doesn't require file I/O, please let me know.  For now I will probably just stick with exiting LV and re-opening since this doesn't happen often.

 

-Brian 

0 Kudos
Message 4 of 6
(6,440 Views)

Brian,

 

Have you been able to pinpoint or reproduce where these errors or crashes are occurring?  Has LabVIEW or TestStand ever offered to generate crash logs for you?  There's a lot of different ways you could approach it, but I would recommend trying to address those root issues.  Whether it be fixing up your code, or NI software issues we'd like to see you up and running consistently.  Especially if it is a LabVIEW, TestStand or Switch Executive issue, if there is a bug in our software, we'd like to address it.  If you'd like to tackle those issues, it would probably be best to either place a Service Request with us, or post on the section corresponding to that software on our forums.

 

I've done some extra searching, and I wasn't able to find any additional methods of closing out the sessions like you are requesting.  We don't really have a method of keeping up with these references, especially once LabVIEW has crashed.  I still believe the most robust method would be saving to a file.  An example of the implementation would be to save the file once the session is opened in your main program.  You wouldn't need any prompts or anything, and you could save it to one of the public folders on the computer, like the Application Data directory.  Then to perform the close, you could either have a small standalone program that basically does what the second part of my code does, or your could implement it at the beginning of your main VI as an option to perform on startup.

 

As for having to use strings as opposed to pull-downs, this is a lower level issue with how our drivers, LabVIEW and MAX interact with each other.  It is fairly common in other uses, like DAQmx to have to do this as well.  Nevertheless, our Product Support Engineers monitor these boards, and are always looking at the suggestions made, so your suggestion will be taken into account.  Additionally, you may want to post this suggestion or others to our idea exchange where we actively take feedback directly from our customers and implement it into future versions, as possible:  http://forums.ni.com/t5/NI-Idea-Exchange/ct-p/ideas  

Paul Davidson
National Instruments
Product Owner - ni.com Chat
0 Kudos
Message 5 of 6
(6,427 Views)

Hi Brian,

 

Thanks a lot for your feedback.  I like the idea of having Switch Executive drop down selectors as well (The official term is I/O control). It could definitely save time in NISE development, and I am going to add it to our list of possible features for future releases.

 

Paul is right, to gain this functionality requires tighter integration between LabVIEW and MAX, and now NISE, too.  Currently LabVIEW and NISE only communicate at run-time, and not edit-time (required for the I/O control).  Creating the communication during edit-time would require a non-trivial amount of work, as the architecure for DAQmx devices is very different than NISE Virtual Devices.

 

Again, thanks for the feedback, and if you have any more tips on how we can improve NISE please let me know.

Eric S.
AE Specialist | Global Support
National Instruments
0 Kudos
Message 6 of 6
(6,419 Views)