From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Logging same time with different button

Solved!
Go to solution

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
(1,201 Views)

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
(1,171 Views)
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 LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 5
(1,143 Views)

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
(1,128 Views)

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 LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(1,118 Views)