You are not logged in.
Pages: 1
Topic closed
Hi,
Suggestions as to how I can take say the minutes output of the time function block and test it to see if it is even or odd?
Thanks,
Brian H.
Offline
By using the 'IMOD – Remainder after integer division' funion block. Divide by two and if the result is zero then it is even.
(if you need a pulse every 5 minutes then divide theminutes by 5 and check for zero....)
Checking the first bit is also a possibility, if the first bit (value "1") is high then the number is odd. (Bitwise 'AND' with value 0x01, if result is zero then it is odd. Use BITOP block)
Last edited by scoobsalamander (2016-04-10 21:11:19)
Offline
Cool! Thanks.
Brian H.
Offline
Pages: 1
Topic closed