From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing VI referece via Datasocket connection

Hi,

 

I was trying to pass "This VI" reference from one VI to another using Datasocket as in the potential future both VIs will be working as a separated EXEs.

So I have noticed that reference data for some reason can't be passed and at the output I always have empty reference.

 

Gentlmen, does anyone know if this is technically possible to pass VI refernce in this manner and the most important question, if you have your VI compiled to EXE would this VI reference stuff still be valid? Technically it is not a VI any more?

This_vi ref.jpg

Beforehand Thanks,

Rustam

 

0 Kudos
Message 1 of 11
(3,542 Views)

I've ever used datasocket, but I don't see why it wouldn't work with VI reference... with the same VI, have you tried to pass a different type of data? or with a control reference?

 

If indeed datasocket don't work with VI Reference you can use VIServer to share VI references between 2 applicationa, I know it work because I sometimnes use this.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 11
(3,533 Views)

Yes I did try another types of the data and everething works fine except the VI reference.

0 Kudos
Message 3 of 11
(3,527 Views)

I tried  Shared Variable and found that it doesn't allow to create variable for the VI reference too.

 

 

SharedV.jpg

0 Kudos
Message 4 of 11
(3,518 Views)

>>  If indeed datasocket don't work with VI Reference you can use VIServer to share VI references between 2 applicationa, I know it work because I sometimnes use this.

 

Could you give me a bit more details about how to do that, it looks like I not quite understand what you mean?

0 Kudos
Message 5 of 11
(3,502 Views)

see this discussion on LAVA


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 11
(3,469 Views)

I will, Thanks a lot!

0 Kudos
Message 7 of 11
(3,463 Views)

You can probably typecast the reference to an integer, and typecast back to a reference on the other end, but I doubt the reference will be valid if the sender and receiver are different executables. Normally references are valid only within the context of the application that creates the reference.

0 Kudos
Message 8 of 11
(3,441 Views)

Normally references are valid only within the context of the application that creates the reference.

 

That is very true, and you need to get app's ref of the VI you want to work on otherwise it won't work.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 9 of 11
(3,430 Views)

Well, I tried to hide VI reference inside variant or cluster but it doesn't work unfortunately, on the other side it appears corrupted.

0 Kudos
Message 10 of 11
(3,421 Views)