12-16-2016 07:21 PM
Hello,
I was wondering what would be the best soultion to have a "reset button" for the attached program. I want to ne able to reconnect to the instrument any time the reset button is pressed.
Thank you so much in advance for kind help.
Solved! Go to Solution.
12-16-2016 08:23 PM - edited 12-16-2016 08:36 PM
Operating under the assumption that by "reset" you mean to reinitialize the connection to the VISA device... Using the current architecture, I would add a new event case that closes the current connection and reinitializes it. See attached.
This can be done a bit more cleanly with a state machine that has "initialize" and "close" cases.
**EDIT** It's very important that you replace the VISA session tunnels on the while loop with a shift register. I've updated the file to reflect this.
**EDIT 2** Looks like the "format string" function which formed the string to close the connection was wired to the "initial string" node instead of the "format string" node. I have fixed this and updated the vi again.
12-16-2016 08:46 PM - edited 12-16-2016 08:46 PM
I took a closer look at your string formatting and it occurred to me that there's a bit more in there that needs to be. Assuming the string you want to have at the end is "AMPR -110.000000", all you need to have in the format string is "AMPR %f"
See the attached snippet for a comparison.
12-17-2016 04:47 AM
@B_Strange wrote:
I took a closer look at your string formatting and it occurred to me that there's a bit more in there that needs to be. Assuming the string you want to have at the end is "AMPR -110.000000", all you need to have in the format string is "AMPR %f"
I have started using "%#g" for my SCPI drivers. Adding that '#' in the middle tells the formatter to drop off any trailing 0s.
12-17-2016 11:19 AM
Thank you so much for kind attentiona nd help!
12-17-2016 11:22 AM
Thanks!!