Joseph 0028 Posted February 24, 2021 Report Posted February 24, 2021 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. Quote
chelton Posted February 24, 2021 Report Posted February 24, 2021 (edited) 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 February 24, 2021 by chelton rephrase Quote
Joseph 0028 Posted February 24, 2021 Author Report Posted February 24, 2021 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 ? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.