LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 6001 USB for sensor activated actuators

Hello,

I want to do a project using the NI 6001 USB as a DIO device.

 

Details about the project:

- 4 sensors activated by a voltage input of 12V (anything under that will not activate the sensor) 

- 2 actuators ( switch actuators )

- 3 LED (Red , Green, Yellow)

We have the following cases:

 

Case 1: If sensors 1 and 2 are activated, actuator 1 is activated and the Green LED is turned on (for 5 seconds) .

Case 2: If sensors 2 and 3 are activated, actuator 2 is activated and the Yellow LED is turned on for a period of time (10 seconds).

Case 3: If sensor 4 is activated, all actuators will stop and the Red LED is turned on.

For any other combination of sensors activated (for example sensor 1 and 4, the Red LED is turned on).

 

Other details:

- LabVIEW 15 SP1

 

0 Kudos
Message 1 of 10
(3,426 Views)

Sounds great. Given the way that you have described the project in your post and the seeming interdependence of one sensor on another to determine output, I would suggest a State Machine.

 

Was there something you needed help with?


GCentral
Message 2 of 10
(3,407 Views)

Hi, thank you for the suggestion.

I was thinking about the actuators, how can i make them work.

Each of the 2 actuators will start one DC motor depending on how the sensors are activated. (3V-6V motor, 2200 rpm)

And for the sensors, i was thinking to use push buttons for activation.

 

0 Kudos
Message 3 of 10
(3,350 Views)

A good place to start might be to look at the USB 6001 datasheet:

http://www.ni.com/pdf/manuals/374369a.pdf

 

Depending on the voltage rating of your actuators, you have a variety of different digital output ports on the device that you can connect to the switch actuators to start your DC motors. 

 

You can also use the digital input ports on the device to interface with your software. 

 

Does this help with your problem?

Message 4 of 10
(3,328 Views)

I want to use 4 physical push buttons to activate 4 different physical LED's.

Push buttons and LED's are connected on a breadboard.

But i am having difficulties on how to make the VI to do that.

Can anyone help me with this ?

0 Kudos
Message 5 of 10
(3,302 Views)

The best way to learn how to use a LabVIEW VI for this would be to look at the LabVIEW Examples that come with the software. You can find these at Help->Find Examples... which should pull up the NI Example Finder.

 

Once you're there, you can find some helpful examples on using the DAQmx API to control digital input and output, which is what your application is doing. In the Example Finder, if you navigate to Hardware Input and Output>DAQmx, you'll be able to see the Digital Input and Digital Output folders. In each of those folders, Digital - Finite Input.vi and Digital - Finite Output.vi show how to go about taking samples of digital input and output. You can use these, in addition to the State Machine architecture shown above, to model your VI off of. 

0 Kudos
Message 6 of 10
(3,290 Views)

Can anyone help me with this state machine ? 

I am having a hard time understanding how to include signal generation from my DAQ device in one of the states and how to pass to the next state after i generated the signal.

In the first state i want to press a virtual button from VI to send 5V to power an LED, and then to move in the next state, in which i need to generate signal to power a DC motor (just to turn it on, i dont need to control it)

0 Kudos
Message 7 of 10
(3,283 Views)

Something else that might help is this: https://forums.ni.com/t5/Example-Programs/Flexible-DAQmx-State-Machine-for-Automated-Tests/ta-p/3499...

 

Someone kindly made a State Machine VI that uses the DAQmx API. Just to explain some things on the block diagram that will answer your questions:

  • Notice the how the Digital Output and AI Voltage to the left of the While Loop are sent to shift registers. This allows those channels to stay open while the state machine is running.
  • To answer your question about including signal generation, notice how in the "Heater On" state of the case structure there's a DAQmx Write. This would be an example of how to include Signal Generation in your VI. Whenever the "Heater On" case runs, it will write a True constant to the hardware.
  • To pass the next state, you can read the State Machine Tutorial that was provided.
Message 8 of 10
(3,279 Views)

Ok i managed to get my state machine logic going on.

The only problem i have now is still the signal generation thing to power my DC Motor.

Its a basic motor, that starts spinning from 3V up to 6V . 

I selected the channels on my device that i want to write, and i connected the motor accordingly, but it seems like it hasn't got enough power to turn it on. Or maybe there is something else wrong with my logic in that state.

I will attach my "running motor" state.

0 Kudos
Message 9 of 10
(3,263 Views)

If you look on the datasheet, it shows that the maximum current output of the AO channels is limited to 5mA. If your DC motor requires more current than that to run, you'll have to use your output as an input to a switch, whether that be with a FET or an optocoupler. There are some resources online for this kind of thing, but in short those components would offer isolation from your USB device, so you wouldn't have to draw as much current from it, and instead from an external power supply, or the +5V power source on the device.

Message 10 of 10
(3,242 Views)