EasyManuals Logo

Keysight Technologies M8000 Series User Manual

Keysight Technologies M8000 Series
668 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #577 background imageLoading...
Page #577 background image
Keysight M8000 Series of BER Test Solutions User Guide 577
Utilities 9
buf = System.Array[System.Byte] ([0x5A, 0x02, 0x00,
0xaf])
# send 4 bytes beginning at offset 0
serialPort.Write(buf, 0, 4)
# reading 100 bytes
numBytes = 100
buf = System.Array.CreateInstance(System.Byte, numBytes)
serialPort.Read(buf, 0, numBytes)
Closing the COM Port
The following code snippet shows the required code to close the COM port
and discard the SerialPort instance. This code should be called in the
OnUninstall function of the DUT Control Interface in order to ensure that
the COM port becomes unavailable after the currently active script
becomes removed from the computer's memory.
if (serialPort != None):
# check if COM port is open
if (serialPort.IsOpen):
serialPort.Close()
# dispose the serialPort instance
serialPort.Dispose()
# ensure that the disposed object is not used in future
serialPort = None
Common Pitfalls when Working with COM Ports
A COM port cannot be opened more than once. Therefore it is very
important to close the port before the script is unloaded.
This does have several implications:
• If the COM port is not available when the script is being loaded (e.g.
when recalling a setting), then the script will fail opening the COM port
and the DUT will not be accessible.

Table of Contents

Other manuals for Keysight Technologies M8000 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Keysight Technologies M8000 Series and is the answer not in the manual?

Keysight Technologies M8000 Series Specifications

General IconGeneral
BrandKeysight Technologies
ModelM8000 Series
CategoryTest Equipment
LanguageEnglish

Related product manuals