Queue Step

TestStand 2017 Help

Edition Date: November 2017

Part Number: 370052W-01

»View Product Info

Download Help (Windows Only)
NI TestStand 2014 Help
NI TestStand 2014 SP1 Help
TestStand 2016 Help
TestStand 2016 SP1 Help
TestStand 2017 Help

Use a Queue step to synchronize the production and consumption of data among threads. An Enqueue operation places a data item on the queue and blocks when the queue is full. A Dequeue operation removes an item from the queue and blocks when the queue is empty. When multiple threads block on the same Queue operation, the threads unblock in first-in first-out order.

Configuring the Step

Use the Queue Settings edit tab in the TestStand Sequence Editor and the Queue Step Configuration dialog box in a TestStand User Interface to configure the Queue step.

Step Properties

In addition to the common custom properties, the Queue step type defines the following step properties:

  • Step.Result.TimeoutOccurred—Exists only when you configure the step for the Enqueue or Dequeue operation. TestStand sets the value to True when an Enqueue or Dequeue operation times out.
    Note Note  If you configure the step to use the Enqueue or Dequeue operation programmatically using the Step.Operation property, you must also create the Step.Result.TimeoutOccurred property using the newProperty() method for the step to execute successfully.
  • Step.NameOrRefExpr—Contains the Queue Name expression for the Create operation and the Queue Name or Reference expression for all other Queue operations. For the Dequeue operation, the expression can also specify an array of names or references.
  • Step.LifetimeRefExpr—The object reference expression for the Queue Reference Lifetime when you set the lifetime to Use Object Reference.
  • Step.TimeoutEnabled—The Timeout Enabled setting for the Enqueue or Dequeue operation.
  • Step.TimeoutExpr—The Timeout expression, in seconds, for the Enqueue or Dequeue operation.
  • Step.ErrorOnTimeout—The Timeout Causes Run-Time Error setting for the Enqueue or Dequeue operation.
  • Step.AlreadyExistsExpr—Contains the Already Exists expression for the Create operation or the Queue Exists expression for the Get Status operation.
  • Step.MaxNumElementsExpr—The expression that specifies the maximum number of queue elements for the Create operation.
  • Step.MaxNumElementsOutExpr—The expression that specifies where to store the maximum number of queue elements for the Get Status operation.
  • Step.NumThreadsWaitingEnqueueExpr—The expression that specifies where to store the number of threads waiting to enqueue for the Get Status operation.
  • Step.NumThreadsWaitingDequeueExpr—The expression that specifies where to store the number of threads waiting to dequeue for the Get Status operation.
  • Step.Operation—A value that specifies the operation for the step to perform. The valid values are 0 = Create, 1 = Enqueue, 2 = Dequeue, 3 = Flush, and 4 = Get Status.
  • Step.Lifetime—A value that specifies the lifetime setting to use for the Create operation. The valid values are 0 = Same as Sequence, 1 = Same as Thread, 2 = Use Object Reference, and 3 = Same as Execution.
  • Step.NumElementsExpr—The expression that specifies where to store the current number of queue elements for the Get Status operation.
  • Step.DataExpr—Contains the New Element to Enqueue expression for the Enqueue operation, the Location to Store Element expression for the Dequeue operation, and the Location to Store Array of Queue Elements expression for the Flush or Get Status operation.
  • Step.ByRef—The Boolean value that specifies to store a queue element by object reference instead of by value for the Enqueue operation.
  • Step.EnqueueLocation—A value that specifies the location to store the queue element for the Enqueue operation. The valid values are 0 = Front of Queue and 1 = Back of Queue.
  • Step.DequeueLocation—A value that specifies the location from which to remove the queue element for the Dequeue operation. The valid values are 0 = Front of Queue and 1 = Back of Queue.
  • Step.FullQueueOption—A value that specifies the options for the If the Queue is Full setting of the Enqueue operation. The valid values are 0 = Wait, 1 = Discard Front Element, 2 = Discard Back Element, and 3 = Do Not Enqueue.
  • Step.RemoveElement—A Boolean value that specifies to remove the element from the queue when the step performs the Dequeue operation.
  • Step.WhichQueueExpr—The expression that specifies where to store the array offset of the queue on which the Dequeue operation occurs.

See Also

Coordinating Test Socket Data with Queue Steps (Example)

WAS THIS ARTICLE HELPFUL?

Not Helpful