09-12-2006 06:21 PM
09-13-2006 11:51 AM
Howdy Tom,
You are doing a lot of extra type casting in your LabVIEW VIs that you do not
need to. In TestStand, some of the LabVIEW I/O controls are represented
as clusters with two elements, Device Name and Session Number. You can specify either a device name
or a session number. The session number will always be used if it is not zero.
The session number can be used in other development environments, such as
LabWindows/CVI, as long as they are in the same process. You can use the
TestStand data type, LabVIEWIOControl, to
create variables for I/O controls. The I/O control references that are
represented this way are VISA, IVI, FieldPoint, Motion, DAQmx Task Name, and
DAQmx Channel Name.
To insert this variable, go to your Locals tab, right-click and select Insert
Local >> Types >> LabVIEW >> LabVIEWIOControl.
Then you can pass this variable in and out of LabVIEW without doing any
typecasting. See the attached screenshots.
Anyway, this is the best approach and architecture design you want to
concentrate on.
Hope this helps!
Best Regards,
09-13-2006 03:27 PM
Hi Jonathan,
Thankyou for your reply to my query. I had already been using your method of passing my instrument handles between LV and Teststand using a LabviewIOControl. However I was experimenting with the typecasting method I described as I wanted to try to connect LV to the IVI instrument handle that Teststand automatically opens on startup.
Hence my question is.....
I'm a little confused about how many IVI handles should be opened at once when working with Teststand and LV together. I know that Teststand automatically opens an IVI handle at startup for each instrument, which can be used in subsequent native Teststand IVI steps.
However, should you open an additional IVI handle for LV to use in LV VIs, or can you simply connect to the IVI handle that Teststand automatically opened????????
If you can connect LV to the already opened Teststand IVI handle how is this done? I've tried to use session manager, and the Teststand IVI Tools step to get instrument sessions, but cannot get LV to share this common resource.
I greatly appreciate your help with this confusing issue,
Regards,
Tom
09-13-2006 03:42 PM
09-13-2006 04:58 PM
Hi again Jonathan,
Thankyou for the instantaneous reply.
Your reply was clearly explained. I'll use only LV IVI steps in future.
Are there the same limitations when using Switchexecutive in both Teststand and LV?
I've found an example on ni.com that passes a Switchexecutive session between subsequent LV steps in a Teststand sequence. They did this by passing a NISE Session variable (Number U32), between different VIs called by Teststand. If I do call Switchexecutive steps from inside LV VIs, this does this mean I shouldn't use the Teststand Switchexecutive steps in Teststand?
Regards,
Tom
09-14-2006 12:43 PM
09-14-2006 03:11 PM
Hi Jonathan,
After writing my last post I spent time experimenting using Switchexecutive inside Teststand, and I take your point - The Switchexecutive engine is well supported/integrated into Teststand steps. I'll try to structure my code to only utilise Switchexecutive inside Teststand in future.
Thanks for all your advice.
Regards,
Tom