''' Created on 2021/10 Author: Patrick Haefeli Version Number: 1 Description: Script to set up the external Trigger of the NRP18SN to sender mode. As soon the power level at the NRPXXS(N) exceeds the set trigger level a trigger is executed at the SMB output port. Requires: R&S NRP18SN, FW 2.30 or newer - Installed RsInstrument Python module (see the attached RsInstrument_PythonModule folder Readme.txt) - Installed VISA e.g. R&S Visa 5.12.x or newer General Information: This example does not claim to be complete. All information has been compiled with care. However errors can not be ruled out. ''' from RsInstrument import * def main(): resource_NRP18SN = 'tcpip::10.205.0.89::INSTR' # Assign Intrument VISA resource string NRP18SN = RsInstrument(resource_NRP18SN, True, False, options="TerminationCharacter = '\n',LoggingMode=On, WriteDelay = "\ "10, ReadDelay = 10 ") NRP18SN.instrument_status_checking = False # Error check after each command MUST BE OFF for this instrument NRP18SN.visa_timeout = 3000 # Timeout for VISA Read Operations NRP18SN.opc_timeout = 3000 # Timeout for opc-synchronised operations NRP18SN.clear_status() # Clear status register idn = NRP18SN.query_str('*IDN?') print(idn) # Identification String # ============================================ # Reset # ============================================ NRP18SN.write('*RST;*CLS') response = NRP18SN.query_str('*OPC?') level = '-10 DBM' # level for trigger condition NRP18SN.write('TRIGger:LEVel ' + level) # Use the input signal as trigger source NRP18SN.write('TRIGger:SLOPe POSitive') # Trigger for positive slope NRP18SN.write('TRIGger:SEND:STATe ON') # Enable trigger sender mode NRP18SN.write('TRIGger:SEND:PORT EXT2') # select the SMB port as ext sender port NRP18SN.write('TRIGger:SOURce INT') # Use the input signal as trigger source NRP18SN.write('INITiate:CONTinuous ON') # Switch to continuous mode # ============================================ # Check for errors # ============================================ response = NRP18SN.query_str('SYST:ERR?') print(response) # ================= # Close the session # ================= NRP18SN.close() if __name__=="__main__": main()