From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Flexible DAQmx State Machine for Automated Tests

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.

    Hardware

  • Data Acquisition (DAQ)

    Software

  • LabVIEW

    Driver

  • NI DAQmx

Code and Documents

Attachment

Overview

This VI shows how to use a State Machine with an array of steps to run throguh a pre configured list of steps.

 

Description

This Example shows a process where we turn a heater on, then measure a finite numer of samples then tunr the heater off.

 

Requirements

Software

  • LabVIEW 2012 or compatible
  • NI-DAQmx 9.5.5 or compatible

Hardware

  • NI Multifunction DAQ Device

 

Steps to Implement or Execute Code

  1. Set the Physical Channels for a digital output and analog input.
  2. Configure the Steps from a list of States dropdown.(to add new states right-click the dropdown and select Open Type Def and Edit the Elements)
  3. Set the Numer of Samples thenrun the VI

 

Additional Information or References

 

 

DAQmx State FP.PNG

 

DAQmx State Machine FP.PNG

 **This document has been updated to meet the current required format for the NI Code Exchange.**

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

Comments
Philip1
Member
Member
on

This looks like exactly what I need.

I am using LabVIEW 2010 base. Is the base package enough to run this VI??   I am informed (while loading) that "State Type def .ctl" is missing (or isn't where its should be).

Thank you-

Tiger3D
Member
Member
on

Please add "State Type def .ctl". Otherwise it looks great. Thank you.

JTShaw
Member
Member
on

Please add "State Type def.ctl"

Thanks

HunterSeeker
Member
Member
on

I added the type def, should be good to go now.