Hmmm, yea, Labview would have been the way to go, I guess. Getting hardware, such as Agilent test equipment, is much easier than getting software, even if the hardware is much, much more expensive.
Why Access?? ...cause it is what I was familiar with with. I have VB6, but don't know how to do databaseing with it or report generation. VBA is also, to me, easier, an Access is a natural for Databasing and Reports (within its limits). I knew Access rather well from managing our Service database since 1999, but I keep learning more and more every day.
Can you please explain what you mean by "re-entrant"? I think I know what you mean, but I would rather hear it from you. One of the pains, sometimes, is the multi-threading. I am meaning the ability of a user to click a button to do something else on a form while another operation is running. Yes, that is a pain to stop, if you have a large form with a lot of task capabilities.
Last night (this morning around 2am) I discoverd that my module that controls the Agilent 11713B, Attenuator Controller, had numberous highly used routines that would assign a resource, such as this:
Set ioMgr = New VisaComLib.ResourceManager
Set instrument = New VisaComLib.FormattedIO488
without doing the following:
instrument.FlushRead
instrument.IO.Close
Set instrument.IO = Nothing
Set instrument = Nothing
Is this not similar to opening a table and database and exiting a function without closing them and equating them to nothing?
I don't hold out a lot of hope for that. I looked throught my O-Scope and Generator code and that code always closed out the resource, although the slow down usally occures after a heavy use of the attenuators.
BTW, I am fairly sure that I am using the Tektronic Visa Library and not the Agilent, if that means anything. It shouldn't. I used VisaComm instead of several other options because I fould it the easier to understand and work with, although it is probably not the newest communications method.
After extensive testing late last night/early this morning, I have ruled out the MSCOMM control slowing down. My serial operations to our instrument test as fast as they always have even after the memory bloats.
I am almost convinced that memory hogging is not causing the slow down. It slows down if I am running the MDB version or the MDE version, with the MDE version using 30 megs less memory. All string useage is fixed length and I use LSET equating any string data. I dimension arrays and the redim them as needed and redim them to (0) when exiting the routines. All data is held static on the forms and then only saved to a table when hitting the "SAVE/EXIT" button. So rs and dbs are not held open. Forms are not based on queries or recordsets. I removed excess/unused routines from modules. I've decompiled, compressed, etc. So now I am looking in the VisaComm I/O as the slow-down.
I've lost a lot of sleep over this the last month, and I don't feel great right now after only 4.5 hours sack time. What-ever the cause, if I abort the test. Exit Access, Reload Access and continue the test from where I left off (pain in the ass) the test continues at full speed (and quite fast I must add).
Take care,
Dave
Just getting in on the tail end here but a couple of observations:
I'm curious why you're not using LabView instead of VBA to interface to the machine. LabView is made to handle large amounts of data from a GPIB.
But, like you, I opted to use VB instead of LabView because we didn't want to purchase the LabView/G object for writing to Oracle. And I learned quite a bit.
In my experience, I found that we could make code re-entrant and that could cause some problems with bloating after several runs. We also had some problems with fragmenting memory (similar to fragmenting a disk drive) as already alluded to and I believe it was directly caused by the re-entrant code.
In order to fix the re-entrant problem, you can create a static variable at the front of each subroutine/function that won't allow you to be "inside" any sub/function more than once at a time (you have to code this, it is not automatic). With the information gained from disallowing re-entrant code, you could more easily troubleshoot where in the code you are having problems.
Of course, recursive code can cause similar problems but that is not what I'm (necessarily) talking about.
This is in addition to the already great advice you've receieved from Doc, wazz, and Wayne.