LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 9481: Why dose the relay turn off all channels once every time when the vi is run?

Solved!
Go to solution

Hello all, I am using cRIO 9025 and NI 9481 to develop a program. The relay is used as switches.  What I designed is that when I run the vi, the channels of relay are all on.When the input port of digital input/output module gives a signal to the relay, the channels of the relay is turned off. However, every time I run the vi, the relay is turned off once and then trund on again. Can I ask why is this happenning? I guess it is because the default state of the relay is off. Is there any way to fix this??

 

Many thanks!!

0 Kudos
Message 1 of 9
(3,508 Views)

I would guess that the default state for relays is off.  When you run any program, and you initialize a board, most likey the default state comes up and then you set it as desired.  I don't know of any way to change that.  Please attach your code to see if there is something you are doing wrong.

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 9
(3,498 Views)

Hi tbob,

 

Thank you for your reply. My relay channels are located in the target vi of my project. I attache the project here. I think you have already seen it when you helped me with another problem last time.

Thank you very much again.

0 Kudos
Message 3 of 9
(3,491 Views)

Ah yes, the FPGA code.  I'm afraid I can't help you.  The default state for the relays on the 9481 is off.  Everytime you run your code and you initialize the card, the relays will turn off.  Why do you have to stop your code and run it again?  Where is the board  being initialized in your code?

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 9
(3,485 Views)

I do not want to stop the code and run it again. I want the code to be run directly. Do you know is there any way to change the default into on?

 

0 Kudos
Message 5 of 9
(3,472 Views)

I don't understand your problem.  Your subject line says the relays turn off every time the vi is run.  Now you are saying you don't stop and run again.  These are conflicting statements.  Please be clear.  If you run your vi, the relays will be off.  You set them on in your code.  The vi stays running.  The relays should stay on until your code tells them to go off.  What is the problem?

- tbob

Inventor of the WORM Global
0 Kudos
Message 6 of 9
(3,467 Views)

I am sorry for the confusing. I want the relay to be on when I run the vi. In another word, I want the default state of the relay is on. Is this possible?

0 Kudos
Message 7 of 9
(3,459 Views)
Solution
Accepted by topic author masterwho

All the relay modules are like this and there is nothing that can be done about it as far as I know. In general electromagnetic relays are spring loaded and  held on (closed switch) by a voltage being sent to the relays. When you cycle power on the relay controls they are going to switch off. You can set the state of the relays to true as the first thing when you start your VI, but beyond that you would have to solve your problem electrically, switching out relay control to a constant on voltage during program startup. However in most situations this would be risky and unreliable. There are many different types of relays though and you haven't specified what you are using.

 

Refer to the basic operation section section of this article to read about how relays themselves default to the open circuit state:

http://en.wikipedia.org/wiki/Relay

---------------------------------
[will work for kudos]
0 Kudos
Message 8 of 9
(3,451 Views)

You can use a SPDT (single pole double throw) relay in your application.  Wire to the common (COM) and normally closed (NC) terminals.  Now the default state is to have the contacts closed.  When you energize the relay, the NC contact will open up and the common to normally open (NO) contacts will close.

- tbob

Inventor of the WORM Global
Message 9 of 9
(3,443 Views)