Creating a sequential task list for temperature ramps with a macro

Creating a sequential task list for temperature ramps with a macro
none 0.0 0
  • HMI Model:CMT3162XV2
  • EasyBuilder Pro Version:Most Current

I need to create a “task list” or schedule a series of tasks to be completed in sequence.

For example:

Task 1: ramp from 100 degrees to 150 degrees over 1 hour.

Task 2: ramp from 150 degrees to 200 degrees over 2 hours.

Task 3: ramp from 200 degrees to 250 degrees over 3 hours.

What is the best HMI function to use to create this kind of task list? I need to be able to input start set point, end set point and ramp time.

Thank You!

1 Like

Hi @leadfoote ,

Thanks for reaching out! We have a couple tools that can help you accomplish this within EBPro:

A Macro may be best for doing the sequencing logic. You can accompany this with Numeric Objects to set and monitor start/end setpoints and ramp degrees.

Some other helpful tools may be:

The Scheduler object in EBPro is designed for calendar-based actions – Ex: turn bit ON/Write word at 8:00 AM every Monday, OFF at 5:00 PM, etc. Here’s a helpful video on the Scheduler Object.

The Action Trigger object is an event-driven object. It performs an action (write value, toggle bit, etc.) when a condition becomes TRUE. Here is a helpful video on the Action Trigger.

1 Like

Thank you for your help! Would it be possible to use the recipe function for this?

@leadfoote ,

Yes, you could use the Recipe Database to store values of say ramp height, time, etc. then use a Macro to trigger the task!

Here’s a quick basics video on our recipe database: https://www.youtube.com/watch?v=I-TorJ4ftBo

Dear DanielDahilig,

Could you please make the Macro program for doing the sequencing logic?

As you know, there are some of Brands already made the temperature controller the same function. (Pattern/Step)

Task 1: ramp from 100 degrees to 150 degrees over 1 hour.

Task 2: ramp from 150 degrees to 200 degrees over 2 hours.

Task 3: ramp from 200 degrees to 250 degrees over 3 hours.

But I think that, the controller of Weintek is best about macro and more function.

Thank you so much!

@cuongho ,

Below is a general example of what I would imagine a ramp sequence would look like. This will vary depending on your project, but just so you get a general idea here is a macro I came up with in office.

macro_command main()

short PERIOD_SEC = 5

// Ramp durations
short TASK1_SEC = 3600
short TASK2_SEC = 7200
short TASK3_SEC = 10800

// Angle setpoints in whole degrees
short ANGLE_START = 100
short ANGLE_1_END = 150
short ANGLE_2_END = 200
short ANGLE_3_END = 250

short profile_step
short elapsed_sec
short start_angle
short end_angle
short duration_sec
short t_eff
int angle_sp
int delta_angle

// Read current sequence state
GetData(profile_step, “Local HMI”, LW, 100, 1)
GetData(elapsed_sec, “Local HMI”, LW, 101, 1)

// Initialize sequence
if profile_step == 0 then
profile_step = 1
elapsed_sec = 0
end if

// Select active task
if profile_step == 1 then
// Task 1: 100 → 150 over 1 hour
start_angle = ANGLE_START
end_angle = ANGLE_1_END
duration_sec = TASK1_SEC

else if profile_step == 2 then
// Task 2: 150 → 200 over 2 hours
start_angle = ANGLE_1_END
end_angle = ANGLE_2_END
duration_sec = TASK2_SEC

else if profile_step == 3 then
// Task 3: 200 → 250 over 3 hours
start_angle = ANGLE_2_END
end_angle = ANGLE_3_END
duration_sec = TASK3_SEC

else
// Sequence finished: hold final angle
angle_sp = ANGLE_3_END
SetData(angle_sp, “Local HMI”, LW, 10, 1)
SetData(profile_step, “Local HMI”, LW, 100, 1)
SetData(elapsed_sec, “Local HMI”, LW, 101, 1)
return
end if

// Advance time by macro period
elapsed_sec = elapsed_sec + PERIOD_SEC

// Clamp effective time
if elapsed_sec < 0 then
t_eff = 0
else if elapsed_sec > duration_sec then
t_eff = duration_sec
else
t_eff = elapsed_sec
end if

// Linear ramp calculation
delta_angle = end_angle - start_angle
angle_sp = start_angle + (delta_angle * t_eff) / duration_sec

// When task completes, snap to endpoint and advance
if elapsed_sec >= duration_sec then
angle_sp = end_angle
elapsed_sec = 0
profile_step = profile_step + 1
end if

// Write outputs
SetData(angle_sp, “Local HMI”, LW, 10, 1) // Current angle setpoint
SetData(profile_step, “Local HMI”, LW, 100, 1) // Current task number
SetData(elapsed_sec, “Local HMI”, LW, 101, 1) // Elapsed time in current task

end macro_command

1 Like