One touchpanel, two masters....how to dynamically connect to the touchpanel
freijnen
Posts: 18
Hello,
I have a question. I hope someone can help me on this.
A client wants a fail save system.
His idea is to have 2 NI netlinx masters with several devices connected to them using ethernet.
When one of the masters would fail, the other should take over.
I know i can use master2master communications to determine if a master is online or not.
But how can i dynamically take over communication with a touchpanel if one of the masters would fail?
In other words, how can i dynamically, at will, connect a master to a touchpanel, providing all are on the same ethernet network?
I have a question. I hope someone can help me on this.
A client wants a fail save system.
His idea is to have 2 NI netlinx masters with several devices connected to them using ethernet.
When one of the masters would fail, the other should take over.
I know i can use master2master communications to determine if a master is online or not.
But how can i dynamically take over communication with a touchpanel if one of the masters would fail?
In other words, how can i dynamically, at will, connect a master to a touchpanel, providing all are on the same ethernet network?
0
Comments
I don't believe it's possible for a master to select a panel; it's the other way around.
Yes, auto mode with a system number of 0 will make the panel use the first master it finds. If the connection is lost, the panel will return to searching for a new master.
The downside of this is that you can't control which master the panel will connect to if both masters are up and running. It will connect to the first one it finds.
If the code is identical, I don't see a problem anyway. It's not like the BUTTON_EVENTs will fire if the panel is not connected.
But i have already found a solution.
I set the touchpanel to mode listen.
Then, i set on the master the ip of the touchpanel inside the URL list.
Futher, i'll use M2M communication to implement a watchdog function for the backup to see if the master is online.
At the moment the watchdog goes down (and the master is dead) the backup will load the ip of the touchpanel in its URL list so the touchpanel will automatically connects to the backup.
As soon as the master is online again the URL can be deleted out of the URL list on the backup.
Therefor losing connection with the touchpanel so it can connect to the master again.
I have done some testing with connecting a touchpanel in mode listen to a master and this seems to work ok. Now i have to wait for the hardware to arrive to do a full blown test.
Listen mode on the TP only allows a single IP address.
If you wanted to follow this route, you'd need to set both masters to the same IP address and trigger a system to detect when to power up master #2 when master #1 fails. you can get power adapters that can ping to detect connectivity of a device.
Another way of looking at this would be to use a dns name with the TP in Listen mode and then modify the dns lookup table to switch between masters IP's.
I did the following test.
I only have one NI controller at my disposal at the moment so beare with me.
I set a touchpanel to mode listen. Both the touchpanel and the controller have a unique fixed ip address.
In the startup section of the code for the controller a added the ip of the touchpanel to the URL list.
The controller starts up and i have connection with the touchpanel.
Next: i use netlinx studio to change the IP of the controller and i change the system number.
Then i do a reboot of the controller. I didn't change the code, so at startup the IP of the touchpanel is added to the URL list.
I see on the touchpanel that the connection is lost when i do the reboot (ofcourse) but the connection is restored when the controller is back online, despite the different IP and system number.
It appears that indeed only one ip address is possible at a time for a touchpanel in listen mode. But when that connection is lost the touchpanel can accept another ip from another master for a new connection.
I think this proves this setup most work for the situation i describe. But unfortunelaty i don't have the hardware yet to do a full blown test.
Of course, this, once established that the other master has gone down.
Running a quick test with 2 masters this does appear to work as you intended switching between the masters - at least the TP indicates this. Remember that the URL list is persistent and once added you need to specifically remove the address otherwise both masters will be sending the connection message at similar intervals.... and that might lead to unexpected results.
Let us know how you get on once you test this fully.
Finally i have the hardware to do a test.
And it seems to work just fine!
I use M2M communication for a watchdog connection from the master to the backup system.
If the backup doesn't receive the watchdog message for a specified time
it fills it's URL list with all the connected devices.
Then it automatically connects to all those devices.
As soon as the master is online again and sends a watchdog message, the backup system deletes it's URL list.
Then the master is free to connect again to all online devices.
This seems to work nicely with touchpanels.
It works so well that the backup system takes over when i reboot the master (for reprogramming) . And the master takes back control once it's online again. It takes less then one minute for all devices to come online on the backup system when the master shuts down.
Allthough i still have a problem. I also have a UDM-0808 in the system, and this device doesn't seem to connect using the listen mode