Need help in SFC functional flow modification

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.

The value of custom.endtime perspective property is of type Date. currentValue.value in the property change script refers to the value of the custom property. When you do call int() on a Date object it doesn't how how to convert the Date object to a integer.

I think what you wanted to do is reading the custom.step perspective property by self.custom.step

1 Like

Hey Bill.LIu. Thank you for your reply. Now Actually I can able to get the popup and modified the SFC flow as once popup is opened and clicking the Next button only moves to the next stage. Now Where I was struggling is, I need to open the popup only at the end of the each process. I have start time and end time of each process in custom method.
I need a help how can I achevie to open the popup whenever time reach the end time of process.
Example:
Process 1:
Startime:10.00.00
EndTime:10..00.12........So At 10.00.12 I want to open popup
Process 2:
Startime 10.00.12
endtime:10.00.24...so At 100.00.24 I want to open up the popup.

I will have this values of starttime and endtime when process starts.
Starttime and endtime will populate data in custom method.
Kindly helpme on this.