LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IR Transmitter protocol with LabVIEW

Solved!
Go to solution

Hi I built a system in Arduino that reads the temperature of a meeting room, and when the temperature goes up (Hot), an IR Transmitter sends a signal to turn on the AC at 17 Celcius , and if it gets cold turns off the AC. So I'm trying to run this project in Labview using LINX, I'm able to read the temperature and I can turn on/off anything with a condition, but I have no idea how can I send the IR signals in LabVIEW.

To caught up the IR signal that turns on the AC, I had to read the signal with an IR reciever, with the help of some codes out there I found that the signal was read as:


Encoding : NEC
Code : 38588B1 (32 bits).........

 

I used an oscilloscope to read the signal, and I got a bunch of bits "94 bits'
000000000000000000111111111010101010101011101110111010101010111010111011101010101110101010111010111011101010101110

 

But I didn't really needed this, so my question is how can I send this signal in LabVIEW?

 

 

HELP !!! PLEASE, I can share everything I have.

0 Kudos
Message 1 of 10
(8,303 Views)

How do you plan on connecting your IR transmitter to your PC?  I would guess you'd use a digital output on a DAQ card with some other hardware to power the transmitter.

 

Do you know what the timing intervals are for the 1's and 0's?  You could use a DAQ card that has hardware timing for the digital outputs and write a digital waveform out of that pin.

0 Kudos
Message 2 of 10
(8,294 Views)

Hi Ravensfan,

Well I was planning to keep my Arduino connected to LabVIEW, I used the circuit diagram of the next page:

 

https://learn.adafruit.com/using-an-infrared-library/sending-ir-codes

 

I took a looked to DAQ cards but they are a little bit expensive for me. On my Arduino board I am able to select the digital output, I think it can work that way. I don't remember what were the timing intervals of my signal I will take a look tomorrow.

 

how can I send those bytes in a signal? I saw a lot of different types of Digital Waveform in LabVIEW, I'm not familiar with those functions

0 Kudos
Message 3 of 10
(8,256 Views)
This may be of no help, given that you're trying to run on an Arduino, but last year there was a poster on the forums who was using a (USB-based, IIRC) interface from a company called RedRat

http://www.redrat.co.uk/products/

Perhaps something they have could guide you in the IR protocol area.

Dave
David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 4 of 10
(8,249 Views)

I didn't see you mention the Arduino.  But now I see you said Lynx which is a code word for Arduino.

 

You basically need to do the work on the Arduino for timing and controlling the digital output.  That with a bit of code to receive commands from the serial port.  And your LabVIEW code will send the serial command.  It may be just a matter of sending a string of "1"'s and "0"'s.  That or you could back it as bits into bytes and send it as about 12 bytes to send the 94 binary digits.

Message 5 of 10
(8,231 Views)

well, I'm a complete noob here, I've been trying the whole morning, but I'm going nowhere, is there anyway you can help me out with some code, my IR signal has intervals of 500 uS, I'm able to send a waveform trough the IR with the "Digital Write Square Wave" Function,, but I can't send the right signal, so I'm really lost with this.


Any suggestion are greatly appreciated.

0 Kudos
Message 6 of 10
(8,183 Views)

Yeah well, the 500uS interval kinda means you're toast if you want LabView to be the one calling the shots. See, LabView is running in your OS (Windows, OSX, Linux, etc.) that is designed to be used by a human and thus is not deterministic, i.e. timing won't be too accurate, particularly at the uS interval.

 

You could, however, use a microcontroller with a simple code, that sends the train of pulses depending on input.

Message 7 of 10
(8,172 Views)
Solution
Accepted by andres18m

As the previous poster said, you don't have deterministic programmatic control from LabVIEW (in pretty much any supported platform) - it's expected that there is some hardware-timed lower-level support between your application level code and the actual hardware, if you're trying to generate deterministic edge transitions, or capture pin input at a reasonable sample rate.

 

Under the other environments, that support may be DAQmx (or DAQmx Base) and some NI hardware.  Or perhaps some third-party hardware (like the previously mentioned RedRat), with calls to a third-party-supplied DLL to manage it.

 

My general impression of LabVIEW executing on an Arduino (which so far is looking over a co-worker's shoulder while he explored), is that native LabVIEW support for the I/O is VERY limited - I think they had static port I/O and maybe I2C and/or SPI support.  Someone on here who is more conversant with Arduino can tell you if you can get LabVIEW to call a support library (like IRLib, the library used by the article you linked to).  I'd be surprised if the Call Library Function node is supported (yet) on the Arduino target.

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 8 of 10
(8,161 Views)
Well I guess I'll go with that option, I wanted to do all the Job in labVIEW. I will probably use two arduinos so the first one actives the second Arduino and the second it sends the pulse.

Thanks buddy
0 Kudos
Message 9 of 10
(8,158 Views)

You can see the samples for Ardunino linux folder and modify it.

 

C:\Program Files\National Instruments\LabVIEW 2019\examples\MakerHub\LINX.

 

Regards,

 

 

0 Kudos
Message 10 of 10
(5,246 Views)