LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a button

Solved!
Go to solution

If you are purchasing a NI product, I would recommend one that support a Digital Input Change Detection Event; this will  make programming much easier. Basically you set a task that responds to a low to high transition or high to low transition or both transitions. When the transition occurs an event structure is triggered. Easy to implement, no need to poll, etc.

0 Kudos
Message 31 of 53
(1,350 Views)

@govindsankar wrote:

As I said, we are not making any change to the hydraulic press. There is already safety implemented in the hardware of the hydraulic press. I am not making any changes. I just need to collect the data from the user to say if the hydraulic press has been successfully completed or not, and also in the beginning to scan the device using a scanner. For both these operations, I need buttons and DAQ. So for scan I need one button, then after completion the user tells software whether it is ok or not by pushing one of two push-buttons. So this part is clear to me. I have decided to buy the NI DAQ 6001. But now the confusing task is deciding the push button. So for the DAQ to read the push-button, the push-button gives a 5V signal to the DAQ. But I am confused on where does the 5V come from. Do I need a separate battery power supply to complete the circuit, or are there battery operated push buttons? Kindly let me know. Thank you. 


The 6001 has 5V out.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 32 of 53
(1,349 Views)

@. Basically I can connect the 5V out from the DAQ to the push button and then back from the push button to DAQ input and then use it to program the system. Is that it. Thank you. 

0 Kudos
Message 33 of 53
(1,344 Views)

@govindsankar wrote:

@. Basically I can connect the 5V out from the DAQ to the push button and then back from the push button to DAQ input and then use it to program the system. Is that it. Thank you. 


Almost. You need to add a resistor between the DAQ input and Ground. This is called a "Pull down resistor". Some DAQ devices have them, so check your hardware manuals to see if they do or not.

 

Check the current output specs on the 5V line, and make sure the resistor is sized to be large enough to not demand much current when you press the button. Something like a 10 kOhm resistor should work fine.

0 Kudos
Message 34 of 53
(1,325 Views)

@BertMcMahan. Ok thank you very much. I will do that.

0 Kudos
Message 35 of 53
(1,319 Views)

Circuit.jpg

 

I need to design a circuit with a NI DAQ 6001 and 3 push buttons. Sorry I dont know any design softwares, so I just drew with my hand and it looks bad. But I can give an explanation for you to understand. Pins 1,2,3 are programmed to be digital out pins which give a 5V output and pins 4,5,6 are programmed to be digital input. So I need a 5V signal to the push button which will then be read by the NI DAQ. For this I wire from DO Pin 1 to the push button and then from push button to DI Pin 6. Similarily DO Pin 2 -> Push Button -> DI Pin 5 and DO Pin 3 -> Push Button -> DI Pin 4. On recieving the 5V at the DI terminals, rest will be done by the software. There is already a pull down resistor in the NI USB 6001. So i havent used any. Is this circuit correct. Sorry not sure how to upload a picture and post something written as well. So I will upload the picture as comment below. Kindly let me know. Thank You.

 

0 Kudos
Message 36 of 53
(1,297 Views)
Solution
Accepted by govindsankar

You're close! Don't use the programmable DO pins for your 5V source- there's a dedicated 5V pin on there.

 

BertMcMahan_0-1681918893919.png

 

Message 37 of 53
(1,284 Views)

Thanks @BertMcMahan, thats just one. I need three. So this solution wont work is what you are saying.  

0 Kudos
Message 38 of 53
(1,281 Views)
Solution
Accepted by govindsankar

Just shove three wires into that one screw terminal (or solder three wires into one).

 

The dedicated 5V line should have a lot more current sourcing capability than the DO's will.

Message 39 of 53
(1,272 Views)

You can consider the 5V output pins on a DAQ card to be a low-current power supply.  You don't want to drive a motor with it, but you can easily use it to source 3 (or more) Digital Ins.  Just connect all 3 wires to the same terminal or get a little terminal block to tie them together.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 40 of 53
(1,270 Views)