LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency Display

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

0 Kudos
Message 1 of 8
(5,373 Views)

did you download the LabVIEW drivers for Arduino and you want to read a frequency on it?

0 Kudos
Message 2 of 8
(3,428 Views)

LIFA does not have freqency counting capability.  Look in the Document > Examples foler to see what capabilities are available.

0 Kudos
Message 3 of 8
(3,428 Views)

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.

0 Kudos
Message 4 of 8
(3,428 Views)

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?

0 Kudos
Message 5 of 8
(3,428 Views)

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.

0 Kudos
Message 6 of 8
(3,428 Views)

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.

0 Kudos
Message 7 of 8
(3,428 Views)

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.

OttoScreen.png

0 Kudos
Message 8 of 8
(3,428 Views)