Not really sure where i should post this.
i am having a problem with a memory leak when i run a script for showing the approximate finish time for production run. what seems strange is that the memory increases about every 5 minutes or so and by 4 kb incriments. it goes up about 20 to 100kb and then stops. the memory increases until i get a memory error. i am using Poficy ME 6.0 build 5005
this is the script and it is run on a 5 second timer only when the main panel is open (becouse the line speeds up and down.) the timer bit and the cpm (Cans Per Minute) come from my plc. if anyone has any ideas as to why this is happening or better yet how to correct it i would greatly appreciate it.
if CansPerMinute.value >0 then
AddedTimeToClockForRun.value = (((TotalCanstoRun.value-NumGoodCansRan.Value) / CansPerMinute.value)* 60)
new_daychange.Value = (AddedTimeToClockForRun.value/86400)
set_clock.value = true
end if
IF set_clock.value = true then
new_seconds.Value=dateadd ("S",AddedTimeToClockForRun.value,Now)
new_minutes.value=dateadd ("N",new_minuteschange.value,new_seconds.Value)
new_hours.value=dateadd ("H",new_hourschange.value,new_minutes.VALUE)
new_time.value=right(new_hours.value,11)
END IF
IF set_clock.Value = true THEN
new_day.value=dateadd ("D",new_daychange.value,new_hours.value )
new_month.value=dateadd ("M",new_monthchange.value,new_day.VALUE)
new_year.value=dateadd ("YYYY",new_yearchange.value,new_month.VALUE)
new_date.value=Left(new_year.value,10)
END IF
set_clock.value = false