| Author |
Message |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 26/08/2010 03:06:25
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Hi,
I'm interested to show (and log) a variable that's the sum of more variable read by different devices ( i.e. 7-8 solar inverter and also output the variable serially. Do you think it's possible? Maybe I can use put and get to pass the value to a php script that handle the serial port?? How to perform to sum of more than one variable??
Regards, Andrea.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 26/08/2010 09:13:20
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
Check out the meta data source.
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 26/08/2010 14:44:58
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Thanks, I'll take a look!!
Regards, Andrea
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 02/09/2010 14:35:53
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Hi, i tried a possible solution:
Meta data do the operation, in my example it's just a sum.
One variable is the sum of 3 other variables refreshing every 15 sec.
The other is the sum of 3 variables with refresh time of 1 minute.
The meta data tags are set to be updated on :
"context update";
"no delay".
I set up a publisher, that invoke a php page served locally on the server that read the variable from the publisher in the url and print them by the serial port to any device!
Php page:
require("php_serial.class.php");
$powernow = $_REQUEST['powernow'];
$energytot = $_REQUEST['energytot'];
$powernow = round($powernow);
$energytot = round($energytot);
//echo curPageURL();
$serial->deviceOpen();
$serial->sendMessage("powernow");
echo "OK - ".$powernow." - ";
$serial->sendMessage("energytot");
echo "OK- ".$energytot." - ";
$serial->deviceClose();
The setup for the publisher is:
http://localhost/grafici/serial.php,
no key, no value.
Just 2 points without timestamp called powernow and energytot.
Update event: All updates.
Everything seems to working fine, but when i set on "Raise result warning" to debug and send "regular snapshot" i got this error:
20:21:50: com.serotonin.web.i18n.LocalizableMessage@a4ee1cd3
20:21:45: com.serotonin.web.i18n.LocalizableMessage@a4ee1cd3
20:21:40: com.serotonin.web.i18n.LocalizableMessage@a4ee1cd3
In addition, often when regular snapshot is off, the publisher send two http request, not just one, and one of the two points is often set to 0.... it seems that's because of the refreshing time is different between the 2 points...publisher send two requests on each context update....but....the really problem is that it send and set the value to 0! Any suggestion? I'm using mando 1.8.4 regards! Andrea
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 02/09/2010 14:40:11
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
For example, i just got this from Alarm:
1376 20:21:55 OK - 0 - OK- 52290 - No RTN
1375 20:21:54 OK - 0 - OK- 52290 - No RTN
1374 20:21:54 OK - 0 - OK- 0 - No RTN
1373 20:21:50 OK - 0 - OK- 52290 - No RTN
1372 20:21:45 OK - 0 - OK- 52290 - No RTN
Andrea.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 02/09/2010 15:21:13
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
I believe this problem:
20:21:50: com.serotonin.web.i18n.LocalizableMessage@a4ee1cd3
... has already been fixed, but i'm not sure in which version.
In addition, often when regular snapshot is off, the publisher send two http request, ...
This is because you are using context update with no delay in your meta point. Context update means that any update in any of the points will cause the script to run and a subsequent update on the meta point. If your points all update within a second, you should use an update delay of perhaps 1 second so that only a single update occurs on the meta point that consolidates all updates in the source points.
I don't know why you are seeing zero values without knowing more about your source points.
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 04/09/2010 04:55:34
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Hi I hope the attached file can help you to understand!
Yes, i belive you about double request on all context update.... but i don't know why 0 value. I checked a lot, and the 0 value is alway when there is a data source update, regular snapshot are always ok.
Same device:
a,b,c refresh 60 sec.
d,e,f refresh 60 sec.
Meta data device:
x = a+b+c
y = d+e+f
Publisher do,on update: x = 1234 y=0 and immediatly after x=1234 y=5678
Snapshot are always: x=1234 y=5678.
Regards, Andrea
| Filename |
config.txt |
Download
|
| Description |
Exported Data source and point |
| Filesize |
24 Kbytes
|
| Downloaded: |
23 time(s) |
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 04/09/2010 17:29:33
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
Are you sure that Energia_TOT_1 should have an offset of 3? Seems to break the pattern.
Also, note that many of the points are using interval logging (not that this is a problem, just a difference from other points).
I imported your config and set up a Modbus test slave, but i never see zero values being reported. Are you sure these values are not actually being returned from your equipment? To be certain, make sure your points are logging either "all" or "on change", and then inspect the point's history and compare with the meta points.
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 10:08:33
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Hi, i checked my modbus device configuration and maybe i found some error.... i'll let you know. If can be interesting, when the project is finished, i can put the final release. I moved from php.serial.class to serproxy, an arduino with lcd, and a php file that open a socket stream to serproxy to output my formatted string. Regards and thank for the time you're spending for my problem. Andrea.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 14:38:25
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Hi... I'm so sorry but there wasn't errors. I however tried to change for a test the offset, but i'm still having 0 on update/changes of the publisher. And the data sources is never 0. What modbus client simulatar did you try? I don't understand where is the problem. I'd like to upgrade to version 1.10, but i'm recording data on mysql database. Am I going to loose all my data?
Thanks in advance, andrea.
| Filename |
config.txt |
Download
|
| Description |
|
| Filesize |
24 Kbytes
|
| Downloaded: |
23 time(s) |
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 06/09/2010 15:47:08
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
You won't lose your data. I used Modbus4J as the slave for testing. If you want advanced support with this issue, please use the Contact Us form.
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 08/09/2010 12:31:29
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
I tried to upgrade to 1.10 release by following site instrunction, maybe it can solve my "0" problem, but i get thie error:
log4j: WARN No appenders could be found for logger (org.springframework.util.classUtils)
log4j: WARN Please initialize the log4j system properly
Every time i go to wath list page... i receive a popup message that say "Error"!
I'm saving data to a mysql database....but on 1.10 release i cannot found ..\webinf\classes\env.proprieties....
Regards, Andrea.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 08/09/2010 13:16:01
|
mlohbihler
Master
![[Avatar]](/forum/images/avatar/eccbc87e4b5ce2fe28308fd9f2a7baf3.png)
Joined: 01/03/2007 22:48:52
Messages: 1456
Offline
|
Did you 1) delete the tomcat "work" directory, and 2) try hitting ctrl+f5 in your browser?
|
Best regards,
Matthew Lohbihler |
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 09/09/2010 01:53:11
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Yes! I can try maybe with a new apache installation. But what about mysql? Best regards, Andrea.
|
|
|
 |
![[Post New]](/forum/templates/default/images/icon_minipost_new.gif) 14/09/2010 06:10:55
|
gomez
Initiate
Joined: 13/07/2010 04:06:20
Messages: 15
Offline
|
Solved! The problem wasn't in Mango ( sorry if i stole you guys a lot of time . It was on php code.... when the publisher publish its data, it publish the value that it's just updated, not all the point declared. The php side $_request didn't found any data and create a variable with 0 value!! With the statement isset() or exits() I think i'll solve the problem!!
In the meanwhile...
1) if i include in a webpage ( i.e. drupal a public view from mango and a "view1.jsp", only one of them is update. In addition, with google chrome after a few seconds, the data from "view1.jsp" disapper.....
2) Is there any other way to get the last update data from mango's point without using the .jsp page? ( i.e. to create my own ajax live chart?
Regards, Andrea.
|
|
|
 |
|
|