12-06-2007 07:56 PM
12-06-2007 08:44 PM
12-07-2007 09:52 AM
04-07-2008 02:32 AM
Hi..
I thought, i make the project same as you did thibault. My purposes is also same. I need to read from two sensor device with different measurenment (both are positioning sensor one is linear one is angle). I want to know the phase difference from both sensor. But i got a problem here. I don't understand the explanation that dennis told you. Add channels?? is it work?? Because when i tried that i could not read from different measurenment sensor. And how about if use low level VI not express VI? Could i use producer/ consumer template.
Thanks for your help
Regards
04-07-2008 04:09 PM
04-08-2008 04:22 AM
04-09-2008
03:54 PM
- last edited on
09-22-2026
09:49 PM
by
Content Cleaner
Hello Dani,
I assume, based on your position sensors and the image you posted, that you are using counters to acquire your data. Is this correct? If so, it is important to note that you cannot add multiple counter operations to a single task because they have different timing requirements and all channels in a single task must share the same timing and triggering. In fact, if you attempt to add a second counter channel to a DAQ Assistant for a counter operation, you will receive the following error when you try to close the configuration window:

So, you will have to use two different tasks to acquire your counter data. You can do this either by using two separate DAQ Assistants or by using two different tasks in the NI-DAQmx sub-VIs in LabVIEW. Since you are trying to compare the phase difference between the two measurements, you will also need to synchronize the operations so that you are reading from both counters simultaneously. There are several resources online which discuss synchronizing counters.
It would probably be easier to use the NI-DAQmx Sub-VIs to implement this synchronization because they give you more control over specific parameters of your task. You can use the NI Example Finder to browse some examples which use the NI-DAQmx sub-VIs for counters. You can open the NI Example Finder by going to Help>>Find Examples... in LabVIEW. Once in the NI Example Finder, you can find the counter examples by selecting the Browse tab and navigating to Hardware Input and Output>>DAQmx>>Counter Measurements; then you can select the Position category (shown below) to find the Position measurement examples.

Let us know if you have any other questions about taking position measurements.
Message Edited by Matt A on 04-09-2008 03:55 PM
04-15-2008 01:28 AM
04-15-2008
11:04 AM
- last edited on
09-22-2026
09:50 PM
by
Content Cleaner
Hello Dani,
Choosing the right architecture for your application depends a lot on what you are trying to accomplish. You mentioned that you wanted to calculate the phase difference between two sensors, so the next question would be this: what do you want to do with the data once you have got it? Do you want to display the phase difference? Do you need to keep historical information or do you only want to know the current phase difference? Do you need to store this data to a file after you have calculated it? All these factors will help you choose the right framework for your program. In general, the producer/consumer architecture is best suited for applications where the acquisition is high throughput (high speed or high channel count) and requires a great deal of processing capability. By placing the data acquisition in the producer loop and the processing in the consumer loop, we allow independent software timing, which means that the data acquisition can occur as fast as it needs to and the data can be queued for later processing. However, if you are acquiring at lower rates this architecture may not be necessary.
In regards to your sensors, I have a couple questions about what you are trying to accomplish. In your first post you mention that you are acquiring position from two sensors (one linear and one angular). However, you have also mentioned that you are trying to measure the phase difference between the two sensors. I am wondering how you want to determine phase difference since one of the encoders is angular (measures rotational angle) and one is linear (measures linear distance)? Do you mean that you would like to measure the phase difference between the A and B signals on the two encoders? If so, you would not be able to use the position task to perform this action because the position tasks merely look at the difference between the A & B signals and do not necessarily consider the phase of the difference (they assume a 90 degree phase shift). This tutorial about encoders explains the concept in more detail. If this is the type of operation you are trying to perform, you may want to consider another method for taking your measurement. Either using multiple counters to compare the A & B signals on each encoder, or using an analog input channel to acquire the raw voltage are possibilities for this type of operation. If you could provide some more details about exactly what you are trying to measure, I might be able to provide a more detailed recommendation about how to proceed.
04-16-2008 02:37 AM