04-23-2009 05:30 PM
04-24-2009 12:27 PM
Hi noahgrant,
Maybe someone from the community can comment on your code.
For linking purposes, this is the original thread for this issue.
Regards,
Kevin S.
Applications Engineer
National Instruments
05-27-2009 09:34 PM
Hi noahgrant,
I've had a look at your vi and can make some suggestions that you can try.
From what I can see, your while loop with the wait timer of 100 ms and continue if true condition on it (we shall cool this loop 1) will always keep running.
The other while loop (loop 2) is nested within a couple of case structures and will only run once (false to a continue if true condition). The default case has a different condition and will always run, instead.
From what I can make of this, loop 2 and all its case structures will only run once (except for case 0, default). WHEN it runs will depend on how it was compiled on the Blackfin - case structure/loop2 may go first or loop 1 will go first.
If you want loop 2 to go first (and only go once) then you need to link the output of the case structure to the input of loop 1 - this can be done by simply wiring up a boolean to it (data flow rules).
If you want loop 2 to always be checking the status of the mode then you need to place the whole case structure within a while loop, to run continuously.
That is a very quick interpretation of what you are trying to do. There are a lot of question marks (missing vi's) and some heavy use of local variables. I would consider using sub-vi's, in particular functional global variables (FGV's).
I hope that helps.