LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass data from main vi/exe (sender) to many vi/exe (receivers) with one receiver code/vi?

Hello all

 

I am tring to dev some data distribution system, where one vi gets data from hw to shared variable. Vi compiled to app "sender.exe" The others units (receivers) should receive that data from shared var and write it to different serial ports (configured by user in runtime via control). Number of actually working ports may vary.

 

Should (and can?) this "receivers" vi's be the one vi, compiled to app "receiver.exe" and executed many times with different settings (diff serial port number)? // I tried this, second+ execution of receiver.exe just makes existing window active instead of creating new process as it works with other languages.

 

Or should i build many different vi (receiver1, receiver2, ... with actually the same content) into different .exe to run them at the same time?

 

Or may be the best way to build multi-port receiver with ability to communicate with any number of serial ports? // i dont like this, no code reusage here ))

 

The question is complicated with possibility to work via network (one of the reasons to make different exe for receivers) and may be the shared vi namespace may not allow many receiver-side vi's to have the same name?

 

In short, it should work as SENDER.exe >> RECEIVER1.exe, 2, 3... i.e. "one to many".

 

Asking for a best solution advice.

 

Please help)

0 Kudos
Message 1 of 6
(3,104 Views)

ns_create wrote:

Should (and can?) this "receivers" vi's be the one vi, compiled to app "receiver.exe" and executed many times with different settings (diff serial port number)? // I tried this, second+ execution of receiver.exe just makes existing window active instead of creating new process as it works with other languages.


To allow multiple instances of the same exe, read this.

 

(I don't fully understand your setup, so I won't comment further at this time.)

 

Message 2 of 6
(3,097 Views)

thanks for a hack with .ini parameter ))

but the main question still actual - will it be a good working solution?

0 Kudos
Message 3 of 6
(3,093 Views)

I don't have the details of what your receiver.exe is doing but if you want to instanciate VI look into the *.vit (VI template) with "Open VI Reference", or launch them as reentrant.... see the help of Open VI Reference Function.

 

Michel

0 Kudos
Message 4 of 6
(3,092 Views)

@ns_create wrote:

thanks for a hack with .ini parameter ))


It is not a hack, but a valid and fully documented option. 😉

0 Kudos
Message 5 of 6
(3,088 Views)

As the ini-hack allows execution of many identical data receivers on host, the question become simply "one vi/exe with access to many serial ports" or many identical vi/exe each for own serial port (via from panel config). Is there any differense on VISA res access? As i see the variant with identical vi/exe "one for each serial port" looks more flexible and simple -- no additional coding for loops management, port open/close...

0 Kudos
Message 6 of 6
(3,068 Views)