Ejemplo n.º 1
0
""" after testing, use below code to replace above.  
    try:
        rail = [r for r in generator_api.GetRails() if r.Name==testrail][0]
    except:
        print('Test failed because the test rail could not be found. Please check the rail name.')
        exit()
"""
    for idx,value in vectordict.items():
        vector_api.CreateSimpleVector(int(idx),rail.VRAddress,value['cmd'],value['data'],value['delay'])

    vector_api.LoadAllVectors(0, rail.SVIDBus)  # Number of repeats, svid bus
    data_api.SetTrigger(12, 100, 0, 0, 0, False)  # set to svid burst trigger
    time.sleep(1)
    vector_api.ExecuteVectors(SVIDBURSTTRIGGER.INTERNAL)  
    vector_api.ReadVectorResponses()  
    return data_api.GetVectorDataOnce()  
 
def output_screen(vresult,vectordict):
    print("------------------------------------------------------------------------------")
    print("                              Hawkmock Vector                                 ")
    print("------------------------------------------------------------------------------")
    print("")
    print('COMMAND   \tACK\tDATA\tPRTYERR\tPRTYVAL')
    print('------------------------------------------------')
    for i in range(0, len(vectordict.keys())):
        print(vectordict[str(i+1)]['descr'],
              '\t', str(vresult.AckResp[i]),
              '\t', str(vresult.DataResp[i]),
              '\t', str(vresult.ParityErrResp[i]),
              '\t', str(vresult.ParityValResp[i]))
Ejemplo n.º 2
0
                          2)  # Get status reg
vector.CreateSimpleVector(7, vraddress, SVIDCMD.PS, initial_ps,
                          2)  # Get status reg
vector.CreateSimpleVector(8, vraddress, SVIDCMD.PS, next_ps,
                          2)  # Get status reg
vector.CreateSimpleVector(9, vraddress, SVIDCMD.GETREG, 0x32,
                          2)  # Get status reg

vector.VectorTriggerSettingsMode4(DACTRIGCHN.DAC1, False)
vector.VectorTriggerSettingsInternal(
    0, False)  # Repeat delay, continously repeating
vector.LoadAllVectors(0, svid_bus)  # Number of repeats, svid bus
data.SetTrigger(12, 100, 0, 0, 0, False)  # set to svid burst trigger

time.sleep(1)

vector.ExecuteVectors(SVIDBURSTTRIGGER.INTERNAL)
vector.ReadVectorResponses()
vector.ResetVectors()

vResult = data.GetVectorDataOnce()
print('ACK\tDATA\tPRTYERR\tPRTYVAL')
print('-----------------------------')
for i in range(0, 9):
    print(str(vResult.AckResp[i]), '\t', str(vResult.DataResp[i]), '\t',
          str(vResult.ParityErrResp[i]), '\t', str(vResult.ParityValResp[i]))

print('initial PS = {}'.format(vResult.DataResp[1]))
print('final PS = {}'.format(vResult.DataResp[8]))
gen.Generator1DVSC_I(test_rail, 1, False)