Hello!
I am using an NI USB-6001 to calculate the speed of a moving wire.
The wire rotates a wheel with a known diameter and an inductive sensor pulses 4 times each rotation when it detects holes evenly spaced around the wheel.
The sensor output is connected to the P2.0/PFI 0 input.
I use a counter function The Daqmx U32 single channel single sample. Each time the aquisition loop runs I use a get time in seconds function to timestamp the aquisition.
I calculate the speed in a paralelle loop by subtracting the timestamps taken from the 2 newest counter increments.
The program also does other tasks such as monitoring other inputs and uppdating outputs. It also collects values in an array and writes an excel report when data gathering has ended.
When the wire was pulled by a machine at a relatively constant speed I noticed spikes in the graph for the wire speed.
I suspected there was a hardware fault so I made a pulse generator from a PLC and connected it to the counter input and got the same results.
Now I suspect there is a timing issue or it has something to do with OS scheduling and labview priority. This is running on a windows 8 laptop.
Any ideas?