io = start_iohub(expInfo[u"Session Code"], expName)
    tablet = io.devices.tablet

    # Check that the tablet device was created without any errors
    if tablet.getInterfaceStatus() != "HW_OK":
        print ("Error creating Wintab device:", tablet.getInterfaceStatus())
        print ("TABLET INIT ERROR:", tablet.getLastInterfaceErrorString())
        io.quit()
        core.quit()
        sys.exit(1)

    from psychopy.iohub.client.wintabtablet import PenPositionStim, PenTracesStim

    pen_pos_stim = PenPositionStim(win)
    pen_traces_stim = PenTracesStim(win)

    # Create the iohub datstore condition variables table.
    # The following 2 lines of code is a hack, as it does not appear
    # that you can get the order of the column names as found in the
    # condition file using any of the Builder generated python code.
    temp_exp_conds, temp_ecnames = data.importConditions("conditions\\trial_conditions.xlsx", returnFieldNames=True)
    temptrials = data.TrialHandler(temp_exp_conds, 1)
    io.createTrialHandlerRecordTable(temptrials, temp_ecnames)
    temp_exp_conds = None
    temptrials = None

except Exception, e:
    import sys

    print "!! Error starting ioHub: ", e, " Exiting..."