08-10-2008 04:09 PM
Hello,
My masters project has taken a turn and now I am using the speed of sound.
There are two arguments that have arisen. One from my supervisor who says that LabVIEW
is used in industry and that it is a real-time environment, meaning I would be
able to measure the time taken for sound to travel x metres (minimum 0.5m and 7m
maximum).
On the other hand the Labview guru on
campus has suggested that using a USB interface, and the fact that Windows XP
is not a real time environment would not return true times and there are other priorities
that Windows has to handle firs giving erroneous times.
Which argument is true, and which solution should I take.
Firstly, should I using a microcontroller with dedicated timers to time the
sound by starting a counter at 1.2MHz and take start value and finish value and
then working backwards to get the time, with the obvious hard part of setting
up communications with Labview through serial.
Or should I purchase some sort of serial/USB interface for Labview that would
be able to handle the job. If this option is best suited, are there any recommendations
for hardware? I'm using the SCB-68 which can only be used on a desktop
computer. I need something that is either Serial or USB as the final product
will be controller via laptop.
Cheers
08-11-2008 01:08 PM
Kamilan,
There is truth in both statements but it depends on the testing being done. NI has a LabVIEW Realtime Module which can be used to respond to events in a deterministic fashion. Software processing on a Windows XP machine will not be deterministic but will be on a real time operating system such as Pharlap. On the other hand, acquiring data will be deterministic because it will utilize the DAQ Hardware and its clock. The important note to make is that the software processing will not give you deterministic behavior if you are not using a real-time operating system.
In terms of the acquisition, I believe that you may just want to start your microphones simultaneously and then post process the data to find the change in time. The other option would be to start your data acquisition devices simultaneously and then post process the data. It sounds as if this will run only once and then the data is viewed. The counter method would also be feasible and would only require one additional software processing step: # of counts/timebase used. If you need a USB DAQ device then I might recommend the 621x series or a card such as the USB-6218. The final design will depend on the equipment available to you and if devices can be started simultaneously.
08-11-2008 03:59 PM
Hello,
I will take all that you said into consideration. I was talking to my Dad about the problem and an idea popped into my head. Its a combination of both solutions. I figured that I could build an external square wave oscillator. Instead of using a software timer, have Labview read rising edges. When I tell the robot to make the beep, Labview will start counting rising edges, and then when the "received" signal is received, stop counting.
This way, if we know the frequency, the time can be calculated. The higher the oscillator frequency, the higher the resolution. What do you think? Will this USB interface be able to handle high clock speeds?
Cheers
K
08-12-2008 10:52 AM
Kamilan,
Looks like a good starting place. The maximum detectable frequency of a counter is going to be the timebase utilized / 4. You are correct to assume that a higher frequency means better resolution, though. You could also configure a pulse width measurement with the counter on your daq device. This developer zone provides a little more insight into this application. Basically, you could provide a signal to your gate which will tell how long the signal is traveling. (while traveling the signal is high) The source will be your internal timebase and you can take your count and find the time. Hope this suggestion helps!
08-12-2008 06:21 PM
Hello,
I'm just testing if I can use an external oscillator to timer. I'm using a NI-PCI 6229 and a SCB-68 interface box. I'm having trouble with the connections. Any advice for using the DAQx?
The is not wiring diagram, so I’m not sure where to put the signal in.
Cheers
K
08-13-2008 11:26 AM
Kamilan,
The pinouts of the PCI-6229 can be found on page 22 of the PCI-622x manual. The wiring will depend on the exact application that you wish to achieve. For example, if you would like to count the number of pulses from the external oscillator then you would need to place your oscillating signal in the source of a counter. I have also included an image which shows what the pinouts of the 6229 correspond to. Hope this helps.
08-13-2008 08:44 PM
Hi,
Thank you so much for that data. It's exactly what I was looking for. I will post an update on my progress Monday when I am in the Labs next.
Cheers
K
08-18-2008 04:57 PM
08-19-2008 09:36 AM
Kamilan,
You could utilize buffered event counting for this. You would need to have a control signal coming into the counter's gate while the signal being counted is attached to the source. The only caveat here is that there would have to be a start and stop signal both sharing the gate. More information concerning the Buffered Event Counting can be found here. You may also wish to utilize an arm start trigger for your application. The following line was taken from the DAQmx Help "When you configure an Arm Start Trigger, a counter task does not respond to any Start Triggers until after the Arm Start Trigger occurs. You can configure this trigger to occur on a digital edge." This means that counting will not occur until the arm start trigger is encountered and then you can also have the stop signal coming into the gate of the counter. The count that is latched into the buffer at this point should be the count from the time of the start to the stop signal. This example illustrates how to setup an arm start trigger for a different counter application. You will notice that the trigger has to be setup using property nodes.
09-16-2008 07:51 PM
Hello
I've got the program working with the NI PCI 6229 and SCB-68. Is there a USB equivalent that I can use on a laptop that will give me the same DAQs? Here is my code. So you can see how many Inputs and outputs I need. There is an addition 5 digital outs needed to drive the robot.
Any advice would be great
Cheers
K