LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
Vij@y

Programmatically create Incrementer and Decrementer

Status: Declined
LabVIEW discourages this kind of programming. Do not create incrementers in LabVIEW using local variables. Either the state should be passed into and out of the subVI completely (the ideal when possible) or kept locally using shift registers/feedback nodes.

Some people who are new to LV (Like me) were struggle to implement the Incrementer or decrementer logic programmatically. For instance, at some places we need to execute the code in a sequential manner, we will badly need of this logic. Thing is, Its so easy If you have just follow the steps what I post here.

 

Steps:

1. Place the Increment operator from the functon palatte

2. Create a indicator for the increment operator

3. Now create a Local variable from Indicator and give it as a input to the Increment operator

 

You are done now. If you want to realize the logic for Decrementer, simply replace the increment operator with decrement operator. 

 

 

If this Idea witnessed already, Kindly ignore this.

 

Incrementer and decrementer

 

11 Comments
muks
Proven Zealot

Have you used a shift register? Please dont try to do this with local variables

Vij@y
Member

Hi muks,

 

Yes I used and good familiar about shift registers. Here I just want to explain, Shift registers can be mimic programmatically.

P@Anand
Trusted Enthusiast

Is this an Idea or a sample code? Honestly I didn't get what you are trying to propose, can you please explain bit more about your idea?

-----

The best solution is the one you find it by yourself
muks
Proven Zealot

Hi muks,

 

Yes I used and good familiar about shift registers. Here I just want to explain, Shift registers can be mimic programmatically.

 

 


 

 

 

 

If my understanding is right this is one of the most important things that we must aviod while programming

 

 

crossrulz
Knight of NI

Trust me, the shift register is way more efficient and follows data flow very well.

 

Now the point of the Idea Exchange is to give NI feedback of what we think could make LabVIEW better.  Just look through the ideas in the Completed category and you will see what we mean.  You didn't really state anything here to make the LabVIEW environment any better.



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
muks
Proven Zealot

Cant say it better

 

Off topic- Has anyone suggested having a kudos button in the comment section

crossrulz
Knight of NI

Stil off topic - Yes, that has come up many times...



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
P@Anand
Trusted Enthusiast

Off topic continues

 

Has anyone suggested having a kudos button in the comment section

 

@muks  I thought this many a times when I really want to appreaciate few comments (Specially when reading explanation given my AristosQueue and badly want to hit Kudos). Excuse me..

-----

The best solution is the one you find it by yourself
Vij@y
Member

Dear all,

 

Thanks for your suggestions. Ofcourse its an Off topic. Will take a glance over this forum and come up with a good idea to exchange.

P@Anand
Trusted Enthusiast
You are always welcome to share your Ideas. Keep up the good work
-----

The best solution is the one you find it by yourself