NI VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Running rt sequence deterministically with python API

Hi,

I have following python code, which I am trying to execute on Veristand target. I can run the code non deterministically and save the code as real time sequence file. The generated rt sequence can then be run as part of stimulus profile succesfully.

 

Code:

@nivs_rt_sequence
def startVeristand():
systemRun(BooleanValue(True))
wait(5)

 

@nivs_rt_sequence
@NivsParam('runveristand', BooleanValue(0), NivsParam.BY_REF)
def systemRun(runveristand):
RmxOutput = DoubleValue(0)
doorSwitch = DoubleValue(0)
joystickInput = DoubleValue(0)

RmxOutput_chan = ChannelReference('Aliases/ATE/RMX-Output')
doorSwitch_chan = ChannelReference('Aliases/Cabin/Door/DoorSwitch')
joystickInput_chan = ChannelReference('Aliases/Cabin/Joystick/Joystick_input')

 

if runveristand.value:
RmxOutput.value = 1
doorSwitch.value = 5
joystickInput.value = 5

 

else:
RmxOutput.value = 0
doorSwitch.value = 0
joystickInput.value = 0

 

RmxOutput_chan.value = RmxOutput.value
doorSwitch_chan.value = doorSwitch.value
joystickInput_chan.value = joystickInput.value

 

def runtests():
realtimesequencetools.run_py_as_rtseq(startVeristand)

 

if __name__ == '__main__':
try:
runtests()
except Exception as e:
print(str(e))

 

 

However I am unable to execute this with the run_py_as_rtseq-function. I have system definition deployed to target and gateway running correctly, as I can read values with legacy API by using GetSingleChannelValue function.

 

The error message I am getting is: No constructor matches given arguments: (<class 'str'>, <class 'NoneType'>, <class 'list'>, <class 'bool'>, <class 'int'>)

Is there some obvious error that I am just unable to spot or is the code totally broken?

0 Kudos
Message 1 of 2
(122 Views)

I cannot see any visible error here. Have you looked for bus in Veristand? What version of Veristand do you use?

0 Kudos
Message 2 of 2
(42 Views)