02-12-2015 02:01 PM
import time
import NIVeriStand
from NIVeriStand import NIVeriStandException
wks = NIVeriStand.Workspace2("localhost")
SYSDEF = r"C:\Users\Public\Documents\National Instruments\NI VeriStand 2013\Projects\Pump\Pump.nivssdf"
print 30*"+"
wks.ConnectToSystem(SYSDEF, 1, 60000)
print 30*"*"
time.sleep(5)
The screenshot was attached.
I couldn't find out what this error code is from the NI web or help file.
Any idea?
Solved! Go to Solution.
02-13-2015 03:00 AM
Hi,
It seems as though there is already a SDF deployed.
Before you call ConnectToSystem you could check for a deployed SDF and disconnect it:
state = wks.GetSystemState() if (state['state'] != 0): print 'Error! System state not expected!' print "Undeploying SDF: " + state['systemdefinition_file'] wks.DisconnectFromSystem('',1)
02-13-2015 02:21 PM
Hi UKCraig,
I did as you suggested. The weird thing is GetSystemState returned a non-zero value, which I could still read out the correct channel value
02-16-2015 02:52 AM
Did you try disconnecting as I suggested above?
02-17-2015 10:00 AM
Hi UKCraig,
You're right. When I used disconnecting, it worked! It will first disconnect the system and deploy it again. If I'd like only to read some channel values out from the running workspace GUI, I don't need to use the connectToSystem methon in python script.
Thanks a lot!