Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Configure Procomm to capturing raw ascii values 0-255 to a file

Status
Not open for further replies.

fiddler2003

Technical User
Oct 15, 2003
2
US
I want to capture raw ascii data values - no interpretation of control characters - the full range from 0 to FF hex. What are the Procomm settings which will allow me to accomplish this?

I am capturing raw data bytes off of the transmitter PC's COM1 port. A Visual Basic application is sending the bytes - the pertinent snippets of code:

For k = 255 To 0 Step -1
DoEvents
MSComm1.Output = Chr$(48) ' Character 0
Next k

COM1 is set up as follows:

MSComm1.CommPort = 1
' 9600 baud, no parity, 8 data, and 1 stop bit.
MSComm1.Settings = "9600,N,8,1"
' Read entire buffer when Input is used.
MSComm1.InputLen = 0
' Open the port.
MSComm1.PortOpen = True

On the receiving PC, Procomm is set up with matching COM port settings. I chose VT100 terminal emulation with 24 x 132 settings. Transfer protocol is raw ascii. I have Terminal Update = Fast, Terminal Scroll = Normal, Enquiry = off. The Keep cursor in view, Line Wrap, Block Cursor, and Disable Printing options all the only options checked on.

For download options, even though I uncheck "display text", the incoming bytes are displayed on the screen.

Using a hex editor on the captured file, I see 132 bytes of hex 30, then hex 0D then hex 0A. It is apparent that the terminal emulation inserts the <CR> <LF> characters. If I change to an 80 column display, the <CR> <LF> characters are inserted after 80 bytes of hex 30.

If I change the transmission source code to be:

For k = 255 To 0 Step -1
DoEvents
MSComm1.Output = Chr$(k)
Next k

I get problems with ascii characters below 20 hex as these are special control characters.
 
Select the Options | Data Options | Setup Files menu item in Procomm, click on the Setup button in the bottom right corner, and make sure the Write raw text including escapes radiobutton is selected.

As for the CR and LF characters being added, this is likely due to line wrap being on for the terminal emulation you are using. You can turn this off by clicking on the Terminal Options button in the dialog from the previous paragraph, making sure the correct terminal emulation is selected, then uncheck the Line wrap checkbox on the righthand side of the dialog.


aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top