|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#17
|
|||
|
|||
|
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. |
|
#18
|
||||
|
||||
|
Re: How to toggle a relay with one button?
Can you post a PNG or GIF of how you would re-write that?
|
|
#19
|
|||
|
|||
|
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. |
|
#20
|
||||||
|
||||||
|
Re: How to toggle a relay with one button?
Don't you need to leave the shift registers uninitialized for this to work?
|
|
#21
|
|||
|
|||
|
Re: How to toggle a relay with one button?
D'oh. Yes, you do. Fixed.
|
|
#22
|
||||
|
||||
|
Re: How to toggle a relay with one button?
Quote:
![]() |
|
#23
|
||||
|
||||
|
Re: How to toggle a relay with one button?
|
|
#24
|
||||
|
||||
|
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...
|
|
#25
|
|||
|
|||
|
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. |
|
#26
|
|||
|
|||
|
Re: How to toggle a relay with one button?
Teams can use event structures, but few do. This is RT, so very little UI and not much need for user events.
As for the shift register versus feedback node. It took awhile for me to warm up to the feedback. I was so used to doing it with loops. I now use a mix. I typically use a shift register if it already has a loop or if it is a functional global. I use a feedback node if it is like the button example and is super local. I find that I change direction on the node when doing a compare for change, it makes much more sense to me. If I need the i-1 term for something else, I typically leave it in the default direction. I don't go for separating the init from the feedback. As you say, it is a style decision. Greg McKaskle |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|