LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Relay control using labVIEWand cRIO and NI 9472 c-series module

Solved!
Go to solution

Hi all,

 

I'm trying to get my program to work so far no success and need some help.

 

I'm using the compact rio with the NI 9472 digital output module and program on labVIEW. I have attached my VI.

 

Basically it is a test program to execute an algorithm at a certain time. So I'm using a solid state format to get a time string which dictates when to run the algorithm. The default operation I have set is for when the time string produces a false.

 

Issue 1: The problem I am having is that even if the time string is true it does not execute. It remains in false state thus sending only false signals to my relay (which is represented by the round LED - the relay switches a solenoid on and off).

 

Issue 2: If I can get Issue 1 resolved, the next step I have will be to run the same algorithm but for more than one time state. Eg. At "6:00 a.m." execute algorithm. I want this algorithm to keep executing as long as it is sending TRUE signals (which means the solenoid stays open until a FALSE signal is sent). Then it will execute again at say "8:00 a.m.", run the algorithm as long as it is sending TRUE signals and so on....

 

In summary -

- I want to control a relay (which controls a solenoid)

- Using components listed above

- Using solid state in labVIEW(VI attached)

- At different times, executing the algorithm UNTIL is sends FALSE signal then return to default state, which means its waiting until time string produces TRUE.

 

Any help would be appreciated.

 

Regards,

William

 

0 Kudos
Message 1 of 10
(5,275 Views)

Hi there:

 

1. The problem is the string format (ex. 12:38 PM instead of 12:38 p.m.). Wire an indicator to the time string output of the "Get Date/Time String Function" to verify it.

2. Configure an action range to the cases that requires it and add more cases as necessary.

 

I modified your VI a little to reflect this suggestions. I hope this helps Smiley Wink

Alejandro C. | National Instruments
0 Kudos
Message 2 of 10
(5,255 Views)

Alejandro,

 

Thanks that has helped, do you know how I could get the algorithm to keep running even when the time string isn't TRUE anymore eg. when the time hits 12:38 PM run the algorithm. I want the state to keep executing as long as the algorithm is sending TRUE signals, but it stops executing as soon as the time hits 12:39 PM even if the algorithm is still sending TRUE signals.

 

Essentially I only want the time string to dictate when to execute the algorithm, but once the state is executed, I want the algorithm to dictate when the relay turns off.

 

Any help would be appreciated Smiley Happy

 

William

0 Kudos
Message 3 of 10
(5,231 Views)

well...you can try to take all variables inside the "take action case", then use another loop to enclose the code, negate the boolean output and wire it to the stop terminal. The time will the trigger and the action should stop with the logic.  If there are several action cases I suggest to transform the algorithm into a SubVI to make the code look cleaner. 

Alejandro C. | National Instruments
0 Kudos
Message 4 of 10
(5,207 Views)

@willsro wrote:

Issue 2: If I can get Issue 1 resolved, the next step I have will be to run the same algorithm but for more than one time state. Eg. At "6:00 a.m." execute algorithm. I want this algorithm to keep executing as long as it is sending TRUE signals (which means the solenoid stays open until a FALSE signal is sent). Then it will execute again at say "8:00 a.m.", run the algorithm as long as it is sending TRUE signals and so on....

 


  • if start time reached (true) OR'd to shift register, then shift register is (true)...otherwise (false)
  • algorithm bool and shift reg. dual inputs AND'd logic to Solenoid

 

Spoiler
solenoid mod.png

 

Message 5 of 10
(5,195 Views)

even simpler...

 

Spoiler
solenoid mod_BD.png

 

Message 6 of 10
(5,183 Views)

Apok,

 

Thanks for the help, I like the thinking process. I just have an error I'm getting when I'm working with the vi. I think it's better i show you (refer to spoiler)

 

Error 1:When I'm running the vi. the array output is always 11:00 PM it doesn't change to use the other values when the time stamp and actual time are TRUE, can't figure out why?

 

Error 2: I'm using another array in case structure to use different values for MJ/hr each value in the order shown is matched to the time eg. at 6:00 AM use 1.13 as MJ/hr etc..

 

So if you can help me out with this or anyone else then the program is essentially complete.

 

Thanks in advance to anyone who can help,

 

Spoiler
 

 

 

Front panel

 

Block Diagram

 

William

 

0 Kudos
Message 7 of 10
(5,166 Views)

spoiler fail Smiley LOL

0 Kudos
Message 8 of 10
(5,165 Views)

your introducing an array of DBL's which breaks the bool/shift regs..... do you want to match each setting of your start time element to MJ/hr element (1:1)?

0 Kudos
Message 9 of 10
(5,158 Views)
Solution
Accepted by willsro

something like this....

Spoiler
solenoid mod (1).png
Message 10 of 10
(5,150 Views)