From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

case structure greater than or less than

Solved!
Go to solution

Generate a random number and scale it by 100 and compare it with a specific number let’s say(i.e. 400) if greater turn on LED and if less turn OFF LED.

 

i'm new to ni software so please help me in this Thanks.

0 Kudos
Message 1 of 5
(3,189 Views)
Solution
Accepted by topic author ShayanAzeemi

@ShayanAzeemi wrote:

Generate a random number and scale it by 100 and compare it with a specific number let’s say(i.e. 400) if greater turn on LED and if less turn OFF LED.

 

i'm new to ni software so please help me in this Thanks.


Show us what you have tried.  Where are you stuck?  This can be done with a Random Number, a Multiplication, and a Greeater function.  One control for the threshold and another for the LED output.


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 2 of 5
(3,173 Views)

BTW, 400 will be always larger since NI random number is up to 1, and you are multiplying it by a 100 only.

Just to reduce your testing time by not trying irrelevant values...

0 Kudos
Message 3 of 5
(3,150 Views)

Hi Shayan,

 

i'm new to ni software so please help me in this

Then you should take the help offered by NI for free!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,134 Views)
Threshold got it bro thanks
0 Kudos
Message 5 of 5
(3,124 Views)