Hello Dani,
I'm afraid I still don't understand what you mean by "phase difference" between your data. You mention that you want to acquire the data at the same time and compare the results to determine velocity. However, a linear encoder task will return data in terms of inches, meters or number of ticks; meanwhile, an angular encoder returns data in terms of degrees, radians or ticks. The number of rotations per second will give you an angular velocity (provided that you know something about the distance covered in one rotation. The linear encoder returns directional velocity based on movement in one direction or another versus time. This two are different phenomena as the angular velocity depends on the radius and measures the change in phase with respect to time. Linear velocity is merely a measure of distance versus time. I do not understand how to plan to compare the phase of the two?
One thing I would point out is that if you are trying to correlate measurements at all you will need to synchronize your operations to ensure that the data you compare is related. That means that you would probably need to share sample clocks (so that each sample is acquired at the same time) and share arm start triggers (so that the operations begin sampling at the same time). For an example of this operation I would recommend that you go to the NI Example Finder (
Help>>Find Examples from the LabVIEW Toolbar) and browse to the example called Meas Angular Position-Buffered-Cont-Ext-Clk-Arm Start Trig.vi (
Hardware Input and Output>>DAQmx>>Counter Measurements>>Position). This example shows how to import and external clock and use an arm start trigger to begin acquisition. If you use the same arm start trigger and sample clock source for you angular and linear position measurements, then the acquired data will be synchronized. The synchronization will allow you to correlate the data in any way that you need.
Matt Anderson
Hardware Services Marketing Manager
National Instruments