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.

Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

How to condition digital (switch) inputs and outputs to a DAQ board?

I'm working on a project to salvage an old machine tool by replacing it's broken logic control board with "LabVIEW".  A replacement logic board is no longer available. Rather than trash the machine I'm going to try and control it using the only method I'm sort of familiar with, which is LabWINDOWS. This may not be the optimal tool for this task, but when all you have is a hammer everything looks like a nail.

 

The machine employs a few limit switches, a couple of solenoid controlled actuators. I need to read the limit switch positions, perform some logic, and activate the solenoids as needed. I need advice on interfacing the switch inputs and solenoid outputs to my DAQ board.

 

I've done some micro-controller interfacing at the hobby level but I'd like to know how it's done on a more robust level. I assume I'll need to create TTL level signals (0-5 volt) for input to DAQ board, one for each limit switch. For this I'll use a power supply, say 5 volts, with a pull-up resistor for each input. That way, an open limit switch will result in a 5 volt signal to the DAQ input and zero volts when the limit switch is closed (grounding the DAQ input terminal).  I'm not sure how I'll physically connect this to the DAQ input. Somehow the ground for both the DAQ and 5 volt circuit will have to be connected, I guess.

 

To control the solenoids my thoughts are to apply a digital output signal (TTL) from the DAQ board to control a relay. I've used 24 volt Arduino-style relays experimentally, but I'd like to know how the pro's do it.

 

So my question is, how is this done at a more professional/industrial level? Are there devices on the market for interfacing switches and solenoids to the digital I/O terminals on a DAQ board?

 

Thanks!

0 Kudos
Message 1 of 10
(4,319 Views)

My first thought is that you should be using a cRIO since this is a control application.  cRIO controllers add a lot more reliability over a Windows application.  Also, there are industrial level modules that you can use, such as DIO modules that are made for 24V logic.  You might also be able to find a DIO module with built-in 5V pull-ups (I have not looked into this enough to say for sure).

 

But if you want to insist on using LabWindows/CVI, then use a cDAQ.  cDAQs work with DAQmx and use almost all of the modules a cRIO can.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 10
(4,303 Views)

Thanks crossrulz,

 

It looks like cRIO has its own programming environment. That sounds like a steep learning curve for just one project.

 

I've worked with CVI recently so I'll start with that. I also have cDAQ modules and other NI DAQ devices. I'll consider cRIO if the CVI approach won't work. I also worked with PLC's years ago. That would probably be my next consideration if the CVI approach fails.

 

Right now I'm just looking at ways to interface switch inputs and solenoid outputs to the DAQ devices I have. I'm hoping to find interface hardware that's a little more sophisticated than breadboards and soldering.

 

You say cRIO has modules made for 24V "logic"? Will those modules work in a cDAQ chassis?

0 Kudos
Message 3 of 10
(4,300 Views)

There is a Real-Time CVI module, I suggest you contact your NI sales engineer to see whether you have this in your CVI version already, and what hardware is required to run it.

 

I suggest you goo for "interface relays" , there are some fine 5v-24V opto-isolated units out there. I suggest you connect to your I/O using these, have a separate power supply for these, and wire your safety systems, e.g. emergency stop to that. That way you are not relying on the PC operating correctly for the emergency stop and other safety functions.

 

However, while I support your choice of LabWindows over LabView, are you really using the correct tool? I think your suggestion that a PLC could do the job needs more serious consideration. Have you looked at any of the micro-plcs, eg Crouzet Millenium 3? The software is a free download, and very easy to use. Disclaimer: I have used PLCs, LabWindows & LabView; I have no connection with any of the associated companies.

 

 

0 Kudos
Message 4 of 10
(4,282 Views)

@querty999 wrote:

You say cRIO has modules made for 24V "logic"? Will those modules work in a cDAQ chassis?


Look at the NI-9375 (datasheet).  It has 16 inputs and 16 outputs, all work at a 12V or 24V logic level (>10V is considered a HIGH on the inputs, the outputs are basically relays).  It also claims compatibility with cRIO and cDAQ.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 10
(4,276 Views)

I know there are probably more appropiate ways to do this, if you have the knowledge. But do you have any particular reason(s) a LabWINDOWS approach won't work? If so, please let me know. Could save me a lot of time.

Thanks for responding!

 

0 Kudos
Message 6 of 10
(4,264 Views)

Sure, it is entirely possible, especially if you have the real-time toolkit and some hardware that will run it.

 

You do not want LabWindows to be handling any safety-related functions though, unless you are happy dealing with the laws & regulations on safety related software in your state.

 

Who will maintain the thing after you? Will they find a PLC programme easier to read than LabWindows?

 

 

0 Kudos
Message 7 of 10
(4,260 Views)

An NI Support tech informed me that NI digital I/O channels have a built-in switch "debouncing" feature. That's good news. Tells me NI has already made provisions for using switches as input devices. I'll be looking into that today. I should have known that any vendor claiming to sell industrial level hardware would have this capability, but somehow I never noticed it.

0 Kudos
Message 8 of 10
(4,242 Views)

Beware, not all DAQ's with digital inputs have the 'debouncing' feature.

Look specifically for filtering in the specs. I believe DAQ that have that feature also support change detection.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 9 of 10
(4,236 Views)

Oh no! I thought the debounce feature was characteristic of all digital input devices.

 

I'm planning to use either NI 9411 or NI 9403. I'll have to dig into the specs to see if they have this capability.

 

I also have a couple of multi-function DAQ boards. Hopefully some of them can do it.

 

Thanks for the heads up.

0 Kudos
Message 10 of 10
(4,232 Views)