LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resetting Array

One of the problems is the fact that you are using a 2D array for the stored data. This is not appropriate since each set can have a different history lenght

Message 11 of 32
(741 Views)

I am thinking I should create 2 clusters with 4 1D arrays. One cluster for times one for #s. That would allow me to reset the array history?

CLD Certified 2014
0 Kudos
Message 12 of 32
(738 Views)

OK, looked at your code again:

 

Your reset case never executes. It is sufficient to do the reset in the "read" case, it's just a third case in the case structure there, right?

 

I don't know who made the multi-enqueue subVI, but since it is not a system VI I would change the color a bit to enforce that distinction.

 

Here's a quick attempt at a rewrite. See if it makes sense (LV2010).

 

Personally, I would probably architect it quite differently. How big do the arrays get?

 

 

 

Message 13 of 32
(724 Views)

I tried a different approach. This way the arrays can be reset. I still cant get the program to actually run. The button will not press for some reason. Is this style easier to understand? 

CLD Certified 2014
Download All
0 Kudos
Message 14 of 32
(719 Views)

Your MOD captured exactly what I was trying to do. Thank you.

I am now trying to understand the code. It encapsulates a lot of stuff that I understand but there a few things that I do not know how it works.

I also still do not understand why it matters that the arrays built up forever.

CLD Certified 2014
0 Kudos
Message 15 of 32
(713 Views)

 


ADrexelDragon wrote:

I also still do not understand why it matters that the arrays built up forever.


Because the amount of your RAM is not infinite! 😄

 

Message 16 of 32
(711 Views)

Ah. Interesting. I tried to implement the write data to measurement file. It seems to work but I am not sure why the first column comes out as [0,1,2,3,4]. I am not sure what that means.

 

CLD Certified 2014
0 Kudos
Message 17 of 32
(665 Views)

I think I figured out how to sent the data. I just need to figure out how to find the first time where then number is greater than 0.5. I could create an array of all the times where the number is > 0.5 and then search for the first index. I feel like there is a better way because then the array would go on indefinitely.

CLD Certified 2014
0 Kudos
Message 18 of 32
(658 Views)

Please use a new file name every time you are attaching a newly modified VI. People sometimes would like to look at several versions at the same time. It also helps identify which VI belongs to which post.

 

Can you explain the logic behind you file name manipulations? Makes no sense. Why is the browse option of the path control set to files instead of folders?

 

What should happen when the time is 0.5 for the first time? (You could use "threshold array" to detect this).

Message 19 of 32
(650 Views)

The file names represent each button. One file is save for each button. Still working on when the button cycles through and has a new test. I am thinking about having the first test for the button be test\[button #][trial #].lvm. Then if the button does more than one cycle, the trial number will increase.

 

As far as the threshold: I am trying to find the elapsed time to the threshold and that number. And a LED Boolean to go on when this occurs.

CLD Certified 2014
0 Kudos
Message 20 of 32
(643 Views)