10-09-2015 09:06 AM
Hi all,
I am having a strange issue regarding a database connection. My goal is to open the DB connection in the ProcessSetup callback and to close it in the ProcessCleanup callback. I am using the LV database toolkit.
When I open the DB in ProcessSetup, I write the DB reference to FileGlobals.DatabaseRef. My first attempt at writing to the DB is then in a subsequence of the MainTest callback. When any DB VIs try to execute I get the error shown in the attached file "Error Message.png".
Interestly, if I open the DB in the MainTest callback, everything works correctly.
Any ideas as to what could be causing this? I have set all executions to share FileGlobals in SequenceFileProperties. I have also traced the database reference and its value is set in ProcessSetup and is the same in the MainTest callback. I have attached images of the variable in three break points:
Thanks!
TS Version: 2014 SP1
LV Version: 2014 SP1
10-09-2015 09:09 AM
Last image is attached.
10-12-2015 05:28 PM
Maybe make sure the Reserve Loaded VIs Option is selected in the LabVIEW Adapter Configuration. Perhaps the reference is being closed before it is supposed to be. Does this error occur every time?
10-13-2015 08:16 AM
Hi AgentAstronaut,
Reserve loaded VI's is selected. The error does happen every time.
I was able to come up with a simple solution. I threw an IF statement at the begining of my main sequence, If(DatabaseRef <=0) (Open Database). This worked well in the development system, but on deployment its not working as intended. The first time I run the test socket it works, if I restart the socket I get the same Error #1... Bangs head on wall...
10-14-2015 04:53 PM
Hi ademedeiros,
- What process model are you using?
- Are the module settings set to load and unload dynamically?
- By "restart," do you mean completing stopping execution and starting a new execution? Or just running a new UUT? I would want to be sure that ProcessSetup is actually called the second time.
- Are the VIs saved in the same version of LabVIEW?
10-15-2015 12:23 PM
I would suggest adding code to the Setup seqeunce, like an assert, that validates that the handle is valid. It could be that the handle is not valid and is negative.