Skip to content
Snippets Groups Projects
Select Git revision
  • 0bd56ff2d179d770bead834ef97b3bcf50a19a0d
  • main default
  • v0.3
  • v0.2
  • v0.1
5 results

FDDGPUPlan.cpp

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    test-PCC.py 1.18 KiB
    #! /usr/bin/env python3
    
    import opcua
    from time import sleep
    
    port = 4840
    host = "10.87.2.8"
    
    client = opcua.Client("opc.tcp://{}:{}".format(host, port))
    client.connect()
    obj = client.get_objects_node()
    name_space_index = 2
    time_offset = obj.get_child("{}:time_offset".format(name_space_index))
    time_offset_R = time_offset.get_child("{}:time_offset_R".format(name_space_index))
    time_offset_RW = time_offset.get_child("{}:time_offset_RW".format(name_space_index))
    old_time_offset = time_offset_R.get_value()
    target_time_offset = 1
    new_time_offset = old_time_offset + target_time_offset
    time_offset_RW.set_value(new_time_offset)
    sleep(1.0)
    latest_time_offset = time_offset_R.get_value()
    difference_time_offset = latest_time_offset - old_time_offset
    if difference_time_offset != target_time_offset:
        print("ERROR:  Setting and reading back time_offset.  old_time_offset = %d, new_time_offset = %d, latest_time_offset = %d, target_time_offset = %d, difference_time_offset = %d." % (old_time_offset, new_time_offset, latest_time_offset, target_time_offset, difference_time_offset))
    else:
        print("SUCCESS:  Setting and reading back time_offset.")
    time_offset_RW.set_value(old_time_offset)
    client.disconnect()