VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ni-veristand python api client-api vs legacy

I saw the reminder that some of the functions in legacy API are deprecated without listing them out. Are the functions currently in the document all working? 

 

I am not sure if this works...

 

My attempt:

 

import time
from niveristand.legacy import NIVeriStand

def set_channel(wks, channel_name, v1):
    wks.SetSingleChannelValue(channel_name, v1)


def set_multiple_channels(wks, channel_name_list, v_list):
    wks.SetMultipleChannelValues(channel_name_list, v_list)
    # for (channel_name, v1) in zip(channel_name_list, v_list):
    #     set_channel(wks, channel_name, v1)


def get_channel(wks, channel_name):
    y = wks.GetSingleChannelValue(channel_name)
    return y


def get_multiple_channels(wks, channel_name_list):
    y_list = wks.GetMultipleChannelValue(channel_name_list)
    return y_list


def initiate_veristand(niveristand_path, model_path):
    NIVeriStand.LaunchNIVeriStand()
    time.sleep(5)

    wks = NIVeriStand.Workspace2("localhost")
    wks.ConnectToSystem(model_path, True, 120000)
    time.sleep(5)


def stop_veristand(wks):
    wks.DisconnectFromSystem('', True)

 

 

0 Kudos
Message 1 of 1
(94 Views)