LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

hold a selected graph

Solved!
Go to solution

I have a file that is 32 columns wide and I need to process some columns one way and other columns another way and then print them to one file. The processed data for each column is also displayed on individual graphs.

 

My problem is that I can only do one process routine at a time, such that a new file is written for each processing routine. The channels I do not want to be processe are printed as zeros and then I have to write a new file for the rest of the channels when using the other processing routine.

 

Is there a way to "hold" the data from the first process routine and display it on their graphs while I am doing the second process routine on the remainder of the column data ie. only updat the graphs during the second process routine.

 

thanks! and sorry about the vague descriptions... my code is attached... please note that I am very new to labview and probably could have added all the case statements but I am just concerned with it working first.

 

Thanks again,

 

Teresa

0 Kudos
Message 1 of 10
(3,778 Views)

Hi Teresa,

 

wow, a VI taking 3.5MB...

 

- If you replace all those "Select signal" ExpressVIs by simple IndexArray functions you surely end with a VI of less than 200kB! You also don't need to convert to DynamicDataType to show values on a graph! (How to build a graph is clearly shown in the context help.)

 

- Taking a subset of an array doesn't need 2 ReverseArrays and 2 DeleteFromArray when you use a simple ArraySubset with offset=100 and length=ArrayLength-200...

 

- Using strict left-to-right wiring clearly helps to understand a VI.

 

And last, but not least: Using a ShiftRegister will help to keep values from last iteration!

 

(There surely is more to say about your VI, but I'm tired to scroll the BD back and forth.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(3,763 Views)

Thanks for the tips, I am always prone to do things the long way.

 

Is there a way to keep the initial value in a while loop shift register for an unknown number of iterations? Ie. when a boolean is true I want to hold that value at that time until it becomes false. Shift registers only seem to work depending on the number of stacked shifts on the left side. I am probably missing something basic.

 

Thanks again,

 

Teresa

0 Kudos
Message 3 of 10
(3,726 Views)

Hi Teresa,

 

use a simple case structure:

when TRUE then hold value in shift register

when FALSE then wire new value to shift register

 

(Or use the Select function instead.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 10
(3,722 Views)

I really appreciate the help... however I am still having problems. It seems to only hold for one iteration, then the whole thing freezes, whether I use a case structure or select function or nothing at all with the shift register.

 

I have attached my vi with only 3 channels so hopefully it's easier to follow

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

Hi Tflax,

 

I can't see a shift register in your VI. Can you upload a version with a shiftregister to sow what you want to store for following iterations...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 10
(3,700 Views)

Its in the case structures towards the right of the code...

0 Kudos
Message 7 of 10
(3,696 Views)
Solution
Accepted by topic author Tflax

Hi Tflax,

 

what about this solution?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 10
(3,691 Views)

Thanks GerdW... really appreciate it.. I just dont understand shift registers yet.

 

 

0 Kudos
Message 9 of 10
(3,687 Views)

Hi TFlax,

 

ShiftRegisters are easy: at their output (at the left) they provide the value of the last iteration. At their input (at the right) you wire the value for the next iteration...

Some more:

You can wire an initialization value for the first iteration at the left connector (from outside the loop). You can get the last value from the connector after the loop has finished... 

Message Edited by GerdW on 03-24-2010 07:30 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 10
(3,684 Views)