LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Compact DAQ to count relay cycles

Hi guys,

 

I'm fairly new to labview, but given how good the Compact DAQ cards are I decided to run with it and use labview to control an electromechanical relay accelerated aging project that I'm working on. I have the relay being driven by an NI 9475 DAQ expansion card, and that all works fine. I'm also able to adequately capture the data back from the NI9221 card which is measuring voltage drop across the relay contacts. 

 

The problem I'm currently having is that I want to count the number of actuations that the relay has undergone in order to identify the point at which it eventually fails. Since the voltage output of the relay will vary as a square wave I was hoping I could use some sort of edge detection which would increment a counter whenever the relay actuated and the voltage across the contacts drops to zero. So once the relay fails and stops actuating the counter will stay constant and tell me how many times the relay actuated before it broke.

 

The problem is that I'm not completely sure how to do this in LabView. I had a stab at it in the attached VI but while the chart happily shows the relay actuating (I'm doing the actuation manually in this case) however, I'm not having any success detecting the edges and incrementing the counter. Does anyone know I might be able to make this work?

 

Cheers,

 

RB

0 Kudos
Message 1 of 5
(3,619 Views)

RB,

 

I can't look at your code becuase I'm still running LV2010SP1.   Looking for edges can be a problem.

 

In your case I would not bother looking for edges, I would look for levels.  I would close the relay, wait about 100mS to give every thing time to settle and then measure the voltage across the contacts and verify that it is within an acceptable range.  I would do the same when relay opens. 

 

AC or DC coil on the relay under test?  What kind of load is connected to relay under test?

Message 2 of 5
(3,607 Views)

Given your current hardware I'd agree with Wayne's suggestion.  If you're open to alternative modules:

 

C Series digital input modules with 8 lines or less can route their inputs to the cDAQ backplane counters.

 

The 9205 can also do this (you could configure an analog trigger with user-defined threshold and hysteresis) but the input range is only up to ±10 V (and the Digital line on the 9205 is 5V TTL only).

 

 

Best Regards,

John Passiak
0 Kudos
Message 3 of 5
(3,595 Views)
DC 24v coil, 24v 16A rated across the contacts. However the parameters of the test have me overdriving the relay unit with voltages up to 40v for some of the more destructive tests, so I need a module that can handle that kind of voltage input.

The levels idea isn't a bad one. I've already characterised the relay the old fashioned way with an o-scope and the relay settle time is pretty quick. I guess the way to test the levels would be to divide the expected level by the recieved level and if the recieved level is <10% out increment counter? The problem is I'm not sure how to synchronize this with the pwm output being generated by the counter in the coil driver routine, since I'm using a DAQmx task to generate my PWM signal. I'll look into it once I get back to the office on Wednesday and post my results.

Thanks guys,

RB
0 Kudos
Message 4 of 5
(3,585 Views)

I'm trying to achieve the exact same thing on cDAQ 9178 and NI 9403. I'm unable to view the .VI file that you have uploaded. I'm really new to Lab View and want to use a counter to know how many times the relay is actuated. I used an updown couter and was able to do this on Zelio PLC. I'm trying to implement it on Lab View now. Any help is appreciated.  

0 Kudos
Message 5 of 5
(3,040 Views)