Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using daq to measure optical sensor outputs

Hello,
I am new to Labview and wish to write a VI which will read a 24vDC signal from an optical sensor through a DAQ. I then wish to count the number of rising edges/pulses over a given time frame. The purpose of the VI is to display the distance between the marks which the optic reads. The marks are travelling at a constant speed and this program is required to confirm that the distance between each mark/ rising edge is correct.
Any help in getting me started would be greatly appreciated!
 
0 Kudos
Message 1 of 8
(4,476 Views)

Hi Tony

 

It looks like you are setting up an interesting system here. I do have a few questions about it though that will define the method of how to proceed. What kind of frequency and amplitude are you expecting from these flashes? This is important as if there is a rising gradient of 10ms or less then we can set up your system as a digital counter as it will be TTL compliant. Due to the nature of optics though I imagine that this is unlikely so you will need to record your input as an analog voltage signal.

 

This is not necessarily a bad thing and gives you two further options. If your frequency is high then you will need to do post date signal processing where as if you have a slower frequency you could probably process it real-time.

 

The best way to process it would be to find the distance between peaks as this would give you the period and so frequency of your waveform. I have written a small sample for you showing the analysis of data both from an array and from a wave form.

 

I hope this is of some help and will give you some Ideas as to how to move forward with this.

 

Best Regards

Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 2 of 8
(4,445 Views)

Hello Graham,

First of all thanks for your interest and response.

I am basically wishing to produce a program which will confirm that 50 rising edges appear within 15.965 seconds. The signal I am monitoring is a 24vDC output from an optical sensor. I am reading this signal through a NI USB 6521. As I am a new user to Labview I am struggling, I know what I want to do just not how to do it!

Thanks again.

Tony.

0 Kudos
Message 3 of 8
(4,437 Views)
Hi Tony
 
I cant find any information on the USB 6521, the 6521 does come in PCI and PXI format alternatively there is a USB 6251, can you confirm that the card you are using.
 
If it is the 6521 then as I stated above you will need to define the length of your pulses as I dont think that your light pulses will be short enough to be read in as a digital counter. I would recommend using an analog input and instead of monitoring a 50 rising edges, measure the number of peaks. You could then put some logic into your program that would question the number of peaks, the time period and therefor return a pass or fail.
 
Do you have any kind of analog hardware available to you such as a multifunction DAQ eg the USB 6251? If so then I will amend the program above to give you this logic addition and try to explain the configuration you will need in more detail.
 
best regards
Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 4 of 8
(4,390 Views)
Hi Graham,
My apologies, It is the USB 6251. I am also using LabVIEW 7.1. I was unable to open the flashing light example you attatched as it was written using a later version.
 
Thanks and best regards
Tony Bates.
0 Kudos
Message 5 of 8
(4,363 Views)
Hi Tony,
 
I just wanted to point out that the USB 6251 can not handle 24VDC on the analog input - the nominal range is +-10V. Are you planning to drop the voltage to the nominar range
 
via a voltage divider maybe?
 
The specs of the USB 6251 are at ( click on the specifications link):
 
 
Regards,
 
KostasB
 
NI UK
Message 6 of 8
(4,340 Views)
Hi tony
 
I have converted this back to 7.1 for you, what it will do is instead of regestering the rising edges it will regester the peaks, this should give you the same result but is easyer to impliment on an analogue system. can you applu this logic to your system?
 
Also what Kostas says is correct, if you have such a digh voltage modulation you may with to consider some kind of signal conditioning first so as to not damage your card.
 
best regards
 
 
Graham Green

Sr. Product Marketing Manager

National instruments
0 Kudos
Message 7 of 8
(4,325 Views)

Hello,

Thanks again for the response. I have dropped the signal down to 10 volts through a divider.

Thanks

Tony.

0 Kudos
Message 8 of 8
(4,302 Views)