03-31-2022 01:01 AM
Hello. I need to make a VI that acquires a signal from an encoder and decodes it, the output of this decoding must be binary. The VIs that are needed are: CI Angular Encoder, Counter DBL 1Samp and two Timed Loops. The VI that I have does not work for me, who could help me?
03-31-2022 01:54 AM
Hi Benru,
@Benru wrote:
Hello. I need to make a VI that acquires a signal from an encoder and decodes it, the output of this decoding must be binary. The VIs that are needed are: CI Angular Encoder, Counter DBL 1Samp and two Timed Loops. The VI that I have does not work for me,
Is this some kind of homework?
And what kind of help with your VI do you expect when you don't attach that VI?
03-31-2022 09:43 AM
It's for homework. Sorry, I didn't clarify my question, I attached a photo.
03-31-2022 09:54 AM
Just to let you know, this is a *bad* homework problem. I see no reason for 2 loops of any kind and also no reason to specify a Timed Loop. In real life, I've found it pretty rare to use a Timed Loop under Windows. Its expected benefits tend to be illusory and it comes with some CPU and threading downsides.
-Kevin P
03-31-2022 10:12 AM
well, however those are the specifications that they ask me for
03-31-2022 10:18 AM
Hi Benru,
@Benru wrote:
It's for homework. Sorry, I didn't clarify my question, I attached a photo.
I agree, it's a badly designed homework task… The way those two loops are used is completely nonsense!
As you have a VI with all the mentioned items of that homework task you already solved the homework, did you!?
03-31-2022 10:36 AM
What is the point of running a TWL (iterating at 1 Hz) inside another TWL (iterating at exactly the same speed)?
A/ I haven't adjusted the TWL frequency yet.
I need to take two signals from an encoder (signal A and B). The Timed Loops ask me to be two in order to decode the information that comes from the encoder. The first Timed Loop is scheduled with higher priority, the last one with second priority.
How does the outer loop stop?
A/ I haven't programmed it yet
What is the purpose of that outer loop?
Why do you need a local "duty cycle"?
R/ The base of the decoding is a counter, I deduced that I should put it
Why is there another wait function inside a TWL? (???)
R/ I understand that they should go inside to give it priority, I'm not sure
Since you have a VI with all the mentioned items from that task, you already solved the task, right? A/ No
03-31-2022 12:11 PM
To the OP: can you post the exact original assignment, both the wording and whatever starting code (if any) was provided?
We aren't here to *do* anyone's homework, but many folks are willing to give nudges and hints to help you learn from your homework. In this instance however, please try *not* to learn techniques that over-use Timed Loops (and quite often, 1 of them is already over-use).
I'd probably be obstinate, do the encoder stuff without any loops, then drop down 2 Timed Loops with no code inside except a True constant wired to their Stop terminals.
-Kevin P