キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

How to creat variable

解決済み
解決策を見る

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 件の賞賛
メッセージ1/4
1,404件の閲覧回数

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 件の賞賛
メッセージ2/4
1,394件の閲覧回数
解決策
受理者 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 件の賞賛
メッセージ3/4
1,392件の閲覧回数

@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 件の賞賛
メッセージ4/4
1,336件の閲覧回数