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.
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.
03-08-2022 06:51 AM
I am new and learning LabVIEW. I'm trying to make a program that will run for 20 iterations. Here 20 are the seed that needs to be separated between normal size and abnormal size. 'Numeric2' where I will set the size such as 2.5 mm. So, if greater than 2.5 the seed is normal and the counter will count it. similar, if false then the counter will count the abnormal seeds. I need to export both data on an excel sheet.
03-08-2022 07:31 AM
First thing: The random number returns numbers between 0 and 1. So they're all going to be below 2.5.
You mention "mm" but I'm not sure how you propose applying units to your control. "Numeric 2" doesn't tell us if it's in "mm" or "m". This is important. Because with 0.025 your code may work, with 2.5 it won't.
Aside from that, you are re-initialising your counter to zero on each of the 20 iterations. This will cause each of your 20 iterations to start a loop running until you press the "stop" button. This results in each of the 20 iterations each having a variable number of iterations themselves. That may be what you're looking for, but it sounds wrong to me.
Maybe try getting rid of the while loop altogether and initialising the shift register on the left-side of the FOR loop instead.
03-08-2022 08:12 AM
Thanks for replying...
I followed your steps and removed the while loop. Now, the program works but only abnormal values are counted. While my focus is to get more normal seeds in the counter than abnormal.
Can anyone show me the use array to collect both counter's data and export an MS excel file?
03-08-2022 08:22 AM
Have you tried running your code with execution highlighting active?
03-08-2022 08:30 AM
You will need a shift register to keep your "normal" count and another shift register to keep your "abnormal" count. I would also move the indicators to be after the FOR loop has ran.
03-08-2022 08:55 AM
03-08-2022 11:09 PM - edited 03-08-2022 11:09 PM
I want to use an array for both elements but I don't know how to.
It just can be a .txt file...
Sorry, I should've attached the file earlier.
03-09-2022 03:02 AM
Can you please fix my code? Leave the output export. I want to try that myself...
Thanks
03-09-2022 08:08 AM
@saadtariq16 wrote:
Can you please fix my code? Leave the output export. I want to try that myself...
Thanks
Could you at least show some effort? You were given a bunch of advice and you didn't even try to implement them. We are volunteers who are here to help, not do your work for you.