Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI Switch Exec Simultaneously is Both teststand and Code Modules

Solved!
Go to solution

Hi,

 

I have found the NI response and workaround suggestion that I think may work for me:

 

Use TestStand expressions from within the code module to access the physical device to occur only from the main Test Stand process.

 

1. Pass a reference to SequenceContext into the code module and create a property object such as a string property

2. Call EvaluateEx on the existing property object and evaluate one of the Switching Expression Functions to invoke the NISE API through Test Stand.

 

I'm not sure where to start with this, I've got a reference to sequence context but after that I'm lost! 

 

Anybody here done it this way,

 

Regards,

 

Steve

0 Kudos
Message 1 of 10
(6,949 Views)

Kelly:

 

Here are some example files showing how to call SwitchConnect() in the TestStand process, but from a LabVIEW vi:

 

Brian

Download All
0 Kudos
Message 2 of 10
(6,928 Views)

Thanks Brian,

 

I should have mentioned I'm using LW/CVI!  I think my issue is I need to run the NISE API in the Test Stand process but from the code module, but the methods I've tried seem so slow.

 

Many thanks Brian,

 

Steve

 

0 Kudos
Message 3 of 10
(6,918 Views)

Steve:

 

Here are some files to show how to run SwitchConnect() in the TestStand process, from CVI.

 

Brian

Message 4 of 10
(6,910 Views)

Brian,

 

That's great thanks,  It's got me some way down the road...however...

 

My next issue, and the code you supplied works great, but only if the CVI module is called the first time.  The next time it's called, from another sequence file which is in turn called from the main sequence, it says the resource is locked. I'm assuming NISE has used it's maximum of two handles although I'm not sure where.

 

The workaround would be to release the handle, but this calls ini_withoptions which resets the switch which is exactly what I can't do.  Unfortunately the nature of the project precludes me from pasting code/sequence segments.

 

Is there anyway to instigate NISE comms without calling withoptions/reset?

 

Many thanks,

 

 

Steve 

0 Kudos
Message 5 of 10
(6,872 Views)

Brian,

 

That's great thanks,  It's got me some way down the road...however...

 

My next issue, and the code you supplied works great, but only if the CVI module is called the first time.  The next time it's called, from another sequence file which is in turn called from the main sequence, it says the resource is locked. I'm assuming NISE has used it's maximum of two handles although I'm not sure where.

 

The workaround would be to release the handle, but this calls ini_withoptions which resets the switch which is exactly what I can't do.  Unfortunately the nature of the project precludes me from pasting code/sequence segments.

Is there anyway to instigate NISE comms without calling withoptions/reset?

 

Many thanks,

Steve 

0 Kudos
Message 6 of 10
(6,871 Views)

Steve:

 

Sub-sequences worked fine for me, without error. See attached files.

Which switch devices are you using? Can you post your sequence files to the forum?

 

Brian

0 Kudos
Message 7 of 10
(6,869 Views)

Brian,

 

I use the CVI code you posted...but I'm running an older version of Test Stand (2013) so I can't open the sequence files. I'll try to download an evaluation of the later version.

 

I very much appreciate your help Brian, but I can't post our sequence files due to their confidentiality.

 

Steve

0 Kudos
Message 8 of 10
(6,865 Views)
Solution
Accepted by topic author kellymidge10101

Here are the sequences saved for TestStand 2013. See attached.

 

0 Kudos
Message 9 of 10
(6,863 Views)

You'll need to fix up the subseq call paths in the main seq, to match the 2013 subseq file names.

0 Kudos
Message 10 of 10
(6,861 Views)