03-05-2019 09:53 AM
Okay, I solved this, and it was very simple as I was expecting. I didn't find the .NET object control and indicators in the LV menu's, but eventually did and worked out how to use them. So did this:
>Run initialise case with .NET constructor
>Pass .NET reference out via it's indicator and through a connector to Teststand
>Store this ref as a local variable in Teststand
>Run a new step calling a different case on the VI
>Pass the reference into the .NET control, via another input connector
>Invoke node is now happy and I'm using the existing .NET object
On first run it's worked so should be rolling now thanks!
03-05-2019 09:54 AM - edited 03-05-2019 09:56 AM
In TS, you will need to separate the calls into 3 steps:
1) Open Ref
2) Make .net calls
3) Close Ref
The way I passed the .net reference from step to step was by converting it to a U32 value and pass it back to TS. Your vi's in steps 2 and 3 will need to accept the U32 Ref and convert it back to a true .net reference
In LabVIEW, you will either need to write a upper level vi that mimics the TS steps, or build an entirely new vi that does not stop until you are done issuing commands.
EDIT: Missed it by a minute! Glad you worked it out.
03-05-2019 09:57 AM
Thanks Fozen, as above your post I got this working like you said. However TS has an 'Object Reference' variable type I used specifically for this.
03-05-2019 09:58 AM - edited 03-05-2019 09:59 AM
@Tom0000 wrote:
Okay, I solved this, and it was very simple as I was expecting. I didn't find the .NET object control and indicators in the LV menu's, but eventually did and worked out how to use them. So did this:
>Run initialise case with .NET constructor
>Pass .NET reference out via it's indicator and through a connector to Teststand
>Store this ref as a local variable in Teststand
>Run a new step calling a different case on the VI
>Pass the reference into the .NET control, via another input connector
>Invoke node is now happy and I'm using the existing .NET object
On first run it's worked so should be rolling now thanks!
EDIT: +1 for posting the solution in the first place!
All that's left to do know is to accept the solution!
03-05-2019 10:00 AM
Is there a solved button on here? 🙂
03-05-2019 11:09 AM - edited 03-05-2019 11:10 AM
As topic creator you should get an Accept As Solution button right besides the Reply button. I did mark your post as solution for you.