Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

RS232 Control VB Script?

Status
Not open for further replies.

RTN

Civil/Environmental
Dec 3, 2002
1
Dear Experts:

I'm tring to control a Sound Level Meter (B&K 2238) by sending command signals from a PC (MSWindows98/2000) to the meter through a RS232 port using a 9-pin cable.

Would any of you please offer me some sample Visual Basic scripts for sending control signals to device connecting to RS232 port.

Thanks a lot!
 
Replies continue below

Recommended for you

The best way to do it is to use the MSComm control that comes with Visual Basic. If you want to see how this works, load and single step through the VBTerm sample that comes with it (should be in the \samples subdirectory; if not, I think you can download it from Microsoft's Visual Basic site).

One important note, though, is that you must know the syntax of the commands to your meter (or other device), as sent via RS-232. Once you know those you can simply modify the VBTerm code to suit your own purposes. It's complex at first, but stick with it!

[pc3]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor