LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic Numeric Number generation without loop

i have to generate a LabVIEW function which will generate number from 0 to 100 without the use of any loop (FOR or While). Because a loop will pass the  Value after final iteration.

0 Kudos
Message 1 of 7
(2,142 Views)

Where are these requirements coming from?  Is this homework?

 

What you describe almost always requires a loop.  And saying "Because a loop will pass the Value after final iteration" is meaningless because that isn't a problem with the loop but how you are programming it.

 

Describe what the final result should look like.  You say generate a number from 0 to 100, but do you mean an array of numbers from 0 to 100?  Or do you mean randomly give a number that is somewhere between 0 and 100?

 

I would recommend you learn more about LabVIEW from here. How to Learn LV

0 Kudos
Message 2 of 7
(2,137 Views)

Option 1: right click on the tunnel coming out of the loop and change the Tunnel Mode to "indexing".

 

Option 2: use Ramp Pattern 


GCentral
0 Kudos
Message 3 of 7
(2,126 Views)

Sir, i changed the tunnel mode to index mode. but my problem is not solved. Actually, i want to run a Case structure which requires numbers to run the cases from o to 10 in a sequence. I have two options 1. Manual, Option 2. For Loop. if I am using FOR Loop, i have to put whole of my code inside. Which stops my whole process. I am working on a pattern matching application where i am getting data from a camera. If i put whole of the code inside the FOR loop, it is not working then. Thats why i need a number generator program to solve this problem. Otherwise i have to run the Case structure manually. My main aim is to make it Automatic. Sir ask me if you need any other information.  

0 Kudos
Message 4 of 7
(2,119 Views)

Sir, i changed the tunnel mode to index mode. but my problem is not solved. Actually, i want to run a Case structure which requires numbers to run the cases from o to 10 in a sequence. I have two options 1. Manual, Option 2. For Loop. if I am using FOR Loop, i have to put whole of my code inside. Which stops my whole process. I am working on a pattern matching application where i am getting data from a camera. If i put whole of the code inside the FOR loop, it is not working then. Thats why i need a number generator program to solve this problem. Otherwise i have to run the Case structure manually. My main aim is to make it Automatic. Sir ask me if you need any other information. 

0 Kudos
Message 5 of 7
(2,112 Views)

Hi Sachin,

 


@Sachin77 wrote:

Actually, i want to run a Case structure which requires numbers to run the cases from o to 10 in a sequence.


Put the case structure inside a FOR loop, set to run 11 times.

Wire the "i" terminal of the loop to the case selector input…

 

As this is pretty basic LabVIEW stuff you should take note of those "Training resources" offered here!

 

Remark: you don't want to run the "cases in a sequence" as a "sequence" is something bad (mostly…) in LabVIEW!

Best regards,
GerdW


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

@Sachin77 wrote:

Sir, i changed the tunnel mode to index mode. but my problem is not solved. Actually, i want to run a Case structure which requires numbers to run the cases from o to 10 in a sequence. I have two options 1. Manual, Option 2. For Loop. if I am using FOR Loop, i have to put whole of my code inside. Which stops my whole process. I am working on a pattern matching application where i am getting data from a camera. If i put whole of the code inside the FOR loop, it is not working then. Thats why i need a number generator program to solve this problem. Otherwise i have to run the Case structure manually. My main aim is to make it Automatic. Sir ask me if you need any other information. 


It's not exactly obvious what you're doing, or why it doesn't work - can you attach your VI?

That might make it easier for us to understand your problem.

 

Beyond that, the learning materials that have been already suggested are likely to be a worthwhile investment - you can watch them as videos or read here.


GCentral
0 Kudos
Message 7 of 7
(2,088 Views)