Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Angular question in a master slave Mango publisher environment
-
Hy,
I'm creating an architecture with one "Mango master" v2.8.8 and several "Mango slaves" v.2.8.8.
I've a persistent publisher from each slave to the "Mango master" and a persistent publisher from the "Mango master" to each slave.I need to drive a long running scripting datasource, it starts with remoteUpgrade=1 the signal arriving from master
if (masterControlEnabled.value === 1 && remoteUpgrade.value === 1) { masterControlEnabled.set(0); ... long elaboration masterControlEnabled.set(1); }
during the elaboration the slave inhibit other requests from the master using masterControlEnabled=0.
The architecture seems to be ok in this way but my problem is on master side, I've no idea about how to use the returning masterControlEnabled=0 from the slave to the master in order to switch off the upgrade request from the master to the slave.
I've tried with the following code where:
TRK_9_1_upgrade --> upgrade request from master to slave
TRK_9_1_master_control_enabled --> from slave to master inhibit other request<ma-switch-img point="TRK_9_1_upgrade" ng-mousedown="TRK_9_1_upgrade.setValue(!TRK_9_1_upgrade.value)" ng-mouseup="TRK_9_1_upgrade.setValue(TRK_9_1_master_control_enabled.value && TRK_9_1_upgrade.value)" default-src="./img/emergency-tiny.png" src-map="{'0': './img/off-tiny.png','1': './img/on-tiny.png'}">
but the value of TRK_9_1_upgrade remain fixed to 1,
any idea about how to use
TRK_9_1_master_control_enabled = 0
to switch
TRK_9_1_upgrade = 0 ?I've no idea about which event to use, and how, to catch updated value of TRK_9_1_master_control_enabled.
This is the definition of TRK_9_1_upgrade in the virtual datasource published from the master to the slave
Thanks for your help,
Antonio -
@etantonio said in Angular question in a master slave Mango publisher environment:
I've a persistent publisher from each slave to the "Mango master" and a persistent publisher from the "Mango master" to each slave.
I'm going to start with this and say this is probably not a good idea, it seems like an odd choice.
@etantonio said in Angular question in a master slave Mango publisher environment:
I need to drive a long running scripting datasource
What does it mean to "drive" a scripting data source. Sorry I don't understand.
@etantonio said in Angular question in a master slave Mango publisher environment:
during the elaboration the slave inhibit other requests from the master using masterControlEnabled=0.
The Persistent TCP publisher is not designed for real time control, this seems like a bad idea.
@etantonio said in Angular question in a master slave Mango publisher environment:
I've no idea about how to use the returning masterControlEnabled=0 from the slave to the master in order to switch off the upgrade request from the master to the slave.
You are trying to read a point value? You would need to add it as a context point for the script. I don't know what your "upgrade request" is, you should try and give a bigger picture of what you are trying to achieve and describe your questions in Mango terms. i.e. I have a scripting data source and I need to read a point's value where the point's XID is xyz.
@etantonio said in Angular question in a master slave Mango publisher environment:
<ma-switch-img point="TRK_9_1_upgrade" ng-mousedown="TRK_9_1_upgrade.setValue(!TRK_9_1_upgrade.value)" ng-mouseup="TRK_9_1_upgrade.setValue(TRK_9_1_master_control_enabled.value && TRK_9_1_upgrade.value)" default-src="./img/emergency-tiny.png" src-map="{'0': './img/off-tiny.png','1': './img/on-tiny.png'}">
I'm not sure how this is related to anything.. Please give an explanation of what you are trying to achieve (in Mango terms please).
-
I think that the best solution is is to use latest Mango version where publisher give opportunity to the master to set value back but actually I can't follow it.
Thanks anyway,
Antonio -
@etantonio said in Angular question in a master slave Mango publisher environment:
The architecture seems to be ok in this way but my problem is on master side, I've no idea about how to use the returning masterControlEnabled=0 from the slave to the master in order to switch off the upgrade request from the master to the slave.
this is my solution to this:
<md-button ng-if="TRK_9_1_master_control_enabled.value==1" ng-init="TRK_9_1_upgrade.setValue(0)" ng-click="TRK_9_1_upgrade.setValue(1)" class="md-raised" title="Upgrade">Upgrade</md-button> <md-button ng-if="TRK_9_1_master_control_enabled.value==0 && TRK_9_1_upgrade.value==1" class="md-raised md-pressed" title="Upgrading">Upgrading</md-button>