LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Master/Slave Control

Hi,

I can potentially have three or more HMIs (Labview executables) running at the same time, but from different host computers. There is also a real time labview VI running on the CRio. I need to implement something similar to a "master/slave configuration" using shared variables only.

- Where only one HMI, the Master, writes to the CRio at a time while others are read only.

- There is one main Master which has a fixed IP address, and at Rio start up the Rio or itself should know that it is a Master and give it control

- When the main Master is in control (has write access) no other HMI can write, but they can read. They becomes the "Slaves".

- When the main Master releases control, any other HMI can request and gain control

- BUT if the main Master wants control back it can kick any other HMI out of control at which time, they go from "temporary" Masters to Slaves.

- Note that when the main Master has control, no other HMI can request control but when temporary masters have control, any HMI can request control

 

Do you all have an idea on how I can implement this control strategy?

Thanks,

TeamHalli

 

 

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

You could have a TCP listener on your cRIO.  When something connects to it, that system becomes the "master".  If it is the real master, then just keep pings going back and forth to keep the port alive.  If it is a slave that connects, create another listener to attempt to connect to the real master if it wants to take over.  If that happens, send a message to the slave saying that you are disconnecting and let the real master take over.

 

This has not been fully thought out.  I'm just throwing out ideas.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(3,437 Views)

Thank you. What is a TCP listener ?

 

TeamHalli

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

@TeamHalli wrote:

Thank you. What is a TCP listener ?


It is something that waits for a TCP/IP connection. TCP Listen VI  Be sure to look up Simple TCP example project to see how to communicate over TCP/IP.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(3,424 Views)

Is there a way to log on and off to the VI which will lock and lock to other HMIs?

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

@TeamHalli wrote:

Is there a way to log on and off to the VI which will lock and lock to other HMIs?


You can just simply close the connection from your HMI and then the cRIO will catch that error and release the "master" status, allowing another HMI to connect.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,361 Views)