Jump to content

State Variable Math Manipulation


pjjameso

Recommended Posts

Posted

Think the answer is no but thought I would ask the genius bar.... I have a voltage transducer that measures the voltage for both the utility and generator.  I use this to send a text if the power goes out to verify the generator turns on.  Also gives a lower reading to indicate if it is in exercise mode.

The value for 220V is 801 and would like to have it read 220 when all is on spec.  Is there a way to do math functions on state variables?

Posted
Think the answer is no but thought I would ask the genius bar.... I have a voltage transducer that measures the voltage for both the utility and generator.  I use this to send a text if the power goes out to verify the generator turns on.  Also gives a lower reading to indicate if it is in exercise mode.
The value for 220V is 801 and would like to have it read 220 when all is on spec.  Is there a way to do math functions on state variables?
yup

if
$sStatevar is not -99999
then
$tempvar = %sStatevar
$tempvar *= ratio
else
----

You must have v5 to use fractional variables and ratio 230/801


Sent from my SM-G781W using Tapatalk


Posted
29 minutes ago, pjjameso said:

Thank You!

If you want to use the resultant value in a program and be self triggering you need to do your calculations in an Integer variable and then transfer over to a State variable last line to avoid triggering the downstream program with every intermediate result of the calculation process.

Guest
This topic is now closed to further replies.

  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

    • There are no registered users currently online
  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.4k
×
×
  • Create New...