11-29-2006 03:18 AM
11-29-2006 04:38 AM
Hi,
You need to use the StationGlobals.
Once the SequenceFileLoad sequence has finished the execution it is finished and therefore anything stored in the FileGlobals at runtime are lost and the values you maybe seeing are the static values.
Regards
Ray Farmer
11-29-2006 06:58 AM
hi ray,
thanks for your reply.
do you mean that even the resource name can't be used in my main sequence?
as I think the two callbacks and the main sequence are all in the same sequence file.
11-29-2006 07:10 AM
Hi,
If its the Alias such "COM1" then that will be ok, but if its a handle returned by the initialise function then that will not, and looking at your error message it sounds like the later. Therefore you would have to perform the initialise in you MainSequence.
Regards
Ray Farmer
11-29-2006 07:57 PM
Today I have tried to put both in the same sequence of the sequence file (to open the session first and then close the session), and still got the same failure report.
what I use to store the VISA resource name fileglobals.VISA_RESOURCE
It's a container of device name: COM1
and sessionnumber: 1642504
it's really strange and why?
11-30-2006 06:34 AM
09-25-2014 10:01 AM - edited 09-25-2014 10:02 AM
I apologize for resurecting an old post but ran into "VISA: (Hex 0xBFFF000E) The given session or object reference is invalid" error with LabVIEW + TestStand.
I used breakpoints at various steps and launched the LabVIEW VIs in debug mode. I noticed the "Value" of the VISA resource name FileGlobal in the Variables pane was not retained after execution was completed.
This proves anything stored in the FileGlobals at runtime is lost. To summarize, I am unable to pass VISA resource name from one sequence to another as a FileGlobal in TestStand with my implementation.
While searching through the forums, I came across three possible solutions. I was able to solve using the workaround suggested by Ray Farmer. i.e. use StationGlobal in TestStand for the VISA resource name. Hopefully, this helps someone.
Thanks,
Mohit Kapur
09-25-2014 10:09 AM
In my opinion, TestStand shouldn't even be holding the VISA Resource. It is used in LabVIEW, so LabVIEW should hold it. Therefore, I use Action Engines to hold my references and act on them when appropriate.
09-25-2014 02:21 PM
The only caveat to the crossrulz is doing it is if something dynamically unloads all modules in the middle somewhere. Then the Action Engine will no longer have the session and the next call will have to create one. However, I do like the action engine idea.
Personally I hate the idea of using StationGlobals. It requires the variable to exist. So now you have to deploy or have some tool set up that variable on a first run. Plus it is more prone to race conditions and coupling. Seriously, I can do this all day... 🙂 Globals are a bad idea.
We use parameters. The same way it's used in LabVIEW. Passing the active handle around.
Cheers,