LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why is For/While loop Iteration I32?

I want to use negative iteraion values for 'for' loop...u seem to suggest as indexing is a way to go for....can u pls attach some example or further explain how to go about it.

 

P.S.:I am new to labview.

0 Kudos
Message 21 of 38
(1,044 Views)

I want to use negative iteraion values for 'for' loop...u seem to suggest using user created loop counter is a way to go for....can u pls attach some example or further explain how to go about it.

 

P.S.:I am new to labview.

0 Kudos
Message 22 of 38
(1,039 Views)

I do not understand what you mean by "negative iteration".  Like I said before, provide an example of exactly what you want.  If you have code that does what you want already (even if it is a Rube Goldberg), then please share that as well.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 23 of 38
(1,037 Views)

I am basically trying to do basic operations of scaling,shifting and reflection on unit step function using elementary elements(no pre-defined blocks).As i did reflection and shifting operation combined,i found that the graph doesn't show any values of Y-axis for x less than zero.As i worked and improved the code,it now works almost fine but the problem is that the simple code is becoming to complex and i want to simplify it.So,in nutshell i want a simple way to avoid using a negative number to add to 'i' to print values on graph for x less than zero.

 

0 Kudos
Message 24 of 38
(1,033 Views)

Now I can clearly see what you are talking about.  You want X values from -100 to 100 (multiplied by some value, but that is beside the point).  The method of just subtracting 100 is the easiest.

 

I cleaned up your code some.  Check out the palettes a little closer.  There's some very useful ones in there that you could use, like Greater Or Equal to Zero?, Absolute Value, and Negate.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 25 of 38
(1,026 Views)

crossrulz wrote:

I cleaned up your code some. 


In addition, the terminals belong before the loop unless they can change while the loop is spinning. Since that would lead to unpredictable results, that's not what you want. IS requires significalty more effor to read the terminal with every iteration of the loop to see if it has changed.

 

Also note that xy graphs take complex data. No need for express VIs.

 

Most likely you don't even need an xy graph. 

0 Kudos
Message 26 of 38
(1,027 Views)

Thanks for the help.The program works fine and i am refining it. Since the output is continuous,what changes would you suggest to make it discrete...? 

 

0 Kudos
Message 27 of 38
(982 Views)

@ps293 wrote:

Since the output is continuous,what changes would you suggest to make it discrete...?  


That makes very little sense. You probably need to explain exactly what you mean by all that.

0 Kudos
Message 28 of 38
(973 Views)

I want my output to be visible only at integral value i.e. For n=1,2,3..the output should be 1 or 0(y axis) as per condition but in between 0 to 1 and 1 to 2..and so on...there must be no visible output at all. 

0 Kudos
Message 29 of 38
(954 Views)

@ps293 wrote:

I want my output to be visible only at integral value i.e. For n=1,2,3..the output should be 1 or 0(y axis) as per condition but in between 0 to 1 and 1 to 2..and so on...there must be no visible output at all. 


Capture.PNG

your are only a few Right-Clicks away from what you want.  (just a different way of showing the points- without the lines)


"Should be" isn't "Is" -Jay
Message 30 of 38
(934 Views)