03-13-2017 12:30 PM
Hello,
I'm communicating with a watlow f4 with a rs232-> USB conversion cable
I'm using the VISA Configure Serial Port to create my base of communication with the watlow.
My program is working fine and doing what it needs to in terms of execution, but I'm trying stump out the last of my "what if X problem occurs while program is running"
Right now, the X (problem) i'm trying to resolve is
"what happens if someone accidently unplugs the watlow USB plug from the back of the PC that the application is running on?"
For now, I do have it sensing such an error, but I'm basically telling the user that the program will have to be restarted.
I would like to pause the program when this error has been detected (which I know how to do) and tell the user "please plug-in the serial COM USB back into the PC, select the COM port from the drop down list and press OK to resume program" (this is the part I can't figure out how to do)
How can I reset and re-initialize the VISA serial port after my program detects this error?
Solved! Go to Solution.
03-13-2017 01:02 PM
What I have done is perform a scan every X seconds for new serial ports and populate a ring with that list (use VISA Find Resource). Once the user presses the OK button, just reinitialize the port like you did at the start of the program.
03-13-2017 01:19 PM
Ok I can try that
How do I convert that visa find resource output string into the ring and than convert that selected port from the ring into a unique reference for the visa i/o session?
03-13-2017 01:27 PM
i just realized I can use strings to input as the visa resource name for the "configure visa serial port.vi" ... thanks again , i'll try it on my own and see what happens!
03-14-2017 12:35 PM
Let me address this a different way.
Why would you allow physical access to the USB connections? There are no "Accidentally" disconnected cables in a proper environment. What you have is a location that is inherently UNSAFE! Worse, no-one is paying enough attention to even notice that the environment is placing equipment and personnel at risk of harm.
Given that situation, I personally, would be more concerned about updating my resume than my code.
03-14-2017 03:31 PM
While I agree that having the USB accessibly in unsafe ways is bad...its just that way by default due to the circumstances of the surrounding environment
my setup is on multiple rolling carts that are basically my test stands for technicians to use.
these carts roll around to different thermal/environmental chambers depending on the needs..the USB for my watlow communication is plugged into the back of the test stand PC..if the test stand cart was stationary and never ever moved, I could build a more safe environment to house my com connections.
but since I do have to move around the test stands and plug them into different chambers(thus, a different watlow), these USB connections do have to be unplugged from time to time.