LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I read rx binary datas

Hi everybody,

I've an IR/RS232 converter (EL-link-IR) and I'd like to read directly the value in Rx (binary). It could be simple if I was using the IrDA protocol, but in fact I'd like to analyze an IR signal emitted by any remote control (with various length, various IR codes.
I tried to use the RS232 Visa read but it returns an Ascii word (always the same). I've seen with a scope that I've a representative trace of the signal on Rx pin (see attached picture) but now I want to get this "basic" data in a LabVIEW program.

Can anybody tell me how to do this?

Thank you in advance.

Bim
0 Kudos
Message 1 of 5
(3,067 Views)
Bim,

Checking for understanding: it sounds as if you want to capture (digitize) the analog signal present at the Rx pin of your serial port and bring it into LabVIEW for analysis. Is that correct? The VISA communication VIs will not be able to give you access to the actual analog waveform, as you've seen.

The image that you attached suggests that you have a Tektronix scope available that is, in fact, already capturing this information and sending it to your computer as a screen capture. Couldn't you just use an instrument driver for that scope (http://www.ni.com/idnet) and transfer the analog waveform into LabVIEW?

Perhaps missing a subtlety here,
John
0 Kudos
Message 2 of 5
(3,052 Views)
John,

Effectively, I want to capture (digitize) the analog signal present at the Rx pin of my serial port and bring it into LabVIEW for analysis, but the goal of the equipment is to be low cost, so using a Tektronix scope and associate drivers is far away from this...but in fact that could be the best way to get the real analog signal for further analysis. The converse problem is to be able to reproduce that signal on the Tx pin, so as to send the initial IR signal to the device to control, and I don't know if we could do this even using a scope.

Is there no way to inhibit the format of the received data and to simply sample the Rx pin signal? I heard about applications and special dll that allow to have access to the Rx information (commspy, lookRS232, etc.). I haven't tried yet but they seems to go deeper in the port signals.
I thought LabVIEW offers that kind of functionnability but that may be more difficult than I believed!
Perhaps we could use these programs facilities to transmit the Rx data to LabVIEW?

As you can see, I've a lot of ideas but not enougth time and experience yet to find the solution, so be sure your help is precious...

I'm looking forward to your next answer.
Thank you in advance for your help.

Bim
0 Kudos
Message 3 of 5
(3,042 Views)
What you are asking, I think, is can you control the A/D process within the serial port? You want to be able to more or less sample the analog waveform suitably fast and then determine the data and timing yourself.

I'm not sure how the other software you mention works, but given Labview's I/O abstraction layer, you are a bit removed from the serial port and it's hardware specific quirks. However there are additional serial port functionality hidden in the property node items. For example if you go to the serial communication palette and drop "bytes at serial port" on a diagram and then right click on the header, there is a bunch of more advanced features available there. This is how to gain access to things like DTR lines etc.

I'm wondering if you could do a bit banging sort of kludge where your input would actually come in on say DTR and you query that very fast in software. It would be like a 1 bit a/d which you are sampling in software. This sounds really nasty now that I've typed it out, but may do the job.

Also, don't forget your soundcard, it's a great high speed two channel AC coupled ADC.

Sheldon
Technical geek, engineer, research scientist, biodegradable...
0 Kudos
Message 4 of 5
(3,038 Views)
You said you used an IR/RS232 converter? Your picture of the scope signal does not look like standard RS232 signals. There should be a start bit followed by 7 or 8 data bits, then a stop bit. The scope signal does not look like that. Also, true RS232 signals should range from -12 to +12 volts. The scope shows a TTl signal, 0 to 5 volts. If the signal is not a standard RS232 signal, you should not use the serial port. Instead you can buy a very low cost USB DIO for about $100. Or you can use the parallel port. You also need some sort of clock signal to determine when to read the incoming signal level. There are examples in Labview on how to use the parallel port and how to use the DIO. Basically you want to initialize the DIO to define the port as input. Then you have to create a loop to read the port. The tricky part is the timing so that you can read at the proper time between signal hi-lo transitions. If you know the signal's timing frequency, you can use a timed loop to read each bit at the right time.
- tbob

Inventor of the WORM Global
0 Kudos
Message 5 of 5
(3,019 Views)