Sign in to follow this  
Followers 0
Joseph 0028

what does this formula do ?

3 posts in this topic

I have the below formula in CPT instruction (not able to attach any pics)... 

IO_Rmc_Data = (IO_Rmc_Data+1) MOD 10

What does MOD 10, MOD 1000, MOD 10000 do ? On help it says it stores the remainder of division, but here its doing something else. 

Share this post


Link to post
Share on other sites

I would assume IO_Rmc_Data is an index for a 10 element array of Data.

The forrmula is creating a repeating 0-9 output. So if when IO_Rmc_Data = 9 , the next time the CPT is executed (IO_Rmc_Data+1) MOD 10, would equate to 10 MOD 10 which = 0

Edited by chelton
rephrase

Share this post


Link to post
Share on other sites
1 hour ago, chelton said:

I would assume IO_Rmc_Data is an index for a 10 element array of Data.

The forrmula is creating a repeating 0-9 output. So if when IO_Rmc_Data = 9 , the next time the CPT is executed (IO_Rmc_Data+1) MOD 10, would equate to 10 MOD 10 which = 0

yes, you are right. Actually IO_Rmc1:O.Data[0] is an array of Real[124], and we have the formula IO_Rmc1:O.Data[0]=(IO_Rmc1:O.Data[0]+1)MOD1000.

So I believe we increment IO_Rmc1:O.Data[0] from 0 to 999 and then repeat ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0