LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

example using 6542 to read rs232

Hi I am just getting starting with the 6542 digital I/O card and am looking so a sample program that I could try out.  I would like to simply write data to the computer serial port and then read it back in through the 6542 card?  Any ideas, thanks.

0 Kudos
Message 1 of 11
(4,117 Views)

The 6542 is a digitizer/analyzer and is not suitable to communicate over RS232.  Or do you want to analyze the RS232 signals.  If so, then just set up the 6542 to acquire signals and you will get back a waveform.  Look for examples for Acquiring signals using a digitizer.

- tbob

Inventor of the WORM Global
Message 2 of 11
(4,111 Views)

thanks for the response, yes just want to aquire data.  Also I am wondering if it is possible to read serial data in with an external clock and in addition to displaying the data, save the data to a file on the pc?

0 Kudos
Message 3 of 11
(4,082 Views)

You will not be able to read the data as ASCII characters like you normally do with RS232 protocol.  You will capture the waveform as it comes in.  I'm not sure what you mean about reading the data with a serial clock.  If you are trying to capture the data (not the waveform but the serial bits and then form the bits into ASCII characters), this is a very hard way to do it.  This is what serial ports are for.  The digitizer will be able to see the noise, the pulse widths, the amplitude, etc., but not the data itself.

- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 11
(4,076 Views)

svt4cobra6,

 

I would like to clarify a couple of the questions that you had about our HSDIO devices with the 6542. The main concern for reading the digital signal (RS232) with the 6542 is two things. 1) Logic Levels and 2) sample rate.

 

For Logic Levels and what logic levels are compatible with the 6542 you can look at the Specifications for the 6542 linked below.

 

PXI/PCI 6541/6542 Specifications (Acquisition Voltage Families):

http://www.ni.com/pdf/manuals/373771b.pdf#page=4

 

For the sample rate that you will be going, that will depend on the baud rate that you are using with the serial communication. You can also find the list of frequencies that our boards can acquire at in the specifications link from below.

 

PXI/PCI 6541/6542 Specifications (On board clock frequency range):

http://www.ni.com/pdf/manuals/373771b.pdf#page=5

 

Now for reading the actual serial data, this will be more difficult to decode the data that you are sending to the HSDIO card, but you will be able to see the bits of data that you have coming in. You will need to understand the format the data is in to be able to properly decode the data. We do not have any HSDIO program that does this for you automatically. Tbob was correct that this is "easier" to read it with a serial port because a serial port is designed to change the format of the data into text strings you can read, but you will be able to do with with the HSDIO card.

 

Now, I think Tbob got confused by the "digitizer" reference. The HSDIO card 6542 is designed to acquire and generate digital signals. We do have NI High Speed digitizers, also known as our Scope devices that are designed to acquire analog signals, but the 6542 is not one of these devices, and the 6542 are designed to acquire digital signals and generate digital signals. You will not be able to detect pulse width like what you could with a scope card, or amplitudes or noise. With the 6542 it simply looks for a threshold voltage and if the voltage level is higher than that threshold it is a logic high.

 

I hope this clarifies the issue a little bit, and let me know if you have any follow up questions. Thanks!

 

 

Aaron W.
National Instruments
CLA, CTA and CPI
Message 5 of 11
(4,050 Views)

To get an idea of the difference between the raw signal (which is what you'd be seeing on a scope or digitizer), and what the UART on a motherboard provides, take a look at the RS-232 Wikipedia page. There is a picture there that shows you what a "K" looks like.

Message 6 of 11
(4,043 Views)

@Aaron W. wrote:

Now, I think Tbob got confused by the "digitizer" reference.  


What threw me off was the description on  NI search results for 6542.  It described the 6542 as a digital waveform generator/analyzer.  When I saw the word analyzer, I mistook it for a scope.  I'm used to using the word HSDIO.  I wish the description would say High Speed Digital IO instead of generator/analyzer.  However, the word generator should have given me a clue.  In any case, this is not the instrument to use to read the serial port.  It also will not read amplitude nor noise level as I had previously stated.  Thanx for the clarification Aaron.

- tbob

Inventor of the WORM Global
0 Kudos
Message 7 of 11
(4,039 Views)

Thanks for all the ifnormation.  I will be trying to read serial data from a digital signal processor from the mid 1990s and converting the bits into ascii characters.  I will not be recieving the DSP for a few months so was thinking of trying to just use the serial output of a computer to become more familiar with the card.  The DSP does not have a built in serial interface standard like the new ones do but I do have the timing diagrams.  The DSP does provide a serial clock, chip enable and data line.  Can you read in the bits with this card and perform the conversion within labview, any suggestions for a test set up?  I do have access to a signal generator.  Also the data rate of the DSP is much higher than the UART.

 

0 Kudos
Message 8 of 11
(3,991 Views)

@svt4cobra6 wrote:

Thanks for all the ifnormation.  I will be trying to read serial data from a digital signal processor from the mid 1990s and converting the bits into ascii characters.  I will not be recieving the DSP for a few months so was thinking of trying to just use the serial output of a computer to become more familiar with the card.  The DSP does not have a built in serial interface standard like the new ones do but I do have the timing diagrams.  The DSP does provide a serial clock, chip enable and data line.  Can you read in the bits with this card and perform the conversion within labview, any suggestions for a test set up?  I do have access to a signal generator.  Also the data rate of the DSP is much higher than the UART.

 


I am guessing that the DSP is outputting data at the TTL level.  It may be a serial bit stream but it is not RS232.  That threw us all off. 

 

Use FInd Examples and search for HSDIO - Dynamic Acquistion with Reference Clock.  Wire the DSP clock to your 6542 external clock input.  Then you can acquire the data and process it as you wish.

 

- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 11
(3,978 Views)

Yes it is a TTL output, I will search for HSDIO as suggested, thanks.

0 Kudos
Message 10 of 11
(3,958 Views)