Action VI Templates

NI VeriStand 2018 Help

Edition Date: May 2018

Part Number: 372846M-01

»View Product Info
Download Help (Windows Only)

Parent Topic: Automating Responses to User Actions with Action VIs

The Action VI templates are located in the Custom Device API library. NI VeriStand provides the following templates from which you can create an Action VI:

Related Links

Automating Responses to User Actions with Action VIs

Adding Action VIs to a Custom Device

Custom Device API library

ActionVIOnLoad

Action VIs built from the ActionVIOnLoad template execute when NI VeriStand loads a custom device item into memory. This template is especially useful for creating Action VIs that launch background processes. For example, if your custom device requires large amounts of data, you can customize the ActionVIOnLoad template to start a daemon that runs processes or gathers data in the background.

ActionVIOnDeleteRequest

Action VIs built from the ActionVIOnDeleteRequest template execute when a user tries to delete an item from the custom device. This template is especially useful for creating Action VIs that prevent a user from deleting a custom device item or warn a user of the implications of deleting a custom device item.

The following block diagram shows the ActionVIOnDeleteRequest template, which is followed by a description of its unique parameters.

  • Item Ref in is the reference to the custom device item whose XML declaration calls this Action VI.
  • Refs that are about to get deleted is a 1D array of references to the items to be deleted. However, the 1D array will only contain one reference, as users can only delete one item at a time in the System Explorer window.
  • Discard reason is an output you can use to capture the user's reason for deleting the item.
  • Discard delete request? allows you to discard the delete request. After the Action VI finishes executing, NI VeriStand will evaluate this output to determine whether or not to delete the item. If TRUE, NI VeriStand will not delete the item. If FALSE, NI VeriStand will delete the item.
  • Additional items to delete is an array of references to additional items you want to delete. For example, if other custom device items depend on the item the user wants to delete, you can use this output to automatically delete those items.

ActionVIOnDelete

Whereas the Action VIs from the ActionVIOnDeleteRequest template execute before NI VeriStand deletes the item, Actions VIs built from the ActionVIOnDelete template execute after a user deletes an item from the custom device. You can customize this template to alert users which channel mappings break when they delete the custom device item. You can also customize this template to reconfigure hardware. For example, if the user deletes a page that specifies custom configuration data for your hardware, you can customize the ActionVIOnDelete template to return the configuration to default settings.

ActionVIOnSystemShutdown

Action VIs built from the ActionVIOnSystemShutdown template execute when the System Explorer window closes. You can customize this template to close hardware connections or to close daemons you launch from an ActionVIOnLoad Action VI.

  • Device Item Ref in is the reference to the custom device item whose XML declaration calls this Action VI.
  • Unload SDF? indicates whether or not the system definition file was unloaded. Unload SDF? is always TRUE.
  • Saved? indicates whether or not a user saved the system definition file before closing the System Explorer window.
  • Path is the path on disk to the system definition file.
  • System Explorer Shutdown? indicates whether or not the System Explorer window closed. System Explorer Shutdown? is always TRUE.

ActionVIOnSave

Action VIs created from the ActionVIOnSave template execute when a user saves the system definition file. For example, you can customize this template to log each time the custom device is saved.

ActionVIOnDownload

Action VIs created from the ActionVIOnDownload template execute when a user deploys the system definition file containing the custom device to a real-time target. (Widows) This Action VI does not execute if a user deploys the system definition to a Windows target.

This template is especially useful for creating Action VIs that finalize the target configuration after you deploy the system definition, as you can no longer adjust target settings in the System Explorer window after deploying.

You can also customize this template to deploy any additional files or dependencies your custom device requires. For example, if your custom device reads and writes to shared variables, you can deploy those variables.

  • Device Item Ref in is the reference to the custom device item whose XML declaration calls this Action VI.
  • ftp session is the open FTP session used to download the system definition to the target. You can use this open session to move additional files to the target.
  • System Definition Dir is the path to the system definition file on disk.
  • IP Address is the IP address of the target.
  • ftp session out is the open FTP session used to download the system definition file to the target.

ActionVIOnPaste

Action VIs created from the ActionVIOnPaste template execute when a user pastes a custom device item. This template is especially useful for creating Action VIs that check channel properties. For example, if the user pastes a page that configures a target, you can create an Action VI to ensure that the new page does not attempt to reconfigure the target.

You can also customize this template to prompt a user to enter new values for the pasted item. For example, if a user pastes a page that will conflict with existing pages, you can prompt the user to enter new values for the page.

  • Ptr in is the reference to the custom device item whose XML declaration calls this Action VI.
  • Parent is a reference to the parent of the custom device item whose XML declaration calls this Action VI.
  • All Ptrs is an array of references to the items the user pasted. You can only select one item to copy; therefore, this array only contains one reference that matches the Ptr in reference.

ActionVIOnCompile

Action VIs created from the ActionVIOnCompile template execute when NI VeriStand compiles the system definition file.

Note  If you deploy the system definition, then undeploy it, and then redeploy it without making changes, this template does not execute because the system definition does not recompile.

You can customize this template to finish configuring your hardware. The system definition file compiles when a user deploys the system definition, so you can configure your hardware based on the final settings from the system definition.

You can also customize the ActionVIOnCompile template to quickly gather host-side settings. For example, often the custom device RT Engine VI uses properties set in the system definition. You can customize this template to read the values on the host side, which is much faster than reading them from the real-time target. You can then gather the properties into a single cluster, convert that cluster to a data variant, and write the variant as a single Item Property.

WAS THIS ARTICLE HELPFUL?

Not Helpful