From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

VS2016 Iron Python on windows 7 to access hardware XNET-DAQ-FPGA

Hello I wrote a simple code to access hardware CAN channel from chassis using Ironpython Workspace2 SetsingleChannel method. I ran into an exception : Unexpected Exception Consult NI VeriStand help for error code 0xfffb4e32 error m essage Could not find channel 'Targets\Controller\Hardware\Chassis\DAQ\PXI1Slot2 It seems I am not able to access XNET port using IronPython. Please see my implementation below: APPDATADIR = r"C:\Users\Public\Documents\National Instruments\NI VeriStand 2016" CANPROJECTDIR = APPDATADIR + '\\Projects\TestPWM' CANSDF = CANPROJECTDIR + '\\TestPWM.nivssdf' print CANSDF LOGGINGDIR = CANPROJECTDIR + '\\Logs' TIMECHAN = 'Targets/Controller/System Channels/System Time' CANCHAN = 'Targets/Controller/Hardware/Chassis/NI-XNET/CAN/CAN1/Outgoing/Cyclic Event/BodyInfo_HS3 (946)/Ignition_Status' DIOCHANNEL = "Targets\Controller\Hardware\Chassis\DAQ\PXI1Slot2\Digital Output\port0\DO7" print CANCHAN print "Before Veristand Workspace Open" wks = NIVeriStand.Workspace2("localhost") print "After Veristand Open" try: print "Running %s" % CANSDF print "Inside System Definition File" wks.ConnectToSystem(CANSDF,1,60000) print "after Connect to system" print "NI VeriStand Running and Client Connected!" CanVal = wks.SetSingleChannelValue(CANCHAN,4) print "Ignition sent" while (state == 2): CanVal = wks.SetChannelValues(CANCHAN,4) print "If Veristand is open send ignition " time.sleep(1) raw_input("\n\nPress the enter key to exit.") except NIVeriStandException, e: TEST_COMMENT = "Unexpected Exception " + e.message() print TEST_COMMENT time.sleep(10) except: print sys.exc_info() time.sleep(10) finally: wks.DisconnectFromSystem("",1) Can anyone please suggest me how to access hardware ->Chassis->CAN or DAQ or FPGA using Veristand and Ironpython ?
0 Kudos
Message 1 of 1
(1,998 Views)