LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Non-Loop based counter

Hi guys. I need help to make a counter for making arrays. I have a program where it gets reading from a height gauge. When I press the button it will take the reading and write onto an array, when I press again it will write again the following row. This will keep happening until a certain length of rows, afterward, it will have to go the next column and do the same. I also have a button where you rewrite the taken value if it turns out to be a mistake. For me to do this I will need a counter where the counter will link to take a reading button and to which row I add the data onto. The counter can't be a loop based. I tried various loop based counters and none of them work. Can someone help me, I think it will work if I use an event base but I can't get that working.

 

Thank you,

0 Kudos
Message 1 of 12
(3,497 Views)

Hi Rugan,

 

use a shift register to store your counter - as well as other shift registers to store your measurement data…

Best regards,
GerdW


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

Why not store the data in a 1D continuous array and use the reshape array to display it to the user or write to file as a 2D array?

aputman
0 Kudos
Message 3 of 12
(3,458 Views)

I don't understand what you mean by non-loop.

0 Kudos
Message 4 of 12
(3,440 Views)

 agree with Altenbach, what do you mean non-loop, and why not. How do you plan to access the initial code that selects the entries?

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 5 of 12
(3,426 Views)

With all the constraints in place I am not able to use a shift register.

0 Kudos
Message 6 of 12
(3,405 Views)

I am not to sure what you mean. I was able to make it work by using a sequence case with a true or false cause in the last sequence. It didn't think it can be so simple, I was over thinking the problem.

0 Kudos
Message 7 of 12
(3,402 Views)

Loop doesn't work because after every added count I need to have Labview go through a series of code, and the code I cant put into the loop so it doesn't work for me.

0 Kudos
Message 8 of 12
(3,399 Views)

Hi Rugan,

 

With all the constraints in place I am not able to use a shift register.

Which "constraints"? Why no shift register?

You know a feedback node can be used without a loop around?

 

You know you can answer to different people with just one message? Or you can edit your own messages - instead of posting 3 messages without mentioning who you are answering?

 

On your "solution": most often a sequence frame is not the solution, but just a workaround! What about using a state machine?

Best regards,
GerdW


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

I am 3 weeks old to labview. I tried the shift register and the event counter both doesn't work. I don't know what a feedback node is.

Thank you for the hint of replying to people. This was the first message here.

0 Kudos
Message 10 of 12
(3,385 Views)