
- RS 232 SERIAL COMMUNICATION PROTOCOL SERIAL
- RS 232 SERIAL COMMUNICATION PROTOCOL MANUAL
- RS 232 SERIAL COMMUNICATION PROTOCOL CODE
- RS 232 SERIAL COMMUNICATION PROTOCOL PC
On GPIB this isn't a problem because there is a specific bus handshake to keep things straight. This in turn can send the command before the instrument is ready.
RS 232 SERIAL COMMUNICATION PROTOCOL PC
Command1 could take longer to complete on the instrument than the PC processor takes to send Command2. The difficulty lies in the WriteString command. This kind of sequence can sometimes present a problem, particularly for RS232. Consider a sequence of instrument instructions like this: instrument.WriteString "Command1?" Instrument.IO.TerminationCharacterEnabled = Trueįor RS-232 communications, the timing of instrument commands can become an important consideration. Check your instrument documentation to be certain. For RS-232 most instruments require a line feed character (ASCII 10) or a carriage return character (ASCII 13). A termination character is generally a non-printing character that signals the end of the data. Dim sfc As VisaComLib.ISerialįor some instruments a termination character is required for reading and writing data. Use this interface to set the RS232 parameters.
RS 232 SERIAL COMMUNICATION PROTOCOL SERIAL
Using RS232 requires you to use the Serial Interface, ISerial, built in the VISA COM libraries.

Notice how the interface family for RS232 is ASRL. Set instrument.IO = mgr.Open("ASRL1::INSTR") Set instrument = New VisaComLib.FormattedIO488

Dim mgr As KeysightRMLib.SRMClsĭim instrument As VisaComLib.FormattedIO488 Set mgr = New KeysightRMLib.SRMCls First, connect to the instrument similarly to connecting to an instrument using GPIB, LAN or USB interfaces.
RS 232 SERIAL COMMUNICATION PROTOCOL CODE
You can write Visual Basic code that can set RS232 parameters for you. None (no handshake mode), DTR/ DSR, Modem, RTS/ CTS, XON/ XOFF None / 8 data bits, Even / 7 data bits, Odd / 7 data bits Refer to the instrument's documentation to determine settings for the following parameters. Older instruments often have a fixed set of parameters. Newer instruments often allow you to set parameters, typically through the front panel. In general, the instrument will be the limiting factor for parameter setting. This is the cable shipped with many Keysight instruments that support RS232.īoth the PC and the instrument must be set to use the same configuration for serial communications. The diagram on the right is a simpler cable. This pin out will work with most Keysight and non-Keysight instruments. The pin out on the left for a printer cable. A typical instrument to PC cable pin diagram is shown on the right.
RS 232 SERIAL COMMUNICATION PROTOCOL MANUAL
If the manual is unavailable, try one of the two cables shown below. The Keysight 34398A Cable Kit contains cables and an adapter to help you connect serial interfaces.Ĭheck your instrument manual for the proper cable to use. Typical adapters include gender changers, null-modem adapters, and "D" style adapters with 9 pins or 25 pins. If you are using a DTE-to-DTE cable, make sure the adapter is a "straight-through" type. If you cannot find the correct cable for your configuration, you may use a wiring adapter. The Keysight 34398A serial cable with a 9-pin female connectors will work with these instruments. Most Keysight instruments use a 9-pin configuration. A male connector has pins inside the connector shell and a female connector has holes inside the connector shell. Connectors are typically a "D" style with 9 pins or 25 pins (DB-25 connector) with a "male" or "female" pin configuration. The interface cable must also have the proper connector on each end and the internal wiring must be correct. These cables are also called null-modem, modem-eliminator, or crossover cables. To connect these, you must use a DTE-to-DTE interface cable. Most computers are DTE (Data Terminal Equipment) devices.

To connect the instrument to a computer, you must have the proper interface cable. Finally, set and verify the RS-232 communication parameters. To use the RS-232 interface make sure it is enabled (selected) and determine the proper cables to connect the computer to the instrument. When it comes to interfaces RS-232 is pretty inexpensive to incorporate and over the years many instruments have been designed with an RS-232 interface.
