I am working with "Recipe Management Exchange project" available in ignition exchange, I need to do modification in that project.
Let me explain the flow, It has two function, F1 and F2.
F1 function will flow from one step to next according to the time what we are given
F2 will work as, a pop up will come, I need to enter text and confirm so it will move to next step.
What I need is, I want F1 function to run for given time like 15 secs, when 15 secs ends, one pop up should come and in that I need to give "OK" to move on next stage.
custom.starttime= Time process started.
custom.endtime = Time in which each process ends.
What I have Tired,
I have tired to implement, change script in custom.endtime , but throws the error as "It should be in INT/STRING not in DATE".
if currentValue.value is not None:
#open the step 7 popup if the chart is running.
if self.custom.function==3 and self.custom.currentID is not None and self.custom.currentID!="":
step=int(currentValue.value)+1
id=self.custom.currentID
stepdescipt=self.custom.data[currentValue.value].step_descrip
system.perspective.openPopup("F7Popup",'Exchange/SFC Recipe Handler/F7 Popup', params = {'name':stepdescipt,'step':step,'id':id},title="Function 7", showCloseIcon = True, resizable = True, draggable=True, modal=True)
Codes in SFC Startup for function-1:
p1=int(chart.param1)
p2=int(chart.param2)
p3=int(chart.param3)
#check time in step that has been paused and what happens during a pause
StepStartTime=chart.stepStartTime
pause=chart.stepTotalPause
pauseAction=chart.pauseAction
#add all "times" together"
StepStartTime=system.date.addSeconds(StepStartTime,pause)
timePlusHours=system.date.addHours(StepStartTime,p1)
timePlusMinutes=system.date.addMinutes(timePlusHours,p2)
endTime=system.date.addSeconds(timePlusMinutes,p3)
nowTime=system.date.now()
# system.perspective.openPopup("F7Popup","Exchange/SFC Recipe Handler/F7 Popup" , showCloseIcon = True, resizable = True, draggable=True, modal=True)
#check if now is after added time
if system.date.isAfter(nowTime, endTime):
## system.perspective.openPopup("F7Popup","Exchange/SFC Recipe Handler/F7 Popup" , showCloseIcon = True, resizable = True, draggable=True, modal=True)
chart.stepComplete=True
chart.estEndTime=endTime
Code in FUNCTION-2:
if chart.writeString is not None:
tagPath=chart.targetPath1
system.tag.writeBlocking([tagPath], [chart.writeString])
val=system.tag.readBlocking([tagPath])[0].value
if val==chart.writeString:
chart.stepComplete=True
if chart.f7Message==False:
chart.f7Message=True
I know it was bit unclear and lengthy one. Ready to explain more clearly if need, Trying to achieve this for past one day,but not able to do. Kindly help me to achieve this.