NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Showing module front panels while running a sequence using classes

Hello All,

 

I have an issue that I have been struggling with.  NI support has been working on it for a week and we haven't come up with a fix yet, so I wanted to check here to see if anybody in the community has dealt with this before and can maybe give me a good solution.  Here is what I am trying to do:

 

I created a class in LabVIEW that I call TS Module Interface.  This module interface will handle a few different things like monitoring the TS Status Monitor to watch for the sequence being terminated.  But it also has some logic in it that determines if I am in debug mode and will launch some of the front panels based on that logic.  So in the code that I am attaching, I have a TestStand Sequence that calls a code module (Main VI.vi).  And this code module calls a class member/subvi called "Start Module.vi".  The SubVI determines if  I should show the front panel, and if so, it calls the VI "TS Start Modal Dialog.vi".  The TS Start Modal Dialog VI can either use a reference to the Sequence Context or a reference to the Engine.  If I use the reference to the seqeunce context, I always get the error that is attached.  If I use the engiine reference, it behaves correctly the first time I call Main VI, but if I call it a second time from that sequence, it throws that same error.  

 

I believe that somehow one of my references is getting closed or is going bad, but the block diagrams are locked for these TS VIs, so I can't see what exactly is going wrong inside of them.  

 

Does anybody have  a solution different from using these TS VIs or does anybody know what I am doing wrong? 

 

To look at the source code, in the attached zip file, there are 3 sequences:

Using Direct Calls.seq does not use my LV Class, but displays the behavior that I am looking for.  

Using Engiine.seq uses my class and uses the engine reference.  You should see 1 front panel display when you run this one, but then it will error out on the second.

Using seq context.seq uses my class and the sequence context referece.  This one seems like it would be the preferred way, but it errors out on the first try.  

 

Thanks, 

Scott

Download All
0 Kudos
Message 1 of 3
(4,073 Views)

Well, you complicating easy things, dont use LV classes for such easy things, its becaouse of your classes,

From my expierence TS can't handle LV classes in many ways, anyway if you MUST use it use it properly, you need to pass LV classes to teststand via binary string not references,

Use Flatten/Unflatten functions in LV as NI recommends

Second things dont pass TS references to locals or any other variables, what for? u have access to them in any place in teststand so u dont need to store them anywhere

 

So for me if you really must use class for silly thing you do, use flatten/unflatten, and remove case from your Vis, and use ThisContext reference, and store it inside your class, pointless

 

0 Kudos
Message 2 of 3
(4,038 Views)

Wojciech,

 

I appreciate you replying and trying to help.  I know that in the past, TestStand did not support classes very well, but they started officially supporting them in TS 2010.  By TS 2014, I would expect these to work.  

 

Also, I spent a significant amount of time stripping down my code to a very simple example so that I could work with NI support to see if they could help me figure this out.  So while you think it is silly to do these simple functions within a class, there is much more reason for it in my full application.  I stripped out all that functionality so that I didn't have to share it with you.  But thank you for your added criticism about how I shouldn't make simple tasks more complicated.  

0 Kudos
Message 3 of 3
(4,023 Views)