LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rotary motion sensor on NI myDAQ

Well you have to listen to the what the error is telling you... You said above that the encoder is going to send a signal to two different channels depending on the direction, right? So set the two different channels, not the same channel twice. You have "ctr0" selected twice, where you probably want "ctr1" as the second channel.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 11 of 18
(1,194 Views)

Ahh okay thats what I thought sadly I do not have a crt1.

0 Kudos
Message 12 of 18
(1,190 Views)

Ah, I just looked at the specs and you're right, only one counter, so you are limited here by your hardware. Seems like you need to use the digital inputs then to get both channels.

 

What sample rate did you set it to earlier when you were using the first method I replied with? Can you calculate what rate the pulses will be coming in at? Please include the version of your VI that you said was still missing pulses.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 13 of 18
(1,187 Views)

Hey I'm back.

 

So when I tried to run continues samples I recived this error:

 

Error -200077 occurred at DAQ Assistant

Possible Reason(s):
Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.
Property: SampTimingType
Requested Value: Sample Clock
Possible Values: On Demand

 

So my understanding is thats the timing vi not working but is that because of my hardware or my vi.

 

 

and the vi that was skipping pulses was the fancy array one.

 

0 Kudos
Message 14 of 18
(1,176 Views)

It looks like your Digital channels are limited to software timing, unfortunately. This may mean you are out of luck for two separate encoder signals on this device. Could you possibly make due with not knowing which direction the encoder is spinning? Can you just hook both signals up to the same counter channel? They would never be counting at the same time, so essentially you would just be losing the knowledge of which direction is being counted.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 15 of 18
(1,170 Views)

Here is my 2nd attempt to get it working without using the assistant which yields the same error.

 

Error -200077 occurred at Property Node DAQmx Timing (arg 1) in DAQmx Timing (Sample Clock).vi:4730003->Continuoustest#2.vi

 

Possible reason(s):

Requested value is not a supported value for this property. The property value may be invalid because it conflicts with another property.

Property: SampTimingType
Requested Value: Sample Clock
Possible Values: On Demand

0 Kudos
Message 16 of 18
(1,168 Views)

Sadly no the direction of the rotation is pretty important.

0 Kudos
Message 17 of 18
(1,166 Views)

When you are working with encoders, you really need the hardware to be fast enough to keep up. Your MyDAQ just isn't made to pull from the digital channels at a rapid rate and only has the single counter input that can be hardware timed. If you had a MyRIO, that would be another story.

 

Anybody else here have a clever way around this?

In summery for others: RyanKlimowski has a MyDAQ and an encoder. The encoder outputs two signals, one for each direction. The MyDAQ has only one counter input, but a bunch of digital inputs. The software-timed digital inputs aren't fast enough to catch all encoder pulses when looping as fast as possible.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 18 of 18
(1,164 Views)