From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Webcast Wednesday Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Webcast Wednesday Contest #25

Create a VI to generate random numbers from 1-1000. Input a particular number between 1-1000 and display the amount of time it takes for the number to match. Also display iteration count. If it takes more than 1.5 seconds, display a dialogue stating the same. (Try using Elapsed time for the second task)

  OR

Generate a Sine wave (dt =0.1 sec) and each time the values exceed a threshold value (Given by user), change the colour of the graph to indicate warning.

Leave your answers as comments below by clicking on Reply

https://decibel.ni.com/content/servlet/JiveServlet/downloadImage/2-52994-89899/321ylper.JPG

You will need to be logged-in to do so. Click here to sign-in/sign-up.

Rules & Guidelines

  • Post your answers as comments on this thread.
  • The participant answering all the questions correctly and in the shortest time will be the winner. In case of VI or code as answers, the participant will also be judged on the basis of the efficiency of the VI/code.
  • The deadline for answer submission is Monday.
  • Entries made after the deadline will not be accepted.
  • The winner will be announced in the next session of Webcast Wednesday and on this thread, with further information & next steps.


Recordings of the Previous Sessions

Previous Contests of the Week


0 Kudos
Message 1 of 12
(6,117 Views)

0 Kudos
Message 2 of 12
(4,565 Views)

Contest25_RandomNumberSearch_BD.JPGContest25_RandomNumberSearch_FP.JPG

0 Kudos
Message 3 of 12
(4,565 Views)

first create a while loop.place a random number icon(express numeric) and multiply it by 1000.

then,place a round off to nearest value icon and round the random number to nearest number.

place a comparison equal to icon with one input terminal to random number(rounded off) and another to a control.

connect the output of the equal to the stop button.ths will stop the loop as soon as the number is matched.

connect the iteration symbol to an indicator.this will show the number of iterations.

connect a tick count to the loop and place another inside the loop.subtract their outputs  and attach an indicator.this will give the time taken to match.

place an elapsed time inside the loop and compare its output with 1.5 with the help of greater than icon.if it is greater than 1.5 then display a message using

display a message to user icon.

0 Kudos
Message 4 of 12
(4,565 Views)

Hello friends,my VI for 25th wedcast series.

0 Kudos
Message 5 of 12
(4,565 Views)

Below i am attaching the code for first question.

0 Kudos
Message 6 of 12
(4,565 Views)

my VI for 2nd question

feedbacks welcome

0 Kudos
Message 7 of 12
(4,565 Views)

Hi RChoudhary,

Great attempt. And nice use of the invoke node to reinitialize the values on the front panel.

Regards,

Webcast Wednesday Team

0 Kudos
Message 8 of 12
(4,565 Views)

Hi Manish

Nice attempt. However some pointers for your VI - Always reinitialize your values on start of the code. In your case, the LED still holds the value from the last run. Also, your time for match is not updating real time. Adding your tick count logic inside the while will ensure this.

Regards,

Webcast Wednesday Team

0 Kudos
Message 9 of 12
(4,565 Views)

Hi Sriveni,

Well made VI. If you can post the VI itself, we can better validate the functionality.

Regards,

Webcast Wednesday Team

0 Kudos
Message 10 of 12
(4,565 Views)