Forums › SA Series Discussions › SA124B SH_API.DLL restart in Labview › Reply To: SA124B SH_API.DLL restart in Labview
rmaso
In case anyone else is looking at this type of problem, I implemented a fix as suggested above by Justin.
I was concerned about the accidental disconnection of the device and the USB cable. Using the LabVIEW wrapper VI’s submitted by someone else on this forum, I would monitor the error lines for the 5010 error. When that was detected, it would close the device, wait for the cable to be plugged back in (by repeatedly asking for serial numbers of connected devices), then try the connect and initiate/setup commands again. This works terrifically! The only thing to note is that as written, the VI to close the device only runs when there is no error, so you can’t pass the 5010 error cluster to it as it is currently written. I chose to just pass an error constant to the VI to make it always run.
I tried this method over and over and it ran flawlessly (after working out the above error issue).
I know this is an old thread, but hopefully it’ll help someone somewhere!
Thanks to Justin and Andrew for their help with my program.
