|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: LV Not Responding to Variable Assignments
did you go to where the indicator is on the front panel and check if it is changing to the values you want? Because it could just be the coding of the encoder code itself, and not actually the variable
|
|
#2
|
|||
|
|||
|
Re: LV Not Responding to Variable Assignments
The encoder values seems to be messed up if I run it normally though; that is, start counting and get value all in the same teleop loop (ideally I have start counting and get value mutually exclusive). It just starts counting 1 to infinity, though doing anything to the physical encoder doesn't seem to be augumenting it in any way. The encoder seems to be wired right, A to DIO 1, B to DIO 2, power from DIO 1, ground to DIO 2.
|
|
#3
|
|||||
|
|||||
|
Re: LV Not Responding to Variable Assignments
Without seeing your code, it's hard to imagine what might be wrong. I can't quite follow your explanation of what you're trying to do. Can you show us what you're talking about so we can look it over for possible problems?
The comment about "normally" starting an encoder and reading it in the same loop doesn't seem right at all, but I'm not sure whether the problem is with the way you're describing it or whether you're actually doing what it sounds like. |
|
#4
|
|||
|
|||
|
Re: LV Not Responding to Variable Assignments
Ah...actually, I figured out what was happening.
I was causing the entire while loop in the Robot Main VI to lag up because I was trying to stick a sequence with delays in Teleop. Tried to put it in Periodic Tasks, caused the entire thing to lag up. Changed that out, and wrote out some code with timers and some crazy Boolean logic in Teleop; to me, it seems like it acts as if it was its own loop operating independently from the while loop that the Teleop VI is in (it's essentially a loop being executed sequentially). Which is precisely what I wanted it to do, heh. Solution posted below in 4 parts to describe case structures: ![]() ![]() ![]() ![]() Progression of the interior case structure inside the rightmost larger case structure is 3, 2, 1; it is dependant on time via the Timers. The outputs are going outside of the pic to feed to case structures that cause our launcher to actuate by itself. I was debating using variables for ease of programming, but used direct LabView wiring for now. Doing that also allows me to put in an emergency cutoff in case the reload goes haywire on the field. Of course, the outputs are turned on or off as dictated by the progression of time. The timer is located in the Periodic Tasks VI, having 1 added to it constantly within a while loop that loops at 10ms intervals (I thought 1ms might be excessive cRIO strain). I lost track of what I was actually doing after a bit, and I think I could increase its reliability and efficiency for sure by putting in sequential frame structures to use. Any attempt to modify it though, broke its continuity. However, it currently works the way I want it to (initializing the timer in Begin and Disabled and setting the current time variable to the threshhold in Disabled to prevent re-execution on enable), and I'm currently keeping it as is, unless someone can think of better ![]() Heck, I dunno if something like that was already built into LV. I was kinda confused by the whole Timed Loop thing >.> Last edited by ablahblah : 21-03-2012 at 23:25. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|