Jump to content
Sign in to follow this  
PCSControls

Time Remaining HOUR function

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...