Example Code

Automatic User Log out and Termination of Sequence Between Executions on Single Pass of TestStand

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

    Operating System

  • Windows

Code and Documents

Attachment

Description

If you are trying to fulfil the FDA CFR Part11 requirement that [TestStand] shall log out the user if the user is inactive for 15 minutes. How can you implement this in TestStand?

 

 

How to Use

 

Set-Up:

  1. Open NI TestStand 2019
  2. Download the SequentialModel with Watchdog sequence found in the Attachment section
  3. Create a new sequence that opens a message pop-up
  4. Go to Edit and select Sequence File Properties
  5. Go the Advanced and in Model Option: choose Require Specific Model
  6. Select the Sequence File with Watchdog file.
    1. This has now set the process model for the new sequence to be the Sequence File with Watchdog.
  7. To test the sequence, go to Execute and select Single Pass.

Expected Results:

  1. Once clicking "OK" on the message pop-up, a message will appear saying "Watchdog Started" 
  2. This will then disappear.
  3. If you Restart the sequence another message pop-up will appear saying "Watchdog Reset"
  4. This will then disappear.
  5. If you wait 15seconds before starting a new execution a message pop-up will appear saying "Logged out Terminated Execution"
  6. The user will be logged out (greyed out functions) and the sequence terminated.

 

Additional Information

The example is written for a single-pass entry point. I have mapped the code across to the Test UUTs entry point, which does work, however, this can be improved by:

  • In the current code mechanism, offering a choice to the user to log out of the system depending on inactivity between UUTs or between executions.
  • Considering the UUT Serial Number input box is already waiting, implementing a timeout feature here would be a better/cleaner approach.

Additional Information of attached method:

  • The SequenceFileLoad callback is used to create the station globals that are required for this Process Model to operate.
  • The watchdog is started in a new execution which enables it to run in the background when the main sequence is finished.
  • The time for the watchdog to look for inactivity is found as Locals.TimeLimit in the Watchdog Sequence.
    • Note that there is also a wait interval function that can be changed in the Watchdog sequence.

 

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors