LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Automation

Hello all,

 

I'm working on academic research, and I need to develop a LabVIEW VI that can control a stepper motor via Arduino and USB 6009, a FLIR camera via USB 6009, a force sensor via USB 6009, and a MEMS microphone via high-speed DAQ. I've managed to develop a VI that can capture and record the dataset in real time. Currently, the user needs to control the motor feedrate and switch on the data logging from the respective sensors. However, now I'm looking for a way to make the entire process automated. I'd like to define certain time-based conditions, and based on those conditions, VI should execute the task. I started with State Machine, but then I realized that it, too, needs input from the user. Later, I looked into timed loops, but I'm not sure how to approach this one.

 

I'm quite a newbie in LabVIEW, and honestly, I'm building my skill set there. Could anyone suggest the optimal way to control these many sensors via VI in an automated manner?

 

Thanks in advance!

 

0 Kudos
Message 1 of 4
(315 Views)

Hi spr,

 


@spr08 wrote:

I started with State Machine, but then I realized that it, too, needs input from the user.


You can have a dedicated state to collect user input.

You can use user input whenever you evaluate conditions to switch states.

You can even read controls inside states…

 

So what's wrong with a state machine?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(308 Views)

Hello GerdW

 

I'm looking for the following sequences:

 

1. @t = 0s, VI should play a tone to indicate the start of the program,

2. @t = 5s, VI should start the motor & camera,

3. @t = 7s, VI should start logging the data from camera, force sensor & MEMS,

4. @t = 30s, VI should turn the motor in reverse direction,

5. @t = 35s, VI should turn off the motor,

6. @t = 40s, VI should play a tone (indicating the end of the program),

7. @t = 45s, VI should turn off all the sensors and exit

 

Currently, I'm not clear on how to make this in a State machine. I followed some approaches mentioned in the examples, and now it's more of a user input rather than an autonomous system.

0 Kudos
Message 3 of 4
(302 Views)

Hi spr,

 


@spr08 wrote:

1. @t = 0s, VI should play a tone to indicate the start of the program,

2. @t = 5s, VI should start the motor & camera,

3. @t = 7s, VI should start logging the data from camera, force sensor & MEMS,

4. @t = 30s, VI should turn the motor in reverse direction,

5. @t = 35s, VI should turn off the motor,

6. @t = 40s, VI should play a tone (indicating the end of the program),

7. @t = 45s, VI should turn off all the sensors and exit


I don't see any user actions/inputs in this list…

 

Maybe a QMH (queued message handler) is more useful than a state machine.

There can be several consumers/handlers waiting for commands of a controller.

 

The controller itself could be a loop that checks the elapsed time and sends commands/messages as written in your list to the targeted handler (PlaySound, Motor start/turn/stop, Camera start/stop, DAQ start/stop)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(266 Views)