Data point force reading from user dashboard
-
Hi all.
I have a MODBUS data source with a specific interval update period.
Is there a way to force the reading of a specific data point from the MODBUS slave device directly from the user dashboard (e.g. by means of a button) outside of the polling?
I mean I would have on my user dashboard something like the refresh button which is on the data point details page on Mango back end.Thanks!
Larry -
@LarryVaredo
There is an API method for it but there is no client side code for calling it. It should be trivial to add so I'll do that today for you. -
@LarryVaredo
I've implemented this functionality for the next release. If you need it sooner you can add this to your/web/modules/dashboards/web/js/mango-3.2/services/Point.js
filePoint.prototype.forceRead = function forceRead() { var url = '/rest/v1/runtime-manager/force-refresh/' + encodeURIComponent(this.xid); return $http.put(url, null); };
You can use it like this
<md-input-container class="md-block"> <label>Choose a point</label> <ma-point-list limit="200" ng-model="myPoint" query="{dataSourceXid: 'vmeters'}"></ma-point-list> </md-input-container> <ma-point-value point="myPoint"></ma-point-value> <md-button ng-click="myPoint.forceRead()" class="md-raised">Force read</md-button>
-
@Jared-Wiltshire
Many thanks Jared.
It works perfectly and it will be very useful for me.Bye.
Larry -
Hi @Jared-Wiltshire .
Hi updated my Dashboard module to 3.3 version, so I have modified the
/web/modules/dashboards/web/js/mango-3.3/services/Point.js
file as done with 3.2 previous version. But it seems not working more.
Should it still work?
Thanks a lot.
-
@LarryVaredo Yes it should still work. Just ensure your web app is loading the JS files from the
mango-3.3
folder and not themango-3.2
folder (which would have been overwritten on upgrade). See http://infiniteautomation.com/forum/topic/2439/upgrading-your-custom-dashboard-from-v3-1-to-v3-2 (same principal applies even though this is for a different version)PS, this fix should have made its way into dashboards 3.3 but didn't due to a mix up in which branch I committed the fix into. It will definitely be in the next release.
-
@Jared-Wiltshire you're right! My app was loading files from mango-3.2 folder. It works now.
Thanks a lot.