ledbelly2142 Posted September 4, 2013 Share Posted September 4, 2013 I am trying to use display the history of an existing channel with an expression and can't get the syntax correct. I have a channe "mychan" that I want to divide by 4 and show the history with the expression. The General Math Functions and Operations help file indicates that the math.divide() function will work with arrays. Unlike the "Math" function that will not work with arrays. Here is what I have tried in the trend graph expression: math.divide(mychan()/4) math(mychan()/4) and some others with and without the ";" at the end of the expression The channel "mychan" will display it's historical array in the trend graph by itself, just not with any math expression added to it. I can display the instant changing numerical value with a simple expression: mychan()/4, but does not work with historical data points (array). What should the expression syntax be with in order to show a math expression with historical data? Thanks Link to comment Share on other sites More sharing options...
AzeoTech Posted September 4, 2013 Share Posted September 4, 2013 math.divide is a function with two properties, so the syntax is: math.divide(mychan(), 4) doing: math.divide(mychan()/4) uses the javascript operator first before the DAQConnect specific math.divide() even gets the value. Link to comment Share on other sites More sharing options...
ledbelly2142 Posted September 4, 2013 Author Share Posted September 4, 2013 That did it, thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.