LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to put a limit on indicator in my counter program

I'm a student and new to labview stuff. I need help with how to limit my indicator to certain amount because my lecturer asked me, also there's no forum talked about it or tutorials from youtube. here's my Block Diagram. I need to make a minimum & maximum limit for "Jumlah Mobil". pls help
image.png

0 Kudos
Message 1 of 4
(1,049 Views)

All you show us is a "picture" of a block diagram. Please attach your VI and explain exactly what you mean by "limit" (upper? lower? valid range? invalid range?) and what these limits actually are.

 

Since you are "new to LabVIEW stuff" (sic), I would also recommend to start with a few basic tutorials because there are some obvious glaring problems already visible, for example:

 

  • There is absolutely no reason to express ms in orange by converting to DBL.. Keep it an integer!
  • Your boolean control on the bottom left has no label and is outside the loop, so it will only get read once and is useless during run. Your "select" can never change later!
  • All terminals must have a label for code clarity. If you don't want to see the label on the front panel, you can hide it, but never make it an empty string!
  • What is in the other events and why is there even an event structure?
  • An indicator does not have any limits. You need to limit the value in the wire going to it.
  • Since there is not timeout event, your wait is pointless. The loop can only go to the next iteration if an event occurs.
  • Do you really, really need I64 for the blue stuff?
  • Some of your shift registers are not initialized and will carry stale data from earlier runs. Is that what you really want?
  • Your orange indicator (which should be blue, see above!) is after the loop and will only update after you stop the loop (or never if you abort the VI!) and will show stale data otherwise.
  • What's the logic of all the green stuff. Seems very convoluted. What is the mechanical action of the boolean controls?
  • What is the program supposed to do?
  • etc.

 

 

0 Kudos
Message 2 of 4
(988 Views)

Attempting a bit of code interpretation and artistic license, I guess that this is what you are trying to do:

LLindenbauer_0-1701084738240.png

 

 

LLindenbauer_1-1701084241355.png

 

It is a good moment to reflect on the difference between data and representation. The indicator ("how to limit my indicator to certain amount") is only a representation of the data. It is possible to limit the indicator, but I believe you want to limit the actual data. Do you want to allow Jumlah Mobil to be negative?

 

Message 3 of 4
(966 Views)

Having all labels in Indonesian makes understanding code difficult for most. Here are the text parts of your original diagram picture as translated by Google lens.

 

altenbach_0-1701099751773.png

 

 

Car Enters
100
A
Car Out
A
[1] "Incoming Car": Value Change
A
Source
Type
Time
CtlRef
Number of Cars 164
DBL
Time Between Cars (ms)
1.23
0 Kudos
Message 4 of 4
(940 Views)