LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging same time with different button

Solved!
Go to solution
Highlighted

Hi, I use labview for logging data.
First, I click Start Buttton, the process will start and data will logging to Table1 with 1 second.
After that i will click Logging Button. The Logging Button will start and Table Logging get data from last data Table1.
Table1 must still running when table logging is running.
But, the probelm is Table logging not continue running, must allways click. I want just one click. I dont want use Switch When Released. I want use Latch When Released.
Capture.PNGCapture1.PNG

0 Kudos
Message 1 of 5
(216 Views)
Highlighted

It is unclear what you are asking for here.

 

What I can see is that you have a very stacked set of structures here.  Case structure inside a loop, inside a case structure, inside a loop.  When case structures and loops go that deep, it is a sign of a bad architecture.

 

You should probably think about how to do this within a single loop.

0 Kudos
Message 2 of 5
(186 Views)
Highlighted
Solution
Accepted by topic author duviky

Hi duviky,

 

you really should simplify your code:

No local variables for controls used as indicators.

No duplicated code.

No stacked structures.

No Rube-Goldberg due to converting scalars to arrays.

No ExpressVIs used for converting to array.

No InsertIntoArray, when you just want to BuildArray!

And only some very simple DATAFLOW to start the logging…

 


@duviky wrote:

I want just one click. I dont want use Switch When Released. I want use Latch When Released.


When you need switching behaviour, then you cannot use latching switch modes!

Why do you insist on latching?

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 3 of 5
(158 Views)
Highlighted

Hi GerdW,

I like your code, very very simple. I like it, but table logging not run continue. I want if i click Logging Button, Table Logging will run continue like Table1. If i use your program I must Allways Click Logging Button. I want One click like Start Button (Latch When Released).

0 Kudos
Message 4 of 5
(143 Views)
Highlighted

Hi duviky,

 


@duviky wrote:

I want One click like Start Button (Latch When Released).


Then set the "Logging" button to a "switch" mode!

Spoiler
If you really insist on using a latching button you can use it to switch a boolean flag, stored in an additional shift register, between FALSE and TRUE. A simple XOR function will by your friend…
Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
0 Kudos
Message 5 of 5
(133 Views)