LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I have an optical sensor how do I get a RPM or frequency measurement?

Dear Ian

Thank you for your e-mail.  I would like to record the per second speeds over time, so I can record the acceleration if any.  It would be great if I could output to something like Excel.

I’m happy to rate your e-mails very highly. I just can’t see where to click, sorry.

Best wishes

Robert

 

 

0 Kudos
Message 11 of 27
(1,946 Views)
Hi Robert,

I've realised that you wouldn't be able to see that rating tool, sorry, but thanks for the comments, they are much appreciated.

It is relitivly simple to get those measurements into an excel spreadsheet. You can use the VI called "Write to Spreadsheet.vi" under the File I/O pallette which generates a file that you can open in Excell. For more information go to Help>>Search The LabVIEW Help, go to "Index" and enter "Write To Spreadsheet File".

Have a go at this and feel free to attach your efforts in a reply to this post if you get suck and I will take a look at it for you.

Best Regards,

Ian
0 Kudos
Message 12 of 27
(1,934 Views)

Dear Ian

Thanks for your help getting me started.  I have been modifying the program you started.

I have been trying to measure the pulses a little more accurately.  I’m trying to measure the time between pulses which seems to work.  But I seem to have problems measuring three signals at once, two work well but the third is erratic. Can you help?  Thanks

Best wishes

Robert  

0 Kudos
Message 13 of 27
(1,910 Views)
Hi Rob,

I am going to need more information in order to suggest anything I'm afraid. If you are willing to attach your code I'd be happy to see your issue first hand and see what I can do, else please describe how you are implimenting your Data Acquisition. Is it a single Task with multiple chanels or is it 3 independant tasks? Furthermore, what exactly do you mean by erratic? Is the signal noisy, innacturate or completly non-sensical?

Thanks,

Ian
Message 14 of 27
(1,891 Views)

Dear Ian

Thanks for your e-mail; I have attached the code for the three optical sensor input.  I think the problem is that the data only updates at the speed of the slowest input, (main rotor is running at 150Hz while the input is 4Hz).  Also, if any of the sensors miss a pulse they throw the other sensors out.  I would welcome your feedback on the code.

Thanks for your help

Best wishes

Robert

Message 15 of 27
(1,863 Views)
Hi Robert,

I have tried restructuring your code into seperate loops. This should mean that each acquisition is independant but I have not been able to test it using the hardware that I have available to me. It would be great to know if it works after you try it out. If it doesn't if you could give as much info as possible on what happens that would be great.

Best Regards,

Ian

P.S. You will have to change the controls governing the physical channel of your counters, and also the filepath for the excell file.
Message 16 of 27
(1,839 Views)

Dear Ian

Thank you for the code, I have entered a file path for the data.  When the program starts it asks if it is OK to replace the existing file.  If you click "OK" then the the same message appears again and again.  Clicking "cancel" does the same thing and you end up in a loop.  So you can not start the program.

Best wishes

Robert

0 Kudos
Message 17 of 27
(1,830 Views)
In the lower loop, move the file open function before the loop.  The error is that the file is being opened on every iteration of the loop and could lead to an out of memory problem because the file is only close once the loop ends.
0 Kudos
Message 18 of 27
(1,817 Views)
Yep thats right, my mistake on that one.
 
Thanks Ravens Fan,
 
Ian
0 Kudos
Message 19 of 27
(1,814 Views)
Thanks, I got the code running.  There is one small problem when exporting to Excel it seems to make 18-20 entries for each time step so a few seconds recording uses up all of Excel's 65,000 rows.  I have looked and can't see how I'm managing to do this.  Can you help?  Thanks again for all your help.
 
Best wishes
 
Robert
0 Kudos
Message 20 of 27
(1,730 Views)