Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6008 + Buffer on PFI0? (Encoder acq)

Hi, I'm using labview 7.1 on Windows XP Professional.
I'm reading in 1 pulse per rev on an encoder through the PFI0 counter channel on the USB6008. With Each pulse I'm attaching a time stamp, making the time stamp and encoder pulse into a concantenate string and then sending the data to a file, so I can few the Encoder pulses next to a time, to work out velocity and acceleration.
 
I want to readin from the encoder for about 10 seconds starting at about 400ppm up to maybe 1400ppm as the encoder is accelerated.
The data I'm getting out on my file counts the pulses for about 4secs (160 pulses/ revs) then freezes for about a second and continues again at say 200 pulses/revs.
 
Anyone have any idea why this is happening? PFI0 is rated for a frequency of 5MHZ.
 
Thanks Alot,
Robin
0 Kudos
Message 1 of 11
(5,879 Views)
Hi,

This is probably more architectural - the write to file operation takes a relatively long time, and this could be the root of the issue depending on how you have coded your VI. Could you post your code so that I can check it out?

Regards,

Dan - NIUK
0 Kudos
Message 2 of 11
(5,859 Views)
I was thinking that could be the problem. When writing to the file if I declare it say C:/encoder.xls it appears to skip more often than if i just declare it as C:/encoder Do you think the USB 6008 and attaching the time stamp through the software will be accurate enough to attach a time stamp to each encoder pulse that may only be 0.01 secs apart? Thanks for the Help.
0 Kudos
Message 3 of 11
(5,856 Views)
I'll Just attach An outputed file so you can see for yourself the type of output. Thanks Again
0 Kudos
Message 4 of 11
(5,854 Views)
I have access to a PCI 6023E card and Daq also, is there an onboard timing device/crystal on the PCI card that would be more accurate than having the software attach the time stamp?
0 Kudos
Message 5 of 11
(5,848 Views)
Hi,

I have been looking into this - and after several tests, I haven't currently been able to replicate the issue where the file "skips" measurements. Attached is an example of the output I am seeing. Let me know your thoughts.

Also, I don't have a 1 pulse/rev encoder, I only have access to a 24 pulse/rev one. Although this shouldn't matter.

Regards,

Dan
0 Kudos
Message 6 of 11
(5,829 Views)
Apologies - attached
0 Kudos
Message 7 of 11
(5,828 Views)
I see it has skipped at cell 356/357 but only once, which would be fine If i could get mine to do the same. Your managing to acquire >400 samples in about 8 seconds too which is pretty fast compared to mine also. I'm at a loss as to what the problem is. I've tried running the VI having taken out the function to attach the time stamp, and it still skips. With regard to the timing which I mentioned on the phone, I don't think Windows clock or maybe its the rate at which the time stamps are added are accurate enough to be able to determine the velocity, and hence acceleration of the drum. If you were using a drill to spin the encoder at 1 trigger setting the speed of the encoder should be almost the exact same for each cell. See attached Test(withcalc) Appreciated the Help Thanks Rob
0 Kudos
Message 8 of 11
(5,824 Views)

Hi again,

Sorry about the delay in replying - I have managed to move the file write outside of the loop, so this should now be less suseptible to "skipping". In fact, since it is now just array operations inside the loop, the write to file now happens all in one write, so in theory it should now never skip a measurement. Let me know the results of you using this modified VI.

Regards,

Dan

0 Kudos
Message 9 of 11
(5,792 Views)

Hi Dan,

I can't open that file. I'm running labview 7.1, it says 8.5 on it.

Where the string is in the while loop, I want to insert however many readings i get into an array and not even send them out to a file but i tried wiring the string to the while loop, clicking enable indexing and creating an indicator to show the values in an array on screen without exporting them, but nothing is appearing in the array. Is there a quick solution to this? This should elimate the slowing of the cycle to write to file also, and later allow me draw a graph on screen.

Thanks again.



Message Edited by RobWatson on 04-28-2008 05:15 AM
0 Kudos
Message 10 of 11
(5,774 Views)