NI Home > Community > NI Discussion Forums

LabVIEW

Reply
Member
Amnaa
Posts: 16
0 Kudos

How control relay (on/off) through digital output module in labview

Hello ,

 

        I have a problem with labview .. Actually I want to control a 12V electromechanical relay through digital output module to connect or disconnect the path .. The aim here is to control the connectivity of the load or component path (on/off)  using relay and NI 9474  ..

My question is how to build that in labview ..

if there is any example or tutorial that may help . Please post it for me 

 

Thanks a lot ,

Member
hicksc
Posts: 181
0 Kudos

Re: How control relay (on/off) through digital output module in labview

Hi Amnaa

 

Welcome to the forums.

What troubleshooting steps have you taken?

Are you able to control the relay through MAX (Measurement and Automation Explorer)? You should be able to manually switch the digital lines high and low from MAX to test its functionality.

Writing data to the digital output lines will be done using DAQmx. The best place to find an example will be using the inbuilt example finder which LabVIEW provides.

Help >> Find Examples >> 'Hardware Input and Output' >> DAQmx >> 'Digital Output' and look through the examples there.

 

The 9474 is a sourcing Digital Output module therefore it has to be supplied with a source to output (i.e.. 12V in this instance). Please refer to the manual here to ensure that you have it properly connected and do not risk damaging the module by operating it outside of its specification.

 

Kind Regards

Chris | Applications Engineer NIUK
Member
Amnaa
Posts: 16
0 Kudos

Re: How control relay (on/off) through digital output module in labview

Dear Sir, 

 

             Thanks for relpying but I got confused I am not a Pro in labview..  from what I know .. I will connect the digital output module to relay .so

 the path is on when  digital output module sends a pulse to relay to connect and 

 the path is off when there is no signal to send ..

Isn't that correct ?

 

My question is I don't know how to build that in labview .. Iam looking for an example of vi that uses relay and digital output module to connect and disconnect the path ..

 

sorry I know I'm demanding alot .. I searched about it and I got nothing helpful

 

but really thanks for your reply .. 

(\__/)
(^__^)o0O [ you Made ma Day ]
.(v v)

Proven Zealot
crossrulz
Posts: 7,729
0 Kudos

Re: How control relay (on/off) through digital output module in labview

Just search for the digital output examples as already stated.  When you turn the digital output on, it will output 5V in the line you told it.  This 5V will then either energize or deenergize your relay (depends on the exact circuit).



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Member
Amnaa
Posts: 16
0 Kudos

Re: How control relay (on/off) through digital output module in labview

Thanks for your reply 

Active Participant
apok
Posts: 956
0 Kudos

Re: How control relay (on/off) through digital output module in labview

remember....DO is a ttl signal and not a source. you will have to buffer it or use some kind of driver(transistor,mosfet,optocoupler,ssr,ect....),because you will damage it.

Knight of NI
RavensFan
Posts: 15,609
0 Kudos

Re: How control relay (on/off) through digital output module in labview

Read the manual

 

http://www.ni.com/pdf/manuals/373509e.pdf

 

page 11

Member
Amnaa
Posts: 16
0 Kudos

Re: How control relay (on/off) through digital output module in labview

Ahaaa .. Okey ..Got your point .. Thanks for that.. ^__^

 

but still my question is unanswered ..

 

wanna know more about >>> guess what >>>>VI of digital output module and relay to connect and disconnect the path of load 

 

I looked for examples but I didn't find what I need

 

THANKS a lot .. I really appreciate your help  ^__^

Trusted Enthusiast
Norbert_B
Posts: 4,412
0 Kudos

Re: How control relay (on/off) through digital output module in labview

[ Edited ]

I think you get confused with some stuff in your system....

 

  • The PC is running software. In your case, this would be a LV VI. Chris (hicks) already pointed you to valuable examples for this.
  • Software can control, using an Application Programming Interface (API) of a driver, hardware. In your case the driver is DAQmx and the hardware is the 9474. See the examples Chris refers to.
  • The 9474 simple closes a relay if the driver (effectively your VI using the API) tells it to do so. Since the 9474 does not drive the output, you have to connect an external power source just as RavensFan posted previously.

 

So essentially, the VI only tells the 9474 to open or close the relay. Depending on the external power/relay connection, this could result in "negative logic". So "open the relay" might result in "ON".

 

So i wonder what you are asking for.

a) a VI using DAQmx API to control the 9474. Refer to Chris suggestions here.

b) connecting a power source and the relay to the 9474 (external connections). Refer to the manual as RavensFan posted.

 

hope this helps,

Norbert

 

----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Knight of NI
RavensFan
Posts: 15,609
0 Kudos

Re: How control relay (on/off) through digital output module in labview

[ Edited ]

Look at Hicks examples again.  There are lots of DAQmx examples including ones on digital outputs.  If anything, there are too many examples.  All you need is a DAQmx Write set for digital output, 1 channel 1 sample.  Boolean

 

For a relay, you just need to match an external power source with a relay, and pick a relay that doesn't draw too much current in its coil that would exceed the 1 A rating of the digital output channel.