LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Array

Hi, I'm very new to LabVIEW and couldn't find documentation for this. I have a scale communicating with my LabView that displays whatever is on the scale. I want to log the scales inputs in an array every 1 second (the array should be increasing in size). For the sake of simplicity I made a block diagram that just takes a numerical user in put and adds it to the array, however when I input the number the array doesn't update until I stop it and its only the last value. How would I go about doing this? I've attached both the scale code and simplified code.

 

Thank you!

Download All
0 Kudos
Message 1 of 3
(89 Views)

Hi gfly,

 


@gfly wrote:

I made a block diagram that just takes a numerical user in put and adds it to the array, however when I input the number the array doesn't update until I stop it and its only the last value. How would I go about doing this?


Well, this sounds like missing to "THINK DATAFLOW!"…

When you want to update an indicator inside a loop then you need to place the indicator inside the loop!

 


@gfly wrote:

I'm very new to LabVIEW and couldn't find documentation for this.


There is the LabVIEW help, that has chapters on LabVIEW basics. The help also explains the "THINK DATAFLOW!" mantra of LabVIEW!

(I cannot open your VI due to the LabVIEW version you use. In general it is advised to downconvert your VI to "LV2021 or older" to reach a broader audience, using File->"Save for previous". I prefer LV2019…)

Best regards,
GerdW


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

@gfly wrote:

Hi, I'm very new to LabVIEW and couldn't find documentation for this. I have a scale communicating with my LabView that displays whatever is on the scale. I want to log the scales inputs in an array every 1 second (the array should be increasing in size). For the sake of simplicity I made a block diagram that just takes a numerical user in put and adds it to the array, however when I input the number the array doesn't update until I stop it and its only the last value. How would I go about doing this? I've attached both the scale code and simplified code.

 

Thank you!


No you don't. You create a new array of 1 element each time. To add an element you must add it to the incoming array as clearly shown in the help window (which you should always have open).

 

 
 

Skärmbild 2025-01-09 104018.png

 

(I can already see what the next post will be about)

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 3
(41 Views)