LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Acquisition of signals through Encoder signal

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?

0 Kudos
Message 1 of 8
(1,864 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(1,850 Views)

It's for homework. Sorry, I didn't clarify my question, I attached a photo.

0 Kudos
Message 3 of 8
(1,831 Views)

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

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 8
(1,824 Views)

well, however those are the specifications that they ask me for

0 Kudos
Message 5 of 8
(1,818 Views)

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!

  • What's the point in running a TWL (iterating at 1Hz) inside another TWL (iterating at exactly the same speed)?
  • How do you stop the outer loop?
  • What's the purpose of that outer loop?
  • Why do you need a local of "duty cycle"?
  • Why is there another wait function inside a TWL? (???)

 

As you have a VI with all the mentioned items of that homework task you already solved the homework, did you!?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(1,816 Views)

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

0 Kudos
Message 7 of 8
(1,813 Views)

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

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 8 of 8
(1,795 Views)