ID Supported DCA-Ms

This example script demonstrates how to identify each valid DCA-M module detected by FlexOTO and indicates if the module is installed on the Hardware Diagram.

Example Script

Copy
id-modules.py
import pyvisa as visa
rm = visa.ResourceManager(r'C:\WINDOWS\system32\visa64.dll')
FlexOTO = rm.open_resource('TCPIP0::localhost::hislip0,4880::INSTR')
FlexOTO.timeout = 5000  # Set connection timeout to 5s
FlexOTO.read_termination = '\n'
FlexOTO.write_termination = '\n'
modules = FlexOTO.query(':CONFigure:MODule:ALL?')
modules = modules.split(',')
print(str(len(modules)) + ' Modules Detected by FlexOTO:')
for module in modules:
    if int(FlexOTO.query(':CONFigure:MODule:ACTive? ' + module)):
        print('\t' + module + ' is installed on Hardware Diagram.')
    else:
        print('\t' + module + ' detected but not placed on Hardware Diagram.')
FlexOTO.write(':SYSTem:GTLocal')
FlexOTO.close()

The output from this script would look similar to this:

6 Modules Detected by FlexOTO:
	N1078A-US78000001 is installed on Hardware Diagram.
	N1078A-US78000002 detected but not placed on Hardware Diagram.
	N1092B-US92000003 detected but not placed on Hardware Diagram.
	N1092B-US92000004 detected but not placed on Hardware Diagram.
	N1092D-US92000001 is installed on Hardware Diagram.
	N1092D-US92000002 detected but not placed on Hardware Diagram.