Serial communications 7 bit ascii

I'm using the mscomm control to communicate with a newport meter with and RS232 card.  I can send and recieve strings to and from the meter.  My problem is decoding the signal that I recieve from the meter.  Using Hyperterminal if I set the properties to force 7 bit ascii for the incoming string, I get the correct format back.  How can I force 7 bit ascii in VB or what can I do to the incoming string to decode it into 7 bit ascii?
JoeEinsteinAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

deightonprogCommented:
Is it possible to give a short example of the values in the incomming string?
0
samopalCommented:
   MSComm1.CommPort = 1 ' open Com1:
    MSComm1.Settings = "19200,o,7,1"

where
19200 -baud
o - parity (odd for this example)
7 - databit
1 - flow control
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Erick37Commented:
>> 1 - flow control

1 - Stop Bits
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

JoeEinsteinAuthor Commented:
I have it set up for
9600 baud
no parity
8 databit(I tried 7 it didn't work at all)
1 stop bit

With 8 databits I can send the signal and the meter responds properly.  I have an echo activated which should return my command.  It returns it but I don't know how to get it to meen anything.  

"When transmitted, each character is preceded by a start bit and followed by one or two stop bits plus an optional parity bit, making a train of 10 or 11 baud for each transmitted chatacter."
-from Newport manual

The option I selected in hyperterminal that worked was- Force 8 incoming data to 7 bit ascii.  The help for the choice said "Translates 8 bit characters to 7 bit ascii.

I think that's what I need to know, how to translate 8 bit data to 7 bit ascii.

I can't give any examples right now though, cause the system is in use and I can't play with it right now.
0
Erick37Commented:
I downloaded the Communications Manual at:

http://www.newportelect.com/manuals/Process.htm

It says the factory default is
"9600,o,7,1"

Try this setting, unless you have reconfigured the meter.
0
JoeEinsteinAuthor Commented:
I changed the parity in the meter to none.  I tried 9600,n,7,1.  When I tried that the meter didn't respond to any of the commands and I didn't get any feedback at all.  Do you thing that changeing the parity back to odd and using 7 again would make it work?  I didn't think that the parity would make a difference as long as it matched, but I don't know much other wise I'd probably have it working.
Also if it helps the exact meter I have is INFS-2001-DC9.  I've been working on this all week I really appreciate the help.
0
Erick37Commented:
Try resetting the meter back to factory defaults, so you know for sure the setting.

Then write a little debbuger VB program which communicates with the meter at various settings.  Use ComboBoxes to change the settings until you hit the one that the meter is using.

You may also check the handshaking property.  Make sure it corresponds with the mode the meter is expecting: hardware, none, or Xon/Xoff

Option Explicit

Private Sub Command1_Click()
On Error Resume Next
MSComm1.Settings = Combo1.Text & "," & Combo2.Text & _
        "," & Combo3.Text & "," & Combo4.Text
Caption = "Settings: " & MSComm1.Settings
End Sub

Private Sub Form_Load()
With Combo1
..AddItem "9600"
..ListIndex = 0
End With

With Combo2
..AddItem "N"
..AddItem "O"
..AddItem "E"
..ListIndex = 1
End With

With Combo3
..AddItem "8"
..AddItem "7"
..ListIndex = 1
End With

With Combo4
..AddItem "1"
..AddItem "2"
..ListIndex = 0
End With
End Sub
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.