From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Relay Testing with State Machine

Solved!
Go to solution

Hi,

 

Yesterday I very kindly had some help from "crossrulz" in setting out the following procedure.  Today, the National Instruments representative called and said I should implement my programme as a "State Machine", which I have attempted in the programme attached.  I was wondering how I might now implement the procedures 3 to 5 in this State Machine format as it seemed very complecated in the brief time we had. 

 

What I am trying to do is test relays, using an automated test procedure.

 

The procedure takes the following steps:

 

1.       A NI9472  DO card and transistor drive turns the relay on/off via energising the coil (needs the time period to be variable).

2.       Counts how may cycles the relay contacts have operated, this will easily be in excess of 100,000 cycles.

3.       Every 100 cycles (again variable), the contacts are held closed, the load circuit (the current the relay is switching, which will be 15A at 30V) is disconnected, via another relay and a measurement is taken via a separate four wire method.  This consists of a 6V supply being placed across the contacts (switched in again via a relay) with a 1A current flowing through the contacts, the voltage drop across the contacts is then inputted into the NI AI NI9219 card (this is in the region of 10’s of mA) and is directly proportional to the contact resistance, which is what I want to measure.

4.       The measurement is taken and stored and the measurement circuit disengaged, the load circuit re-engaged, and another 100 cycles is counted before the process goes back to stage 3.

5.       This process goes on until the relay fails and hopefully a large set of contact resistance data is gathered.

 

I have no real experience with NI Labview.  

 

I have looked at the basic academic tutorials and have come up with the following programme for stage 1, however I can't get the DAQ Assistant to output every cycle

 

Would this be a very difficult programme to implement for the novice?  The academic tutorials seem straight forward but when I try to do someting it seems very difficult.

 

Hoping someone may be able to help, thanks

 

Andy

Download All
0 Kudos
Message 1 of 6
(3,306 Views)
Solution
Accepted by topic author andywileman

Hello Andy,

 

Having looked at your code it looks like you're off to a good start.

 

At current the Transition Code (that which determines which state is implemented next) is set to default at the output of each case. This means it will continually cycle between the 'Initialize, Default' case and the 'Coil' state, rather you should wire a transition code into the output. An example is shown below.

 

Example Transition Code.png

 

I would also suggest using the debugging tools if you are not already; specifically the Highlight Execution and single stepping functions which will enable you to see how your code flows and where errors occur.

 

Kind Regards,

James V.

NI UK Applications Engineer
0 Kudos
Message 2 of 6
(3,242 Views)

Thanks for your help James, I'm slowly getting there. 

0 Kudos
Message 3 of 6
(3,192 Views)

Hi Andy,

 

Post back if you have any further issues relating to this application.

 

Kind regards,

 

James V.

NI UK Applications Engineer
0 Kudos
Message 4 of 6
(3,142 Views)

Hi James,

 

I've tried to implement some logic as suggested.  I can now get the 1A coil to engauge after the nth cycle and I think it's taking a measurement, but can't seem to get the 15 A coil to disengauge at the same moment, which is crucial else the measurement will be across 16 A rather than just the 1 A.  Any ideas?  I just want to get it working so we can get started with testing.

 

 

I'm going to get my supervisor to book me on a course at Newbury for future projects, it's very difficult to pick up of your own back.

 

Kind regards,

 

Andy

0 Kudos
Message 5 of 6
(3,126 Views)

Hi James,

 

I've tried to implement some logic as suggested.  I can now get the 1A coil to engauge after the nth cycle and I think it's taking a measurement, but can't seem to get the 15 A coil to disengauge at the same moment, which is crucial else the measurement will be across 16 A rather than just the 1 A.  Any ideas?  I just want to get it working so we can get started with testing.

 

 

I'm going to get my supervisor to book me on a course at Newbury for future projects, it's very difficult to pick up of your own back.

 

Kind regards,

 

Andy

 

(Helps if I attach it)

0 Kudos
Message 6 of 6
(3,123 Views)