08-09-2012 02:42 PM
I would like to have a simple frequency readout from a
"TSL235R Light to frequency device
I have it working with the Arduino sketch but I am now trying to get it to work with LABVIEW
I guess I need Pulsein but are unable to find a good example VI to use.
maxumim frequency is 500kHz
any tips would be appreciated
08-09-2012 03:05 PM
did you download the LabVIEW drivers for Arduino and you want to read a frequency on it?
08-09-2012 03:36 PM
LIFA does not have freqency counting capability. Look in the Document > Examples foler to see what capabilities are available.
08-09-2012 07:04 PM
The pulseIn() function is not currently implemented but you can add it in a new function manually. I think I've done this in the past so you could try and search this forum for other threads that ask about this.
08-10-2012 06:46 AM
Thank you
I am not sure how I add pulsein() manually as a new function.
Do I have to add anything to the arduino or is that all done in LABVIEW?
08-10-2012 05:47 PM
You have to do it in two places: LIFA Firmware (on Arduino) and in LabVIEW. I did it for the SRF05 sensor here. You can look at it to see how you would add it for yourself.
If you have trouble, let me know.
11-26-2012 12:55 PM
Hello,
I am trying to use a TSL235R with an Arduino board as well. Were you able to get the TSL235R working using Nathan's code? If you did is there anyway you could show me how (wiring and example code)?
Thanks.
11-27-2012 01:23 PM
Ok I tried your example. I added an additional case 0x34 to the Labviewinterface.
#endif
case 0x34: // TSL235R read
long irradiance;
long freq;
long pulses;
pinMode(command[2], OUTPUT);
digitalWrite(command[2], HIGH);
FreqCounter::f_comp=10; // Cal Value / Calibrate with professional Freq Counter
FreqCounter::start(100); // 100 ms Gate Time
while (FreqCounter::f_ready == 0)
pulses=FreqCounter::f_freq;
delay(20);
digitalWrite(command[2], LOW);
freq = (pulses*1000)/(100*0.0092);
retVal = (freq/1000); //irradiance
Serial.write( (retVal & 0xFF) );
break;
The code I added is a modified version of the code use to run the TSL235R on the following webpage, http://arduino.cc/forum/index.php/topic,21536.45.html (this code works fine outside of labview). I also included the FrqCounter library. I had to comment out the Tone function, because the FrqCounter Library and Tone share the same timer. I'm using pin 5 for the output from the TSL235R and 5V power.
Ok so my problem is I don't get any data (buffer empty) from my code and there are no errors. If you have a chance could you look at my code and vi to see if I have made any mistakes. I'm new to using arduino with labview so any help would the appreciated.
Otto