Expression refresh times in graphs | ioBridge | Forum

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?
sp_Feed sp_TopicIcon
Expression refresh times in graphs
Avatar
Joeli

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
1
December 23, 2015 - 11:26 am
sp_Permalink sp_Print

Has anybody had issues on refresh times with datalogs that use expression and/or widgets that source from data logs that use expression?
I have tried working with various logs and all with expressions beyond simplistic
Data Logs show graph after about 5 minutes and widgets pulling source from data log never shows but tries to update
If I add the widget to the dashboard it locks the dashboard to various times even though I can access it through the android app.
If I embed the widget in a webpage I get the same type of response.

Joeli
------------------------------------------------------------
Widget based on Data Log

Number of Days: 7

Chart Style: Advanced
Chart Type: Line
Chart Title: Click to update
Y-Axis Label: Click to update
X-Axis Label: Click to update
Y-Axis Scale: Auto

Data Source:

•Data Log - Total Garage Depth in CM
•Log Type - Analog Input Logging Chart

Type: Not Shared
Status: Enabled

Dashboard: +

********
Data Log

Type: Analog Input Logging
Frequency: Every 600 Seconds
Scale: Raw

Expression:
Offset_CM = %%
input:24001803,V2,A%%
Range_CM = %%
input:24001803,AI,4%%
Level_inches = Offset_CM - Range_CM
%%format:0%%

Logging Status:
Enabled

-------------------------
Widget based on Data Log

Number of Days: 7

Chart Style: Advanced
Chart Type: Line
Chart Title: Level Of Water In Garage - Inches Rounded
Y-Axis Label: Click to update
X-Axis Label: Click to update
Y-Axis Scale: Auto

Data Source:

•Data Log - Level Of Water In Garage - Inches Rounded
•Log Type - Analog Input Logging Chart

Type: Not Shared
Status: Enabled

Dashboard: +

********
Data Log

Type: Analog Input Logging
Frequency: Every 600 Seconds
Scale: Raw

Expression:
Offset_CM = %%
input:24001803,V2,A%%
Offset_inches = Offset_CM*0.39370
Range_cm = %%input:24001803,AI,4%%
Range_inches = Range_cm*0.39370
Level_inches = Offset_inches - Range_inches
%%format:0%%

Logging Status:
Enabled

Avatar
Hans
Natick, MA

Forum Posts: 384
sp_UserOfflineSmall Offline
2
December 23, 2015 - 1:28 pm
sp_Permalink sp_Print

Expressions run on every data point of the chart.

The expression that you are using runs on every chart point and gets the latest input from the device. If you change one line, you will get a better result.

Change: Offset_CM = %%
input:24001803,V2,A%%

To: Offset_CM = %%point%%

Let us know if that works for you.

Thanks,
Hans

Avatar
Joeli

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
3
December 23, 2015 - 5:54 pm
sp_Permalink sp_Print sp_EditHistory

Edit

Avatar
Hans
Natick, MA

Forum Posts: 384
sp_UserOfflineSmall Offline
4
December 24, 2015 - 1:02 pm
sp_Permalink sp_Print

I also wanted to note that expressions for a chart should operate on a %%point%% vs reading from the device live. I see two spots that might be causing issues, once with reading the offset and one with reading the range. Is the offset a fixed number? If so, just enter the number into the expression and make the range equal to the %%point%%.

Avatar
Joeli

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
5
December 24, 2015 - 1:15 pm
sp_Permalink sp_Print

Hans,
Thanks for the quick response, if you saw my original response please disregard. I’m not sure what I was thinking when I posted that rubbish….. lol
I changed the line on both data logs as you suggested with erroneous results but I had the code so jumbled it couldn’t work. I removed both widgets and both data logs. I rewrote them from scratch and realized what you were asking me to do on your change request. When I rewrote the data logs and widgets with their original expressions they now populate on the dashboard and external web pages within 20-30 seconds which is more than adequate. I have had these issues before on non expression data logs and their placement on the dashboard. It seems that I need to add them to the dash board and allow the chart to update before adding another chart. What made the data logs with complex (if you want to call it that) expressions different is that they would hang when applying them one at a time but after rewriting them this is not the case ??
Now this is becoming more of a blog than a question. I did find your changes interesting and applied them but noticed it removed the user inputted variable?? Which of course gave me data that didn’t take into account this variable. I had set the variable to simulate a water depth of 48” and my expression shows this but if I replace “Offset_CM = %% input:24001803,V2,A%% “ with “Offset_CM = %%point%%”
It will never pull the variable ???

Here is the script for the variable I mention above

Offset in CM
Module 24001803 / Variable 2-A
Label: Offset in CM
Set Variable Value (Variable):
Module - 24001803
Variable 2 - A

The variable was in place during testing as I need to zero out the sonar depth to tell if it something filled the void. I changed the overall distance several times to check for accuracy. I guess in all reality now it is in its final spot so the variable is a constant. I could hard code this number into the expression but it would still give me a string longer than “Offset_CM = %%point%%” but actually in this case the point or input string would be immaterial as far as the Offset_CM goes. I guess to further tighten it up I could omit Offset_CM all together but for now I’ll leave it in so it could be double checked or chaged to a new value rather easily. Here is the expression showing the Offset as being static and the results are the same as using the variable as it should seeing the variable is 380 so now where would I use the %%Point%%

Offset_CM = 380
Offset_inches = Offset_CM*0.39370
Range_cm = %%input:24001803,AI,4%%
Range_inches = Range_cm*0.39370
Level_inches = Offset_inches - Range_inches
%%format:0%%

I see what you mean about point vs input I just don’t see how to use it with
Scaling Data Logs using Expressions

“Data Logs can be scaled using Expressions. The values in the Data Log are referenced using the %%point%% reference in place of the “input” reference described above. %%point%% refers to all the logged data values while %%input%% references real-time values.”

Here is the back story on these charts
One log is the depth as reported by a Max Sonar –WR (MB7092) which is in a remote location so I can’t trouble shoot this at this time or should I say I can’t change any of these variables from my location.
The other data log takes in account the distance of the same sensor and a user settable set point which is the value reported bringing the value back to zero and it will now measure water depth at the sensor. I can control this by setting a value shorter than it actually is.

Original expressions:
Level Of Water In Garage - Inches Rounded Data Log Expression
Offset_CM = %%input:24001803,V2,A%%
Offset_inches = Offset_CM*0.39370
Range_cm = %%input:24001803,AI,4%%
Range_inches = Range_cm*0.39370
Level_inches = Offset_inches - Range_inches
%%format:0%%

Total Garage Depth in CM Data Log Expression
Offset_CM = %%input:24001803,V2,A%%
Range_CM = %%input:24001803,AI,4%%
Level_inches = Offset_CM - Range_CM
%%format:0%%

Joeli

Avatar
Joeli

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
6
December 24, 2015 - 1:18 pm
sp_Permalink sp_Print

Hans said

I also wanted to note that expressions for a chart should operate on a %%point%% vs reading from the device live. I see two spots that might be causing issues, once with reading the offset and one with reading the range. Is the offset a fixed number? If so, just enter the number into the expression and make the range equal to the %%point%%.

I addressed the offset in the above post so yes that can be hardcoded but the range is what I am logging.
"make the range equal to the %%point%%" Can you expand on this thought?

Joeli

Avatar
Joeli

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
7
December 24, 2015 - 2:45 pm
sp_Permalink sp_Print

I'm starting to feel it Hans...... Thanks for your help.
I will report back speeds.

Range_cm = %%point%%
Level_inches = 149.606 - (Range_cm*0.39370)
%%format:0%%

Laugh
Joeli

Avatar
Joeli

Silver
Forum Posts: 6
sp_UserOfflineSmall Offline
8
December 25, 2015 - 7:39 pm
sp_Permalink sp_Print

That's it Hans
Thank you. Refresh times are instantaneous

Level Of Water In Garage - Inches Rounded Data Log Expression
Original
Offset_CM = %%input:24001803,V2,A%%
Offset_inches = Offset_CM*0.39370
Range_cm = %%input:24001803,AI,4%%
Range_inches = Range_cm*0.39370
Level_inches = Offset_inches - Range_inches
%%format:0%%

New
Range_cm = %%point%%
Level_inches = 102.362 - (Range_cm*0.39370)
%%format:0%%

Total Garage Depth in CM Data Log Expression
Original
Offset_CM = %%input:24001803,V2,A%%
Range_CM = %%input:24001803,AI,4%%
Level_inches = Offset_CM - Range_CM
%%format:0%%

New
Range_CM = %%point%%
Level_inches = 260 - Range_CM
%%format:0%%

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
13 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 241

Vinod: 137

piajola: 71

vespapierre: 63

Adarsh_Murthy: 59

chrisjmears: 54

Newest Members:

MikefromMichigan

mariofel

jbeale1

GauthamPughaz

hellan

spilz

Forum Stats:

Groups: 4

Forums: 17

Topics: 1183

Posts: 4169

 

Member Stats:

Guest Posters: 1

Members: 5442

Moderators: 0

Admins: 2

Administrators: Hans, lee