02-20-2008 08:17 PM
02-21-2008 03:10 PM
02-22-2008 12:45 PM
02-22-2008 03:52 PM
02-25-2008 09:16 AM
11-13-2008 11:47 AM
Hi,
Believe it or not I'm just now getting back to this. Other things on the project took priority but this is on the front seat again as a result of other developed software.
So when I implement your suggestion, I now get a "Error -2147467261 occurred at Invalid pointer" on the output of the step which has the "GetSequence reference" input. But I do not get this error when using the UI Application manager reference. I have attached a screen shot of the error and the vi. So I tried opening the sequence reference differently, using the engine property, but I still get the same error. I have attached the vi. It seems like it does not like the sequence reference pointer when using the application manager from the teststand engine. Do you see anything wrong here? I attached the vi too.
thanks
12-31-2008 08:27 AM - edited 12-31-2008 08:29 AM
Hi David,
You are getting this error because you can not have different managers in different threads. In general all the manager controls and all the visible UI controls must be in the same UI thread. Using the application manager in a different thread and with controls on a different VI is not the normal use case and not something we've tested thoroughly and causes unexpected behavior as you may have noticed. One of the TestStand developers posted about a similar issue in a different thread:
http://forums.ni.com/ni/board/message?board.id=330&message.id=22469#M22469
So, I think the way to go in your case is to create a new Application Manager in your code module, which you said you did get working. One thing to keep in mind about this is that you can only have one Application Manager per process. So, this will work if you are using the LabVIEW development environment when the code module is called. Because it is using the LabVIEW development environment's process which is different from the Sequence Editor's, it keeps the two Application Managers from conflicting. However, if you change it so that step is run with the LabVIEW runtime you will notice that it will not work. You could also build the VI into an executable that you call from a sequence and that will also work, since the executable will have it's own process.
Your original problem with this approach was that you did not want your user to have to log in again. While you cannot programmatically log in, you can check the privileges of the current user and if they have sufficient privileges then you can set a few station options and an option of the Application Manager to suppress login.
So if you were to pass the SequenceContext into your code module, you can get a reference to the StationGlobals, and then use GetValBoolean with the lookup string "TS.CurrentUser.Privileges.Develop.EditSequenceFiles" to see if the user is allowed to edit sequence files.
Then to suppress login:
- Set the property of the ApplicationManager, LoginOnStart, to false
- Get a reference to the StationOptions from the Engine and set StationOptions.RequireUserLogin and StationOptions.EnableUserPrivilegeChecking to false
I'll attach a couple screenshots of how to set those. I'm also going to attach my VI which shows how I set it all up. It is in LabVIEW 8.6, so let me know if you need an earlier version.
Let me know if you have any questions or if any of this was unclear.
01-05-2009 01:06 PM
Kristen,
This does make a lot of sense, thanks for the reply on this issue.
I think I may have another method in mind which I'm experimenting with. It seems like I can have a sequence, which itself actually automates open/close of other sequences. I can use a labview gui to control "continue/save/cancel? etc. This way I can actually use the editing environment already initialized. This may be simpler, wish I'd have thought of it earlier (if it works).
Thanks