Sri,
The image did not link correctly to the forum page. It is usually easier to add image files as an attachment.
However, I think I get can get you started. The Login and Logout is handled by a sequence call from the TestStand Engine. Specifically, the FrontEndCallbacks.seq and its supporting C files are found in the <TestStand>\Componenets\NI\Callbacks\FrontEnd\ directory. The C files are dependent upon the CVI Run Time Engine, which is freely distributed. You are free to modify or replace the current Login/Logout structure. It may be easiest for you to implement your own Login form, however I would take a look at the source files in the FrontEnd directory in order to understand the functionality.
The Login code activates a User from the Engine user list. Users represent a TestStand user with a name, login information, and priviledges. The priviledges allow the administrator to restrict or allow certain activities within TestStand. Priviledges include debugging sequences, executing sequences, or editing sequences. These priviledges can be set programatically, but the current user must have administrative priviledges in order to change User information. For your case, when the user logs in as Automated mode, you could programmatically set the privledges to only allow execution. For Engineering mode, the privledges can be reset to allow debugging and execution. For more information on User management, check Chapter 7 of the TestStand Reference Manual.
If I am correct, the last part of your project is to programmatically load and execute a Sequence File. The easiest way to open a Sequence File automatically is to use the Open Sequence File command. Commands are analogous to functors in OO programming. They are objects that represent an action to be handled by the OI manager controls. The Manager controls automatically have several commands that perform common tasks such as Opening a Sequence File or Executing a Sequence File. The Manager Controls have a method called GetCommand, which returns the reference to a command object. Once the command object is acquired, you can call the Execute method to perform the command action. The TestStand UI Help lists all the available Commands for the TestStand OI. They are listed in an enumeration under CommandKinds. CommandKind_OpenSequenceFile will open a dialog that allows the user to select a Sequence File. The selected Sequence File is then automatically loaded into the SequenceFileViewMgr control. You can use the CommandKind_RunEntryPoint to execute a Sequence from a given Process Model entry point. The RunEntryPoint command expects an index into an Entry Point of the current Process Model. If Single Pass is the first execution Entry Point of the Process Model, then the index is 0.
Let me know if you have any questions.
Thanks,
Tyler Tigue
NI