LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to creat variable

Solved!
Go to solution

I am very beginner to labview and i want to creat variable which get value 1 when input get 1 and not change when input 0 .

0 Kudos
Message 1 of 4
(860 Views)

Hi Chathuac,

 


@Chathuac98 wrote:

I am very beginner to labview


As a "very beginner" you should start with all those Training resources offered at the top of the LabVIEW board…

 


@Chathuac98 wrote:

i want to creat variable which get value 1 when input get 1 and not change when input 0 .


All you need is a while loop (as your input may vary over time), a shift register (your "variable", as LabVIEW uses wires and shift registers instead of "variables") and a case structure (input may be 1 or 0)…

 

What have you tried and where are you stuck?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(850 Views)
Solution
Accepted by topic author Chathuac98

@Chathuac98 wrote:

I am very beginner to labview and i want to creat variable which get value 1 when input get 1 and not change when input 0 .


In LabVIEW, the wire is the variable., you can branch the wire to an indicator if you want to also display it to the user. 😄

If you simply don't want to update an indicator, place it in a case structure and execute an empty case if zero happens, else update the indicator. If you also need the value elsewhere, keep it in a shift register or feedback node across iterations.

 

In addition, you really need to define the problem better.

 

  • Where does the "value" come from?
  • Where does the "input" come from?
  • Is "input" the same as "value" or different?
  • What causes "it" to change? How often?
  • What are the starting values? For example if the input is always zero, there is no obvious value to retain.
  • Are these integers or floating point values?
  • What should happen is the input is neither 0 or 1 (e.g. -1000, 34567, Pi, NaN, etc.)
  • etc.
0 Kudos
Message 3 of 4
(848 Views)

@Chathuac98 wrote:

I am very beginner to labview and i want to creat variable which get value 1 when input get 1 and not change when input 0 .


So, it'll be Off until activated and then always True. A shift register and an Or can fix that.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(792 Views)