Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Measuring the Output of a Serial Port for Low Level Analysis

Primary Software: LabVIEW Development Systems>>Professional Development System
Primary Software Version: 1.0
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>Full Development System
Hardware: Serial>>RS-232

Problem:
I'm using a serial device, and I'm unsure of the output of my serial port. Is there a way to view the signal that is being produced by the serial port in the lowest level possible.

Solution:
Normally we're not concerned about the voltage levels of the serial port, but to see the actual signal the device is receiving, you may choose the following method to observe the output of the serial port.

The only two pieces of hardware that you would need is your serial port, and a data acquisition device. Take pin 2 of your serial port, which is your transmit line, and wire it into any analog input of the data acquisition device.

To create a cleaner look to the input of the signal, you may wish to enable reference triggering for your data acquisition. In DAQmx, this can be found in the task timing palette when creating a task, or using DAQ Assistant.

To get the timing correct, it's important to know the baud rate of your signal, and you can specify the rate of your data acquisition to be 100 times that of the baud rate to have 100 samples per bit. In the Reference Trigger image included above, the Pre-Trigger Samples is set to 100 to leave 1 bit of empty space before the data acquisition begins.

Below are included some examples of different Hex Values represented in serial, and a working serial port will show the bits represented as such. Something to notice in the images below is that the very first bit is 'S' which is the start bit. The following 8 bits are the binary representation of the value being passed through with the least significant bit on the left. The last bit is the stop bit represented by 'S', and it will remain low for the amount of bits specified. In this example the duration of 1 bit was used for the stop bit.


The hex value written is 00 which represents the binary value 00000000. In serial, all the 0's are represented as a positive voltage and all the 1's are represented as a negative voltage.

The hex value written is 01 which represents the binary value 00000001. From the image above, we can see that the lowest significant bit is the first bit to pass through, and is the furthest left on the signal.

The hex value written is 55 which represents the binary value 01010101. This value can be used to visually distinguish each bit value that is passed through.

Related Links:
KnowledgeBase 0XL97ARV: Which Baud Rates Do the National Instruments Serial Boards Support?
Serial Support: Serial Quick Reference Guide


Attachments:


02Graph.jpg - 02Graph.jpgReference Trigger.jpg - Reference Trigger.jpg00Hex.jpg - 00Hex.jpg00Graph.jpg - 00Graph.jpg01Graph.jpg - 01Graph.jpg01Hex.jpg - 01Hex.jpg55Graph.jpg - 55Graph.jpg55Hex.jpg - 55Hex.jpg


Report Date: 04/26/2007
Last Updated: 05/04/2007
Document ID: 48PA767N

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit