Home › Forums › HTBasic Forum › Resetting HTBasic and NI-VISA to start up conditions
Tagged: gpib
- This topic has 6 replies, 3 voices, and was last updated 2 days, 21 hours ago by Tony Goodhew.
-
AuthorPosts
-
January 4, 2025 at 5:55 pm #9416
Hey All,
I’ve just started trying to use HTBasic with the NI-VISA/488.2 libraries and I’ve found myself in a situation where I need to completely reboot my machine to get back to the startup conditions for HTBasic.
BASIC RESET and unloading the drivers don’t seem to return me to that startup state – Where I see it is that I’m trying out some commands in my program, and I fully admit that I’m an HTBasic NOOB as I normally just use C# and the VISA.NET library, and something goes wrong. The next time I run the program I get timeouts or NULL returns.
I can still use the NI VISA Interactive Console to talk to the instruments so I don’t think that the entire VISA stack is broken but I’m clearly not doing something that I should to reset my HTBasic condition.
Any pointers or tips appreciated.
Thanks,
TonyG
January 6, 2025 at 5:49 am #9417Hi Tony,
First thing to do is to modify the NI Driver call in your software, normally in the “AUTOST” program
LOAD BIN “GPIBNI;DEV GPIB0 ISC 7”
“GPIB0” and “ISC7” need to be compatible with what you have in your NIMAX parametersJanuary 6, 2025 at 7:12 pm #9418Thanks – My driver load is correct, the issue I’m having is that after some point HT Basic stops working with the NI Stack – The NI stack still works as I can use their test panel.
In fact the same code will work in HT Basic just after a complete reboot of the PC – Shutting down HT Basic and restarting doesn’t fix it – It seems that there is something left running that hoses the HT Basic connection.
TonyG
January 11, 2025 at 5:24 pm #9419Hi Tony,
What version of HTBasic are you using and what driver are you loading (GPIBNI or VISA)? Could you also show us what you are using in your LOAD BIN statement?
Thanks,
Pat
January 11, 2025 at 5:44 pm #9421Hmm – I replied with the code and some images but I don’t see the reply so to quickly recap without the images in case that it causes the post to be sent to moderation/blocked.
The devices will work for a short period of time. I don’t have a repro case for the failure except that after some point it always stops communicating. The devices are being used over the VISA driver.
I’ve tried both loading the driver in the app and using the device setup dialog (I haven’t tried using an AUTOST as they’re supposed to be equivalent).
Code line is:
10 LOAD BIN “VISA;DEV TCPIP0::192.168.1.50::inst0::INSTR ISC 8”
HT Basic version is 21.1.017
All suggestions appreciated.
Thanks,
TonyG
- This reply was modified 2 days, 23 hours ago by Tony Goodhew.
January 11, 2025 at 7:03 pm #9423Thanks Tony for the additional information.
Could you provide more details around when communication seems to stop? For example:
1. How long is “A short period of time”? Minutes, Hours, Days?
2. When it stops working, is there an error displayed in the currently running program (If so, what error), and the program execution is stopped? Or is it always between runs that it goes from working, to not working?
3. To expand on #2, is it always after re-launching HTBasic that it appears to stop working, or is it working and then subsequently not working, in the same instance of HTBasic?
4. When you say unloading the driver and then re-loading it does not solve the issue, are you unloading it from inside Device Setup? When you re-load the driver, does it show it loaded correctly, but still doesn’t communicate? or does it simply fail to load?
5. Have you tried using the HTBasic reset utility after communication stops, to clear the registry and then re-add and re-load the driver? Does that resolve the issue, without requiring a reboot?What I suspect is happening is that an error is occurring that is causing the current Visa Session not to work, but that the session is also not getting closed correctly, blocking new sessions from getting opened. What I don’t understand, is that unloading the driver should closes the session, so why does that not resolve your issue. Answers to my above questions will hopefully help me to narrow down what is happening so that we can propose a work around, or find a solution.
Thanks,
Pat
January 11, 2025 at 7:14 pm #9424Hey Pat,
Here you go:
1. I’ve found this to happen in the 10’s of minutes range.
2. Not sure about during execution but it is certainly during one HTBasic session. I’ve seen both timeout errors and simple “Enter” statements return without any values in the variables (i.e. if I’m doing an *IDN? then the Enter returns with a blank string). Stopping and restarting HTBasic doesn’t help, I have to reboot the machine.
3. No, it happens during one session of HTBasic use and then subsequent restarts of HTBasic have no impact on the issue. Only rebooting fixes it.
4. Yes. I’ve initially setup the instrument in the “Device Setup” dialog and when this happened I tried unloading and reloading the driver to no avail. This is when I tried loading the driver in code to see if that was different but I still had the same issue.
5. I have not tried that – I tried the “BASIC Reset” button in the toolbar but that had no impact.I won’t get to it tonight but I’ll crack open HTBasic again hopefully tomorrow and see if I can get it to fail (I fully expect now that you’ve asked it will operate perfectly until this post ages out) and then try the reset utility.
Thanks for the help.
TonyG
-
AuthorPosts
- You must be logged in to reply to this topic.