07-05-2005 12:11 PM
07-06-2005 05:48 AM
07-06-2005 06:55 AM
I have tried making the VI property >> Window appearance >> Dialog.
This does make the front panel come up in front of everything else, but it does this every time, all the time. I can't make it dependent on the value of some variable in TestStand. In TestStand also there is a a check box when one selects and configures the VI for the step, that says something like "open front panel when called". But that check box is a developer level thing at script development time, not a run time thing. It too is essentially a compile time option. I'd like to find a way that I could run an expression before the step that would set that little option.
07-06-2005 08:52 AM
07-06-2005 09:05 AM
Just remembered, you can't use the TestStand modal VI from within a subVI - it will only work if within the top-level VI, as it makes the VI that called it modal
If you have a look in the VI itself though, you'll see how it works - it uses the call chain function to get the calling VI's name. It takes element 1 of the call chain (the VI above itself). By copying its innards into a new VI you should be able to make an equivalent that would work from lower down the call chain. I haven't tried it, but I think you could use the second-highest index of the call chain to give the top-level VI. The highest one is some kind of proxycaller that TestStand interfaces with - the one below that is your called VI. This fix needs to be made by NI really, as it's a pain having to use this in your top-level VI for it to work.
07-06-2005 09:07 AM
In fact, from looking at it, it seems to open the front panel too, so you won't need to use the VI server as it does it for you.
07-06-2005 11:40 AM
07-06-2005 11:46 AM
Sean, The reason for doing this is that the client wants a "debug level" control of some sort. If set below some value, the VIs just do their thing, take their measurements, report, or whatever and go on their way blindly as what we expect a good test sequence to do. However when this value is set above some level (the threshold may be different for various categories of tests) the VI becomes interactive. This would allow an operator to see a measured value, and possibly tinker with the instrument parameters or the UUT, before continuing on. This might be similar to a single step command, but not necessarily pausing at every step. Inside of the VI I can test the value of the variable (either passed in through the connector pane or via the sequence context) and thus decide whether to be interactive or silent. I can also use the VI server to open my front panel or not. But in doing so, even though I try to make the VI panel frontmost, it is hidden by Teststand. If the VI attribute is "dialog" then it does show up on top of everything else, but unfortunately does so even when I don't tell it to open at all.
PC
07-06-2005 11:57 AM
Adam, Thanks. I knew it had to be in there somewhere. I even tried to use a preceeding LV step to access the API to touch any and all steps that might need to show theit panels. But this hidden attribute you mention seems to be just the thing I need. I am heading out to the lab to try it now. I wonder if I can set this bit in a Pre expression for the step it is trying to control, or whether it must be in any preceeding step. I will probably have found this out myself by the time I get back to read your reply. Thanks again.
PC
07-07-2005 03:57 AM
I'd be inclined to pass the user information down to the VI, then have a single subVI in all the VI's that has a look at the privilege level and decides whether to pop up and wait for user action. Your VI will need to know whether it's going to pop up anyway, as it needs to know whether to wait for the OK from the user.
I'd (ab)use one of the existing privileges for this purpose, e.g. StationGlobals.TS.CurrentUser.Privileges.Debug.ControlExecFlow. Pass this boolean to the VI and let it decide what to do. Or you could add an additional privilege to the User Types (I've never tried this, but I'm sure you can).
This is just my preference - as I said, I try to keep as little as possible in TestStand.