Beispiel #1
0
def check_safe_states(iDevIdx, iSlotID, connection):
    intensity, frequency_number, pulse_mode, head_id = sepiaUser.get_laser_parameters(
        iDevIdx)
    ls_channel = rs.GetActiveChannel(
    )  # Check the active channel on the laserSwitch

    if (intensity != 0):
        print 'Simple TCP/IP Run (Check Safe States) - The laser Intensity is not at SAFE value (0%)'
        sepiaUser.set_laser_intensity(0, iDevIdx)
        connection.send(sepia_wrong_set_intensity_flag)
        main(
        )  # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent
    if (frequency_number != 6):
        print 'Simple TCP/IP Run (Check Safe States) - The laser Frequency is not at SAFE value (6 - external rising edge)'
        sepiaUser.set_laser_frequency(6, iDevIdx)
        connection.send(sepia_wrong_freq_flag)
        main(
        )  # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent
    if (pulse_mode != 1):
        print 'Simple TCP/IP Run (Check Safe States) - The laser Pulse Mode is not set correctly (1 - pulse mode, NOT continuous)'
        connection.send(sepia_wrong_pulse_mode_flag)
        main(
        )  # Cancel the run, and only continue if a new TCP/IP (ORCA) command is sent
    if (ls_channel != 0):
        print "Simple TCP/IP Run (Check Safe States) - The Laser Switch channel is not set to SAFE value (0)"
        rs.SetSelectedChannel(0)
        rs.Execute()
        connection.send(relay_switch_wrong_default_flag)
        main()
    else:
        print "Simple TCP/IP Run (Check Safe States) - All Safe States are Correctly Set"
        connection.send(continue_flag)

    return
Beispiel #2
0
def set_laser_switch_channel(channel):
    iDevIdx,iModuleType,iSlotID = sepiaUser.initialise() 
    rs.SetSelectedChannel(channel)
    sepiaUser.close(iDevIdx)
    rs.Execute()                                    
    iDevIdx,iModuleType,iSlotID = sepiaUser.initialise() 
    sepiaUser.laser_soft_lock_on(iDevIdx, iSlotID)	
Beispiel #3
0
def set_to_safe_state(iDevIdx, iSlotID):
    sepiaUser.laser_soft_lock_on(iDevIdx, iSlotID)	# turn the laser soft-lock on 
    sepiaUser.set_laser_intensity(0, iDevIdx)       # set the laser intensity to 0%
    sepiaUser.set_laser_frequency(6, iDevIdx) 		# set the laser to trigger on the rising edge of an external pulse
    rs.SetSelectedChannel(0)			            # set the laserSwitch to channel 0 (default channel)
    sepiaUser.close(iDevIdx)
    rs.Execute()                                    # execute the laserSwitch channel change
Beispiel #4
0
def set_safe_states(iDevIdx, iSlotID):
    sepiaUser.laser_soft_lock_on(iDevIdx,
                                 iSlotID)  # turn the laser soft-lock on
    sepiaUser.set_laser_intensity(0, iDevIdx)  # set the laser intensity to 0%
    sepiaUser.set_laser_frequency(
        6, iDevIdx)  # set the laser frequency to external rising-edge trigger
    rs.SetSelectedChannel(0)  # set the laserSwitch to channel 0 (default)
    sepiaUser.close(iDevIdx)
    rs.Execute()  # execute the laserSwitch channel change from above
Beispiel #5
0
def ORCA_set_ls_channel(connection, iDevIdx):
    ls_channel_set = timeout(
        connection,
        10)  # get the laserSwitch channel, with a 10 second timeout
    connection.send(continue_flag)
    print "Simple TCP/IP Run (ORCA Set laserSwitch Channel) - Laser Switch channel is set to:" + ls_channel_set
    rs.SetSelectedChannel(int(ls_channel_set))
    sepiaUser.close(iDevIdx)
    rs.Execute()
    connection.send(continue_flag)