How to create a dynamic scheduler on HMI

How to create a dynamic scheduler on HMI
none 0.0 0
  • HMI Model: cMT 2078X
  • EasyBuilder Pro Version: V6.10.01.510

Dear Sir

I want to make the scheduler to on/off machine.

The scheduler use address LW to set up timer for on/off. It is good operation.

But I am facing problem that when the the power of HMI turn off and turn on again.

Then every previous setting on this scheduler were lost. HMI can not save and remember that old setting.

I have tried to use RW address but the scheduler is not operation.

Could you please give me some your recommendation?

How to create the scheduler on HMI which can remember old setting. Whether the power supply was off and on again.

Thank you so much!

Hi @cuongho ,

Thank you for your question. Could you send us images of what your scheduler looks like and what settings are being reset.

Using a scheduler to turn a timer on and off is a very possible operation and is a good use case to set up. To save the values we would recommend using a data sampling object to track values like elapsed time.

Here is resource about timers that may provide some assistance: LINK

We look forward to your response.

1 Like

Hi @cuongho,

We would recommend using RW addresses to retain your set schedule through power cycle. However, please note that the HMI saves data within RW memory every minute. So, if you set data within RW memory and then immediately power cycle the unit, the latest data may not save if it doesn’t complete the 1 minute cycle. To force data to save immediately you can turn on LW-9029 momentarily to force the data to save when making changes.

2 Likes

Dear Brendon.S

Thank you. so much

I have tried to use RW addresses in my Scheduler already.

But this Scheduler is not operation when I use RW addresses.

I don’t understand what’s happen. Are RW addresses compatible with Scheduler?

Although, with the same Scheduler object, I have used LW addresses. The scheduler is good operation.

  • For LW addresses, after setting up time and press “Update setting” button then “Time acquisition complete” is light up (signal ON). The scheduler is good operation.
  • For RW addresses, after setting up time and press “Update setting” button then “Time acquisition complete” is not any changes. The scheduler is not operation.

It is different between LW and RW.

Some picture for my setting parameter:

Please share me more support.

If possible, could you please send me demo project file which is used with RW addresses and LW-9029.

Thank again!

Hi @cuongho ,

I noticed in your address tags that your End Time Week – Sun, along with the other days of the week, were set to RW_Bit-700. This points to bit 0 of RW 70. Could you remove the extra 0 and instead use RW_Bit-70, RW_Bit-71, and so on? Please test this and let me know if it resolves the issue.

Thank you

Address format for RW_Bits

1 Like

Dear Aaron.S

I have adjusted address as your instruction. My scheduler with RW memory is good operation.

I have new case, with this scheduler, I only can set fix time (hour - minute) for 7 days per week. But now, I want to set individual time for everyday per week.

For example, It mean:

Monday - Time On 07:00 / Time Off 17:00

Tuesday - Time On 06: 30 / Time Off 16:30

Wednesday - Time On: 08:00 / Time Off 18:00

……………………………………………………………………………………………..

Continuous to Sunday

Could you give me your solution?

Thank you so much,

Hi @cuongho,

We would recommend setting up a scheduler for each day of the week. Each schedule sets up the start and end time for each day. You can set it up as a constant or use addresses for a dynamic approach within the time set.

Please let us know if you have any questions.

1 Like

Dear Aaron.S

I understand your ideal.

But I think that it is not flexible to adjust time. It need to use EasyBuilder Pro to modify and download.

This solution is not suitable for my project.

I need to adjust time for individual day. And this adjusting must be indicated on HMI to operator can set every times, very days.

This is my expectation.

If can not use Scheduler Object, could you please give me code of Macro program to perform it?

Thank you so much!

@cuongho ,

The Scheduler object in EasyBuilder Pro has an “Address" option which can be used to make the scheduler have a dynamic time set by the user. However, I do believe a macro would allow for the most flexibility.

My suggestion would be to store per-day ON/OFF times in RW memory, which can be editable by the operator on the HMI.

Then, use a macro to check the current day and time, and output your project needs. Here is an example:

macro_command main()

short day
short hour, minute
short nowTime
short onTime, offTime
short outVal

// Get current day (0=Sun, 1=Mon, 2=Tues, etc.)
GetData(day, "Local HMI", LW, 9020, 1)

// Get current time
GetData(hour,  "Local HMI", LW, 9019, 1)
GetData(minute,"Local HMI", LW, 9011, 1)
nowTime = hour * 100 + minute

// Map RW addresses based on day
Select Case day

  Case 1   // Monday
    GetData(onTime,  "Local HMI", RW, 0,  1)
    GetData(offTime, "Local HMI", RW, 1,  1)
    break

  Case 2   // Tuesday
    GetData(onTime,  "Local HMI", RW, 2,  1)
    GetData(offTime, "Local HMI", RW, 3,  1)
    break

  Case 3   // Wednesday
    GetData(onTime,  "Local HMI", RW, 4,  1)
    GetData(offTime, "Local HMI", RW, 5,  1)
    break

  Case 4   // Thursday
    GetData(onTime,  "Local HMI", RW, 6,  1)
    GetData(offTime, "Local HMI", RW, 7,  1)
    break

  Case 5   // Friday
    GetData(onTime,  "Local HMI", RW, 8,  1)
    GetData(offTime, "Local HMI", RW, 9,  1)
    break

  Case 6   // Saturday
    GetData(onTime,  "Local HMI", RW, 10, 1)
    GetData(offTime, "Local HMI", RW, 11, 1)
    break

  Case 0   // Sunday
    GetData(onTime,  "Local HMI", RW, 12, 1)
    GetData(offTime, "Local HMI", RW, 13, 1)
    break

End Select

// Compare time and control output
if (nowTime >= onTime) and (nowTime < offTime) then
  outVal = 1   // ON
else
  outVal = 0   // OFF
end if

// Write the result
SetData(outVal, "Local HMI", LW, 100, 1)

end macro_command
1 Like