Jump to content

Can I Perform Such Calculations?


ElectricCPR

Recommended Posts

Attached is a picture of a calculation that I'd like to use to trigger specific programs. Is it possible? If yes, how? dd78631eb7689b49ee584d5607fb55e6.jpg
 
Sent from my SM-G930T using Tapatalk
 
 

I don't know what 12 A could possibly mean but all basic math is possible in ISY.

For the remainder it is called modulo

$variable %= 12

For the integer of the division use.
$variable /= 12

Sent from my SM-G930W8 using Tapatalk

Link to comment
I don't know what 12 A could possibly mean but all basic math is possible in ISY.

For the remainder it is called modulo

$variable %= 12

For the integer of the division use.
$variable /= 12

Sent from my SM-G930W8 using Tapatalk

As stated in the equation
A=The Jewish Year which this year is 5778

Sent from my SM-G930T using Tapatalk

Link to comment
It's simple algebra pluging in the values to solve the equation. The question is does it work with ISY? If yes how?

 

Sent from my SM-G930T using Tapatalk

 

 

Yes but it would need to be known what the result you want is.

 

5778 what?

 

Did you want the whole number portion and fractional parts in different variables M and m?

 

Will A be changing each year and will it be used again?

 

Sent from my SM-G930W8 using Tapatalk

 

 

 

Link to comment
Yes but it would need to be known what the result you want is. 
5778 what?
 
Did you want the whole number portion and fractional parts in different variables M and m?
 
Will A be changing each year and will it be used again?
 
Sent from my SM-G930W8 using Tapatalk
 
 
 
A will be changing each year

Sent from my SM-G930T using Tapatalk

Link to comment
Here's the other other half of the equation. Sorry.603269b45b7cf53d1e6c1704dbb50ddb.jpg

 

Sent from my SM-G930T using Tapatalk

 

 

 

 

 

I don't have access to my ISY right now but what I would is define a State variable for each variable in the formula.  

Then I would create a program for each variable with a trigger condition for each variable involved in the program like this

 

If

.....$var1 ....or

.... $var2

 

Then

....program to calc that variable

 

Now when any value is changed the programs will self trigger and calculate each result into it's variable in a chain reaction.

 

The decimals will have to set for each variable minding overflow quantities at 32 bit values.

 

Sent from my SM-G930W8 using Tapatalk

 

 

 

 

 

Link to comment
2 hours ago, ElectricCPR said:

How? I tried the remainder function and it doesn't seem to work!

Sent from my SM-G930T using Tapatalk
 

I have had no problem with the modulo operator.

What does "It does not work" mean?". "The answer is always 0"?, "the answer is incorrect"? "The answer never changes from the original quotient"? "The answer is not what I  expected"?

Let's work from there so you can understand how ISY works possibly.

What was your test program. You can right click on your program and use "copy to clipboard"  and then paste it here for more help.

Link to comment

It may take a dozen or so variables and ~20 lines of code but can be done. If some of the values you have in parentheses are true constants then you will want to precalculate them.

Luckily, the formula can be broken down and each operation done easily. God forbid you needed any trigonometry functions or anything more advanced.

The modulo works here:

New Program - [ID 0029][Parent 0010]

If
   - No Conditions - (To add one, press 'Schedule' or 'Condition')
 
Then
        $Int_41  = 18
        $Int_41 %= 4
 
Else
   - No Actions - (To add one, press 'Action')

Result - $Int_41 = 2 (18%4)

Link to comment

I was testing the module not with this equation, but in general. What I'm trying to accomplish is:

If

$Days_Till_RH is 0

And Time is 1:00:00AM

 

Then

Wait 25 hours 

$Jewish_Year += 1

$Jewish_Year Init To $Jewish_Year

Wait 5 seconds



Adjust program Pesach Trigger

PS I just realised that I can't set it to trigger on a specific date if there is a way please let me know

Sent from my SM-G930T using Tapatalk

Link to comment

There are some options to baseline your programs to the actual date:

  • If you want to run the V4 family of ISY Firmware, you can set up the isylink program on an external computer and it can be configured to load month, day and year into separate ISY variables. You can work with that in your program.
     
  • If you are willing to run the V5 family of ISY Firmware, there are enhancements to its admin console and program/variable features to use month, day and year in variables

Paul

Link to comment
  • 1 year later...

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...