LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

linear encoder Questions

I am using the attached VI, taken from the developer zone examples section of this site, with Labview 7.0 and a PCI-6220 card.  My problem is that I cannot seem to get the counter set correctly.  When I run the program configured as it is in the current attached VI, I get this error:
"
    External sample clock source must be specified for this application.

    Unspecified Property: SampClk.Src
    Channel Name: Dev2/ctr0

    Task Name: _unnamedTas
"

The problem seems to arise from the counter input going to the first DAQmx task.  I cannot pick anything other than 'ctr 1 or ctr 2', however, and both of these get the same response.

Your input is VERY much appreciated!!!


0 Kudos
Message 1 of 10
(4,062 Views)
???
0 Kudos
Message 2 of 10
(4,054 Views)
Pleeeease!
0 Kudos
Message 3 of 10
(4,044 Views)
Sorry for being so persistant, but I honestly have no idea.  I have been fiddling with it for the last few hours & have come up with no viable solution :(.
0 Kudos
Message 4 of 10
(4,040 Views)
Hey heepofajeep,

Thank you for contacting National Instruments.  Give this a try.  The modified program runs fine on my machine with no errors, but I do not have an encoder connected.  Therefore, I am unable to get any encoder data.  I modified the sample clock source.  Instead of having the same sample clock source for both sample clocks I just set the sample clock source for the counter channel.  I also made the AI task start before CI task.  Let me know if this does not work for you or if you have any further questions.  Also, could you send me the link from where you got this dev zone example?

Thanks,
Jason W
Application Engineer
National Instruments
0 Kudos
Message 5 of 10
(4,007 Views)
Thank you for the repy!  I cannot seem to find where I got the code, I will try & look a little harder this evening.  Regarding the updated code, however, I did get it to work, although I have not verified with the encoder.  I ended up just using DAQ assistant, which seems to be doing the job.

I am still running into a problem, however... When I get to a certain [small] range along the encoder track, the waveform graph immediately goes to 0, and resets.  I am assuming this is a hardware problem as the cause, but I am curious as to why the graph would immediately go to zero [why doesn't it just loose accuracy? ].

Also, in the example code above, what does the term 'counter' designate?  I am a little unsure how the counter works I guess.

Thanks!
0 Kudos
Message 6 of 10
(3,984 Views)
BTT again. 
0 Kudos
Message 7 of 10
(3,980 Views)
0 Kudos
Message 8 of 10
(3,960 Views)
Hey heepofajeep,

I'm not sure I understand you're last post.  What do you mean by "just loose accuracy"?  What exactly are you trying to accomplish with this program?  What are you measuring with your analog input?  Sorry for the multiple questions...I'm just trying to understand what problem you are still having so I can help you fix your problem.
The term "counter" sets the physical channel on your daq card.  For your device there is 2 counters.  This just allows you to select which counter you want to use.

Thanks,
Jason W
Appliication Engineer
National Instruments
0 Kudos
Message 9 of 10
(3,946 Views)
So how do you use a clock?  That is very much what I would like, but I have absolutely no idea how... When I go into DAQ assistant, I can only select external encoder?
0 Kudos
Message 10 of 10
(3,895 Views)