LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rising Edge

Hello,
 
does anybody have a simple solution for this problem?
 
Push-Button     LED
        0                 0
        1                 1
        0                 1
        1                 0 
        0                 0
 
With the first rising edge the LED should be switched on and with the next rising edge the LED should be switched of and so on. 
 
LV 6.0
 
 
Regards
ThomasD
0 Kudos
Message 1 of 9
(4,034 Views)
Thomas,

should that be in LV only or is there hardware involved? if only in LV: what is the mechanical action of the button?

Norbert B.
NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 9
(4,027 Views)

Hello Norbert,

hardware is only indirect involved. In the way with Push-Button and the LED I will do a previous check of the function in LV only. Later I will read in a signal from a pushbutton over the parallel port. The pushbutton which will be read in should work like a switch. Rising edge of the pushbutton --> "LED on" next rising edge of the pushbutton --> "LED off". I like to simulate this in LV.

 

 

0 Kudos
Message 3 of 9
(4,024 Views)
Thomas,

then you can do the following:
check the button (depends on architecture of your vi, use polling or event-based programming here)
compare with old status of button (shiftregister in while-loop)
if edge=rising
    toggle LED-status (shiftregister in while-loop)

this should work out quite easily for your needs.

Norbert B.
NI Germany
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 9
(4,019 Views)
Hi Thomas,
look at attached VI
 
You looking for something like this?
 
Regards
 
Dev
 
0 Kudos
Message 5 of 9
(4,018 Views)

Opps! did not observe you have LabVIEW 6.0

sorry, i do not have that version on any of my systems.

Sorry again for the goof up

regards

Dev

 

 

0 Kudos
Message 6 of 9
(4,014 Views)

Hi Dev,

can you post a picture from the VI?

0 Kudos
Message 7 of 9
(4,010 Views)
Hi Thomas,
 
Here's how to do it with a very simple "XOR with previous value" method.
 
Note that it is important that the switch's "mechanical mode" is "latch when pressed" or it will not behave as you expect - experiment with the different "mechanical modes" and you will see.
 
I would have posted a lot sooner if I hadn't had to save all the way back to version 6.0 - time you upgraded perhaps?
 
Regards.
 
Mark H.
0 Kudos
Message 8 of 9
(4,005 Views)
Hi Thomas,
 
Here is a Pic of the block diagram
 
In the shown block diagram, Click is a Boolean swithc with its mechanical action property set to 'latch when pressed'
 
and in the false state of the case structure, the boolean value from shift register is wired out
 
Regards
 
Dev
 
 
 
 
Download All
0 Kudos
Message 9 of 9
(4,004 Views)