#!/usr/bin/python # Import the Dalsa1M60 packzge import Dalsa1M60, subprocess # define the serial command location serial_cmd_location = '/opt/EDTpdv/serial_cmd' # start a loop that continually gets the temperatures getTemperatures = 1 python_script_heartbeat = -1 while getTemperatures: # get the temperatures and the parameters temperatures = Dalsa1M60.VerifyTemperature(serial_cmd_location) parameters = Dalsa1M60.GetCameraParameters(serial_cmd_location) python_script_heartbeat *= -1 # get the lcoation for ezcawrite ezcawriteL = '/cvs/opt/apps/Linux/gds/bin/ezcawrite' # write numerical values to the channels # heart beat process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_PYTHON_SCRIPT %i' % python_script_heartbeat, \ shell=True, \ stdout = subprocess.PIPE) # temperatures process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_TEMP_DIGITIZER %f' % temperatures[0], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_TEMP_SENSOR %f' % temperatures[1], \ shell=True, \ stdout = subprocess.PIPE) # parameters process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_TAP1GAIN %f' % parameters['tap1Gain'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_TAP2GAIN %f' % parameters['tap2Gain'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_PRETRIGGER %f' % parameters['pretrigger'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_DATA_MODE %f' % parameters['dataMode'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_BINNING_MODE %f' % parameters['binningMode'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_GAIN_MODE %f' % parameters['gainMode'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_OUTPUT_CONFIG %f' % parameters['outputConfig'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_EXPOSURE_MODE %f' % parameters['exposureMode'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_SYNC_FREQ %f' % parameters['syncFrequency'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_EXPOSURE_TIME %f' % parameters['exposureTime'], \ shell=True, \ stdout = subprocess.PIPE) process = subprocess.Popen(ezcawriteL + \ ' C4:TCS-HWS_SERIAL_COMMS_STATUS %f' % parameters['serialCommunicationsStatus'], \ shell=True, \ stdout = subprocess.PIPE) #getTemperatures = 0 #print parameters #print temperatures