PCSControls Posted May 1, 2012 Report Share Posted May 1, 2012 I'm using the Indirect time function that allows the setting of the ON and OFF times and is TRUE if we are between these times. Is there a method to dispaly the time left between the Current time and Off time ? This is using a V570 and latest Visilogic Quote Link to comment Share on other sites More sharing options...
AlexUT Posted May 3, 2012 Report Share Posted May 3, 2012 Hi. You did not mention OPLC model. Next explanation is for Unitronics Enhanced Vision Series. VisiLogic have no such embedded function. Easiest way is to show remaining time between current RTC (Real Time Clock) HH:MM and indirect off-time HH:MM, when current time is inside on-off interval. But representation of both is different: Indirect time function use HexaDecimal(BCD) format. 12:45 is 0h1245. SI 31 contains RTC current time HH:MM in a Decimal format. 12:45 is 1245. Timer preset contains a number of 10 mSec intervals (ticks). UTC counts in ceconds from pre-defined date. *See UTC help. You need to fill start and stop time in format of RTC, like SI 30 - SI 33 use. Use RTC-to-UTC conversion of start, stop and RTC, you will find remaining time between RTC and off-time in seconds. Then display this remaining time is trivial. B.R. Quote Link to comment Share on other sites More sharing options...
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.