|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: How to toggle a relay with one button?
I was asked to provide a screenshot of what our team's Toggle VI looks like, so here's how it works!
|
|
#2
|
||||
|
||||
|
Re: How to toggle a relay with one button?
Note: Remember that this VI would have to be set to Reentrant Execution (under VI Properties>Execution) in order to have a separate saved state at the feedback nodes for each instance of the VI. Otherwise it will not work properly at all (rising edge detection fails and all outputs will be locked together...).
|
|
#3
|
|||
|
|||
|
Re: How to toggle a relay with one button?
Ugh. The LabVIEW Developer in me can't stand feedback nodes. They make everything so much harder to understand.
|
|
#4
|
||||
|
||||
|
Re: How to toggle a relay with one button?
Quote:
|
|
#5
|
|||
|
|||
|
Re: How to toggle a relay with one button?
I understand them, but they break left to right data flow, which is considered a no-no in most of the LabVIEW world.
I prefer to use shift registers and while loops. |
|
#7
|
|||
|
|||
|
Re: How to toggle a relay with one button?
Generally, yes.
I find that vi to be difficult to understand, as the loop that causes the feedback nodes to contain data is outside the scope of the vi. Tracking the flow of the program gets much harder that way. |
|
#8
|
||||
|
||||
|
Re: How to toggle a relay with one button?
Can you post a PNG or GIF of how you would re-write that?
|
|
#9
|
|||
|
|||
|
Re: How to toggle a relay with one button?
This would have identical function to the other one. Similar in compactness, and IMO easier to understand what is happening. Its a style thing though, I fully understand that other people may find feedback nodes easier to understand.
Last edited by Racer26 : 03-07-2013 at 14:45. |
|
#10
|
||||||
|
||||||
|
Re: How to toggle a relay with one button?
Don't you need to leave the shift registers uninitialized for this to work?
|
|
#11
|
|||
|
|||
|
Re: How to toggle a relay with one button?
D'oh. Yes, you do. Fixed.
|
|
#12
|
||||
|
||||
|
Re: How to toggle a relay with one button?
|
|
#13
|
||||
|
||||
|
Re: How to toggle a relay with one button?
Quote:
![]() |
|
#14
|
||||
|
||||
|
Re: How to toggle a relay with one button?
In the posted example, only one of the feedback nodes "breaks" this flow, the other is oriented left to right. And there is an arrow...
|
|
#15
|
|||
|
|||
|
Re: How to toggle a relay with one button?
Quote:
Personally, I find it difficult. Especially without the loop there to show that the code you're looking at is actually being called in a looping fashion to populate the feedback nodes. I'm pretty sure its a personal preference thing though. I have little-to-no experience with using LabVIEW in an FRC environment. Are we able to use event structures? Most of the LabVIEW programs I write make heavy use of the Event Structure to control process flow. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|