NI Home > Community > NI Discussion Forums

Digital I/O

Showing results for 
Search instead for 
Do you mean 
Reply
Member
MgDAQ
Posts: 39
0 Kudos

DAQ Assistant Digital Output LabVIEW Code

I am interested in a more detailed understanding between the differences of the LabVIEW code examples below:

 

Turn on a DC Computer Fan using a Solid-State Relay, mDAQ, and LabVIEW

 

Output Light Using a Basic 5mm LED, NI myDAQ, and LabVIEW

 

Obviously, the code is controlling different hardware.  However, the application is very similar - The front panel control turns the digital output (a fan or LED) ON or OFF. The vi runs until the STOP control is pressed.

This is why the coding block diagrams are the same. 

 

The fan example states:

"When the Stop button is pressed and the while loop is exited, a False is output to the line, opening the SSR and turning off the fan for safety."

 

What is the purpose of the additional DAQ Assistant in the FAN example? How exactly does it provide added safety as not found in the LED example?

 

Knight of NI
Dennis_Knutson
Posts: 34,167
0 Kudos

Re: DAQ Assistant Digital Output LabVIEW Code

It plainly states that at the end, the fan is turned OFF. Don't do that and the fan could be left running, correct? Do you think it might be even a slight hazard with leaving the fan running?

Member
MgDAQ
Posts: 39
0 Kudos

Re: DAQ Assistant Digital Output LabVIEW Code

Thank you Dennis.

 

When the vi is stopped in the LED example, the LED remains on?

Knight of NI
Dennis_Knutson
Posts: 34,167

Re: DAQ Assistant Digital Output LabVIEW Code

It remains in the last state that was set inside the loop.

Member
MgDAQ
Posts: 39
0 Kudos

Re: DAQ Assistant Digital Output LabVIEW Code

Thank you for your response.  I see the difference now.

 

In the FAN example when the vi stops, an error is sent to the fan turning it off (for safety).

However, in the LED example, when the vi stops it remains in the last state. It is possible this state is ON.

 

Though the code is similar the differences are very important - one may not want their digital output to remain in an ON state should the vi stop.

Knight of NI
Dennis_Knutson
Posts: 34,167
0 Kudos

Re: DAQ Assistant Digital Output LabVIEW Code

The error wire is there only to enforce data flow. It has nothing to do with the data being written. The Boolean array with a false constant is what is written out.

Member
greentea2
Posts: 13
0 Kudos

Re: DAQ Assistant Digital Output LabVIEW Code

I am having trouble with recreating the DC fan example with the code provided.  I am using a SSR Crydom CWD2410 relay.  My fan is On and then turns OFF but does not want to turn On again. Should it be first Off and then On?

Member
Esteban_B
Posts: 177
0 Kudos

Re: DAQ Assistant Digital Output LabVIEW Code

Hi greentea2,

 

The datasheet of your relay says that the input current is 10mA @ 12 V, if you are using a Digital Output from the myDAQ device (assuming that you are using one), you will have a 5V output and this means that you will need a 26mA current to activate your relay. The maximum output current per line is 4mA.

So my recommendation will be to implement a power stage between the myDAQ device and the relay that you are trying to use.

 

I hope this information will help you in your project.

 

Regards,

steve.bm
AE | NI