Configure Data Collection for Motion Detector:

The Express VI popup is used to configure the SensorDAQ to collect data from the Vernier Motion Detector connected to the DIG Channel. Set the sample rate, experiment length and units. Notes: Setting the Collection Length to a value of –1 will configure the Express VI to collect for indefinite length. The sample rate control allows a maximum value of 50 samples/second. This is to limit the possibility of interference between the Motion Detector signal and echo.

Exit the Express VI popup by pressing the OK button. Closing the Express popup will send you back to the Block Diagram of LabVIEW for developing your program. The Express VI must be placed within a While Loop in order to continually read data for the required length of your configured experiment.

Placing the Express VI in LabVIEW:

A Sample LabVIEW Block Diagram would be as follows:

After configuring the Express VI, create a simple program for collecting data from the Motion Detector by placing the Express VI within a While Loop. Wire a Boolean control (such as a stop button) into the “stop (F)” terminal and wire the “stopped” terminal into the While Loops’ conditional terminal. With every iteration of the While Loop a data point is sent out of the Distance, Velocity, and Acceleration terminals. Wire an appropriate Front Panel indicator, such as a Waveform Chart, to one or more of these terminals to display the data in real time. The While Loop will continue to iterate until the Express VI’s Collection Length has occurred. At that point the stopped terminal sends out a Boolean value of True to the conditional terminal, stopping the While Loop without user interaction. If the While Loop needs to be stopped prematurely, the user can manually terminate the While Loop by sending a Boolean True value to the stop terminal (for example, pressing the Front Panel stop button). Note that an easy way to create the Front Panel stop control is to right click on the stop (F) terminal and select Create>Control from the menu.

LabVIEW Program for Motion Detector and Analog Sensor:

Mark this control if you are creating a program that simultaneously collects data from the Analog Express VI and the Motion Express VI. If the two Express VIs are being used together, the Motion Express VI must pause for 1.5 seconds prior to starting to insure that the analog channels are configured and started first. Marking this control adds the pause. When not marked, there is no pause prior to starting the Motion detector.

In addition, the Analog Express VI should be configured to start collecting from a digital trigger from screw terminal PFI0. This is the digital line that sends a digital pulse to the Motion Detector to create the clicking noise. If not configure for a digital trigger, the Analog collection will begin 1.5 seconds prior to the Motion collection. If configured, the Analog collection will start at the same time as the very first click of the Motion Detector. This helps to synchronize the start times.

Test the Motion Detector:

When the Express VI is open, press the Run button to test your Motion Detector. This allows you to make sure the hardware is running properly before integrating the Express VI into the LabVIEW block diagram.