:INSTrument Subsystem
Use the :INSTrument subsystem to install an instrument for which you have written an instrument driver. This allows FlexOTO to connect to the instrument and represent the instrument as an Instrument block on the Hardware Diagram. Up to eight instrument drivers can be installed. A generic instrument driver tells FlexOTO the instrument's model and serial number, the measurement input ports available, and the measurement(s) to perform. This subsystem's commands perform tasks that are associated with the Instrument Connection Setup dialog.
To connect your generic instrument driver, use the following commands:
:INSTrument:CARGumentto enter the COM port or VISA address as a command-line argument. FlexOTO passes this argument to your driver.:INSTrument:CONNected?to determined if the specified instrument driver is connected (running) which indicates that the Instrument block is available on the User Instruments palette.:INSTrument:DISConnectTo remove a currently installed instrument from the Hardware Diagram and from the User Instruments palette:INSTrument:RDRiverto connect (run) your instrument driver.:INSTrument:UDPathto enter the file name, including path, of your instrument driver.
Example
This example shows the command that are required to connect your instrument driver, place the resulting Instrument block on the Hardware Diagram, and then connects the Instrument's measurement input port "A" to the switch's output port "IN 1".
hwdiagram.write(':INSTrument3:UDPath "C:\\Python\\FlexOTO\power_meter.py"')
hwdiagram.write(':INSTrument3:CARGument "TCPIP0::WINDOWS-1234567::hislip10::INSTR"')
hwdiagram.write(':INSTrument3:RDRiver "C:\myDrivers\mySwitchDriver.py"')
hwdiagram.write(':CONFigure:INSTrument:ACTive "Power Meter (US123456PM)"' # place on hardware diagram
hwdiagram.write(':CONFigure:PORT:CONNect "Power Meter (US123456PM)","A","Switch (SL1:X1)","IN 1"' # connect port A to switch port