Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-485 and vb.net run time problem

I have a problem with my compiled code using the ni usb-485 single channel cable. I'm using the standard SerialPort1 component from my tool bar window (running vs.net 2005, xp system). If I compile my program and run it while the development studio is open - All works well - meaning the correct ports are found and read/write communications work (currently using com1 from the motherboard and com3 as assigned from the usb-485 installation). If I restart the computer or just close my VS.Net development  program, both ports no longer read/write when the compiled code is run and there are no errors generated.
 
Any ideas would be greatly appretited (I'm currently looking into using the visans driver)
0 Kudos
Message 1 of 2
(3,214 Views)
Figured it out!
 
Problem was not with the hardware or drivers but was related to starting my thread to read the ports. A threadstart on the form.load event did not work predictable until I added a thread.sleep statement before creating/starting  my port monitor threads. It was a visual Studio thing.
0 Kudos
Message 2 of 2
(3,198 Views)