Cancel
Showing results for 
Search instead for 
Did you mean: 

Assign ProcTime formula via method

Creator
Creator

Hi,

 

in my model I have many subframes/stations which inherit e.g. their Init-method. Some of these stations belong to a production area  called "Testing Line". This information is stored in the variable vProductionArea inside the subframe.

 

In these stations, I want to assign the method mProcessingTime to all objects of SingleProc, ParallelProc, Assembly as the formula for processing time. However, I couldn't find a way to do this.

 

if assignedProductionArea /= "station not found"
	vProductionArea := assignedProductionArea
	
	switch assignedProductionArea
	--different cases ....
		
	--Assign mProcessingTime as Formula to Testing Line
	case "TL A", "TL B", "TL C", etc.
		var station : object
		for var i := 1 to current.numNodes
			station := current.node(i)
			if station.typeOf(.MaterialFlow.SingleProc) or station.typeOf(.MaterialFlow.ParallelProc) or station.typeOf(.MaterialFlow.Assembly)
				--set proctimectrl to mProcessingTime
				station.xxxx := mProcessingTime
			end
		next
	
	else --do sth else
	end
end

 

I couldn't find any other related attribute to change, so I am wondering if there actually is no way to assign this via method?

 

Thanks a lot in advance!

 

 

Edit: The first version of this posting stated that the Compiler wouldn't complain about station.procTime := mProcessingTime, however I realized that I nullified that error within my ErrorHandler. Corrected the posting.

2 REPLIES

Re: Assign ProcTime formula via method

Siemens Phenom Siemens Phenom
Siemens Phenom
Something like:
Station.ProcTime.setParam("Formula", "1+2")
_________________________________________________________________
Did you like the answer? Then click the Thumbs Up button.
Did the answer solve your problem? Then accept the answer as solution.

Re: Assign ProcTime formula via method

Creator
Creator

Perfect.  

 

station.procTime.setParam("Formula", "mProcessingTime")

 

does the job. Thanks!