Flashing LEDS with digital control

Hello

I want to do a simple program that goes like this. I have 2 digital controls and 2 comparisons. 1 digital will compare if the number if there is less than 50. Second comparison if it is longer than 50. If less than 50, according to this number LED is blink your eyes upward and will stay on. If the second number is greater than 50 the LED belonging to this number is then blinking and will remain lit. NOW...

If one OR both of these lights light up, a THIRD light should BLINK automatically. If the two first two traffic lights are off, then the third should stay off.

I tried using shift registers and a deadline for the delay, but I'm stuck.

Any help would be great. Thank you!

Thuba25

First, you must modify your code for an interactive real state machine. Your code is inside-out.

Currently, the controls are read once at the beginning of the program and then never.

  • Do not use internal loops. Use a single outside WHILE loop that encompasses all of the code.
  • Get rid of the stacked sequence, she is useless and obscures just the code.
  • The case structure belongs inside the loop and not vice versa.
  • Read the commands with each iteration and decide depending on their value.
  • ...

See how far you get... Good luck.

Tags: NI Software

Similar Questions

  • You want to use LabVIEW to digitally control LED lighting using a 24 volt system.

    Here turn on the LED powered by 24 volts, given current limitation about 8ma by applying digital depression to light the LED and digital camera HI (open) to turn it off. I have a USB 6009, that I use with my laptop, but according to the specification, it may not exceed 5.8 volts on a digital output. I need at least 4 outputs digital and digital 9 control LED 9. What equipment do I need. I have access to a desktop as well.

    Thank you, Alexander

    To drive the 9 LEDs, using the ULN2003.  Google it.  Digital output you feeds the ULN2003 and its production feed the LEDs.  You must always current limiting resistors inline with LED.  The ULN2003 can handle input/output 7.  So, you will need two of them.  Much simpler to have 9 transistors with base resistors.

  • Update of digital control with different values with array function

    Hello

    I have attached my code base. I want to execute the code for 2 sets of digital control with a gap between the two values, then pass it. Something like that

    ABC

    Initialize the P1 = 10; P2 = 20; P3 = 30; P4 = 40

    Run the code

    delay = 10ms

    Update of P1 = 150; P2 = 200; P3 = 350; P4 = 500

    Run the code

    jump to abc

    I am stuck how can I update the values of P1, P2, P3, P4? I thought about using a function table but couldn't go further.

    Thanks for the help,

    Ana

    Hello Ana,

    One way you might achieve what you are looking for is using property nodes. These property nodes will allow you to change the values of the block diagram control. You can set up a structure of case inside your loop that will change control through nodes of property value after a certain number of iterations. Here is a community sample that shows how to use the nodes property to change the Boolean controls:

    https://decibel.NI.com/content/docs/doc-22669

    -Erik S

  • Digital control system, using limits of entry of data with global variables

    Hello!

    I have a Subvi with several digital control sliders. These control framerate, the pixel clock and exposure of a camera and their change in max/min/increment whenever one of them is changed - they are interdependent and get their information from the camera continuously during execution.

    I'm trying to remote control this VI, but during the passage of a value using global variables, it doesn't "stick".

    Example:

    The value for exposure is 237,48 Ms. different values are constrained to the nearest value. So if I pick 240,00 ms at the Subvi, he should know that this is not a valid value and change to Mrs. 237,48.

    But it is not do and I don't know why. When I enter the values manually, it works fine.

    Any suggestions?

    The limits on the controls that apply when their control from the front and is not passing values via the connector pane.

    You should use something like "line and force" within the VI to validate the values are within the range (maybe constrain data or return an error).

  • How to block sites of specific discussion on mozilla firefox with flash player, for parental control

    I need to block sites internet chat specific for parental control, how?

    Thank you

    See block / unblock websites with parental control on Firefox

  • How to set fire to a single event "mouse down" when a tab control and its digital control have all two events 'mouse-down' with different function

    Hi all

    I have a digital control in a tab control. Both of them have their own events 'mouse-down' in a while loop. But when I click on the digital command, instead of raising the event of digital control only, both of these two events fired.

    Maybe I can check if the mouse is in the range of digital technology to filter events, but if the window is resized, I have to recalculate the range once again.

    Is there another way to do it?

    I pasted the test code too.

    Thank you!

    Excerpts of work

    Side note: I really don't like the controls on the tab and use them very rarely.  And the few times I use them, it is for tabs to which I often use to select among the screws to put in a secondary school.

  • Xperia Z2 orange flashing led when it is connected to the magnetic charge lead

    Hey guys. I bought this phone off of a friend. His three months and works very well. But the other night, I accidentally put the magnetic port on the back and the phone is completely dead. I panicked and I tried every possible combination. I finally got a red when I plugged it into the microusb port. He turned in 10 minutes as usual.

    Now, whenever I have fix the magnetic cord (correctly) I get a flashing led orange and the unit charge at all.

    What is the flashing orange led average? Warranty covers the magnetic port? I hope someone can help me

    Hello everyone. I have problems with the magnetic charge on my Z2 port. He simply not to charge the device. He also was heat when he was in charge via USB. Sometimes, it would not even load!

    I was trying to just live with it until one day the phone turned off and never started upward for about a day.

    I knew at that stage he had no choice but to request an RMA number for these issues.

    When I called to tell them my problems, I told them specifically 'THERE IS a PROBLEM WITH THE MAGNETIC PORT', 'THE PHONE REFUSED to LOAD SOMETIMES' and 'THE PHONE HEATS DURING CHARGE'.

    The representative on the other end told me several times that he understands the problem and they will be addressed when he arrived at the repair shop.

    So, I packed the phone upward and expelled from Ontario (shipping cost me $40) and thinking that once he comes back, it'll work like it should.

    ---

    It's where I've never been more wrong.

    I'll be back on the phone today and it opens as soon as I could.

    First thing I did, is trying to turn it on. Absolutely nothing. No light, no low battery screen, nothing.

    So when I got home, I plugged the thing in a USB AC charger. The first 10 minutes, that there was only one red LED and nothing else.

    After 10 minutes, I could see the green of the battery on the screen.

    Again 5 minutes later, I was able to turn the phone on. He was sitting at 2%.

    What makes me believe that the phone was left or COMPLETELY discharged before shipping. These people in repair facilities don't know how harmful it is for a battery to be discharged to comepletely?

    ---

    The second and most outrageous of the thing is the main reason for the phone was sent he was not yet fixed!

    I tried to plug in the charger magnetic port (with a spare cord, as well as the docking station) and the phone does EXACTLY the same thing!

    In fact, it is an exact quote from that work says:

    "THE PHONE IS IN CHARGE AND WORKS WELL. "PLEASE SEND TO THE CABLE USB AND CHARGER IF PROBLEM P-<- they="" didn't="" even="" finish="" the="">

    "Software update, direct call, past quality control."

    I am so totally outraged and disgusted with Sony now.

  • Satellite Pro P300 - problem with volume control

    Hello

    I have a problem with my volume control. He worked for the first two months of use value, but now refuses to lower the sound.
    He sort of stutters and actually transforms the sound upward when you turn, he 'left' to drop.

    I markets DEAMS it is a digital control and therefore is not a point 'end' like other laptops. I also noticed others are experieicing this problem.

    Is there a solution to this problem? I don't really like having to manually click on the volume control in the status bar on the window in order to be able to turn the laptop down. Maybe someone can help me?

    Thanks in advance.
    Sam

    Hello

    In your case, I recommend reinstalling the audio driver and controls (with Win XP) Toshiba or Toshiba VAP (if Vista is installed).
    In addition, you should check if the BIOS can be updated too.

    Sorry for this suggestion, but in my opinion that the question must be related software and the fact is that driver sound and the VAP multimedia button controls and the sound card.

    It of certainly worth a try

  • strange appearance of the digital control

    Hello...

    I met a strange appearance of a digital control, see the below two screen captures.

    Reminder: on a tabpanel, two of several digital controls have been changed programmatically if I put an indicator with a checkbox that is located on another tab of the Panel:

    -control mode is switched / battery hot

    -precision went from 6 to 4 figures to compensate for the space of digital arrows

    These changes are applied to three checks, but only the first (highest) behaves unexpectedly, while others are very well...

    (A) if both attributes are changed, the two top controls look like this:

    in other words, the left most of the characters of the control are somehow overlapping, giving the impression of a fat o material

    (B) if only the command mode of the higher control is changed to hot, the following result is obtained:

    This makes it more obvious that somehow the two zeros on the left of the control are pressed together.

    Interesting, if I operate the higher control by clicking on the arrow/top down, the result displays (1.0000E - 3) is ok.

    I was much afraid to post this mystery which could well be a stupid mine mistake, but unable to locate a problem in the code, I thought that it could possibly be linked to the issue tab panel reported here

    Comments, suggestions?

    Thanks, Wolfgang

    Hi Wolfgang,.

    I checked your project, and it looks like a bug. I created a CAR. The number is 282946.

    I guess that at the moment, you have to live with it or place the box on the same tab.

    See you soon,.

    RMathews

  • How to create a digital control (of any type) which can be increased or decreased by a 'unit' at the same time?

    As in the title.  I want to create a digital control (no current limitation on its type) with a range of 1 to 10 (and a step of 1).  The only difficulty that I have, is that the user should only be able to increase or decrease 1 at any time.  Code initiated by this change of value must have completed at least once before that the value can be changed again.  This is because code of VI is mainly contained in a while loop and control are read once at each iteration and its last value should not differ more than 1.

    Is this possible with LabVIEW 6.1 and if so, how?

    One of the solutions that I came up with so far is to disable the control immediately after its reading, and to turn it on again immediately seized is read the next time (I have to assume that the user is unable to click twice before the control is disabled).  It is an acceptable method, or is there a better way?

    I also had an idea of partially disable a normal digital control, such that it could not be typed in - only arrows remained operational.  However, I'm not sure how.

    James

    Hi James,

    You can use the two buttons (by releasing latch) and a digital display that shows the current value. Button increased the value and the other decreases. Store the value in a shiftregister to work with her.

    I don't know if your solution would work because use may directly enter the new value.

    It will be useful.

    Mike

  • Capture digital control last values

    Hello

    My front panel has several digital commands that I expect the user to enter data in before pressing a button that takes the values of the digital controls and

    a power supply programs. What I discovered is that if a user types the digital control and does not support on enter or moves the cursor with the mouse to a new

    control, the valleys of news are not captured when the button is pressed.

    How to capture the most recent value in numerical order without waiting for the user to press ENTER after that that they typed in the value?

    Two possible approaches to capture the value most recent inside a structure of the event:

    (1) read the values of your digital controls in the case of events for the button.  It is the simplest solution.  If you need access to these numerical values in other cases of event, use the event to change value for these controls to update of the shift registers, or use a local variable.

    (2) take advantage of the cause of the time-out period (if you are already using it you may need to do some creative re-use).  Store the time-out value in register shift and set to default-1 so that he will not run.  In your case of button, set the timeout to 0 shift register.  Move your key event code in the case of timeout.  LabVIEW will be re-read the values of your digital controls and the time-out event runs immediately.

  • Digital control over several orders of magnitude

    Hi all,

    I'm trying to get a digital control with a suitable addition to the order of magnitude.

    For example, I have a front panel for an osziloscope, sometimes that samples on some ns, sometimes a few seconds, sometimes a few milivolts, sometimes a few volts, who knows, right
    I was playing around with the digital control units, but it doesn't quite fit my needs. I can't change the prefix of a unit on the duration, for example of microseconds to seconds, but then I change the issue as well, because on change the prefix, the previous number is only multiplied by the factor according to, for example, 1000, so 5 became US 5th-6s. So change the record length of the default value of 500 ms to 100 ns would require two klicks type, and I can instead just type "100th-9', which is good too."

    However, I would like to have a digital control from 0 to 1000 combined with for example a button for prefix i.e. nano, micro, mili etc. and combine this values internally, i.e. of mulitplying accordingly. But I couldn't set the increment to "3 orders of magnitude" even with the option to log scale.

    I know, I could use an enum with the names and values according to, but this is not very satisfactory.

    So perhaps the question would be: is it possible to combine two digital controls or the value for the prefix, in a suitable and easy way? Or how do you manage the digital values over several orders of magnitude in a case like mine?

    Thanks for your replies in advance.

    Best,

    bastlwastl

    Display format is SI units

    It helps in these situations

  • USB6259 static with digital trigger

    Hello

    I have a VI that controls a control of linear motor with digital lines. At one point in the program setting one of these pipes triggers a task of analog input and a task of Pulse counter. This is done by putting a wire between the digital line and for example. PFI0 use this as a the input trigger. This works well.

    My general question: is it a solution, where I can use an internal signal of the 6259 avoiding the connection of the wire?

    Matthias

    Hi mq17,

    I have found no clear information, saying that it is possible (or impossible). What you should try is to create an internal route between the digital line and PFI0 using the DAQmx connect Terminal VI. I can't guarantee this will work, but it's worth trying:

    DAQmx connect terminals (VI)

    http://zone.NI.com/reference/en-XX/help/370469AA-01/lvdaqmx/mxconnectterminals/

    Don't forget to unplug the terminals at the end of your program

    Best regards

  • Digital controls by default Reint?

    I am VERY new to LabVIEW and were loaded to think beyond my skill level. I'm sure it's an easy fix, but I am at a loss.

    I have a digital control that changes of the user. The value of the digital control is then added with a reading of a strain gauge. I need to find a way to return the digital order to its default value. I read something on the forums on the use of a node to invoke, but I don't have a clue how to set up.

    Thank you so much, in advance.

    Thank you so much, I spent hours trying to use the loops and conditions. I didn't know where to put it in my program. One of the loops has finished the program to the point where the display was 5 seconds behind the data behind.

    You guys are life savers!

    Here is a selection of the node implimented. I used a button to "lock when you press on.

  • Can I use a digital control to change the illustrated index of an array?

    Hey people,

    This could be one of these questions, get feedback 'why would you do?', but I wonder if there is a fairly simple solution, I don't know everything...

    I know that tables are not exactly gems when it comes to claims for benefits, but with my particular application, if I could get a digital control to define what the array index appears, it would be great.  In addition, assuming that it is possible, then I think I could find a way to have two Boolean values which would increment/decrement the element indicated by updating the digital too...

    Any ideas?

    A popular entry!

    THX

    Is that what you wanted to achieve

Maybe you are looking for

  • Remove options for sites to add to the search bar

    How the little green plus can prevent appering in my search bar? I don't want to anythin other than Google. Since the last update, it is not possible to double click previous text in the search in any bar. It's super annoying, when you double-click t

  • Satellite P870/019 BSOD when trying to stop Windows 8

    Brand new out of the box P870/019BSOD when trying to stop... restarting the laptop. Windows 8 Error SESSION_HAS_VALID_POOL_ON_EXIT Someone knows how to solve? If I stopped with the power button everything all right! Post edited by: Pppp

  • Slow download speed of RVS 4000

    I use a Cisco RVS 4000 to test a new internet connection of 10 M / 10 M.  I'm having a little problem, the test of speed of PSI (speedtest.cavtel.net).  Download test always gives me 10Mbit/s, maximum for the connection speed, but the download speed

  • Activation of Windows Vista again

    After update material, now I wonder to activate Windows Vista again, but it's the same windows that I always had.

  • Adding a Virtual Machine to a domain

    Please, what is the best way to add a virtual machine to a domain.