LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Register events of activated booleans and show them in a list

Solved!
Go to solution

Hello, I'm doing my professional service in a combined cycle electric central, I am currently working on a monitoring and control system of some water wells that supply water to the tanks for the steam cycle. Most of the program is done, but I am working separately (to add it later) on the event logging. What I want is for example to be able to register when each of the pumps are activated or deactivated, or when I have one of the alerts that I already programmed (booleans), and print them with the date and time in the front panel. For example, something like this is what I want to do:

 

Capture.JPG

 

I've tried doing it with some arrays and could register when each pump is activated but I have not been able to combine them in a single array. I'm not sure if the approach I've been trying is the right one. Any suggestions or corrections?

 

0 Kudos
Message 1 of 8
(3,831 Views)

You need to keep the modified array in a shift register. Currently, you are initializing the array with each iteration of the loop. You VI also spins infiinitely fast, consuming all CPU.

 

You array manipulations make no sense at all.

Your orange wires should all be blue, because you are dealing with integers.

Also note that the term "register events" has a very special meaning in LabVIEW. Apparently you want to just log certain changes.

0 Kudos
Message 2 of 8
(3,819 Views)

Here's a quick demo for only part of your code. You can easiy add your other booleans and so on. Modify as needed.

Message 3 of 8
(3,796 Views)

Thanks, it really helped me to figure out this better approach. I modified it to add the second pump and display the results in a single text box, but when the button is True it keeps printing several times the result, could you please tell me if you see my mistake?

0 Kudos
Message 4 of 8
(3,766 Views)
Solution
Accepted by topic author RafaelGC

You are no longer using the result of the "not equal" comparison which is used to see if the boolean has changed or not. Instead of building an array from the controls, bult an array from the result of the two "not equal" comparisons.

 

You are also missing to log if both buttons change at the same time (there is a theoretical possibility for case 3! ;)), so you might want to rearrange things a little bit more.

 

(... and please dont save the VI with the panel maximised to the screen!)

 

 

 

0 Kudos
Message 5 of 8
(3,744 Views)

You sourced your boolean logic from the wrong place.  You based it on the value of the buttons.  Altenbach showed you the case structure is based on the result of the feedback node.

0 Kudos
Message 6 of 8
(3,737 Views)

One method I've used before for something like this (general purpose logging) was an action engine that I could call from anywhere and just feed the text in to it.

 

Edit:  I posted the wrong VI...

0 Kudos
Message 7 of 8
(3,726 Views)
0 Kudos
Message 8 of 8
(3,698 Views)