question

Robin S avatar image
1 Like"
Robin S asked Joerg Vogel edited

Stop and restart item flow with delayednodefunction

Hi,

I want to stop a flow which is initiated by a queue through taskexecuters. The queue can release items if a condition (parkreihenPlatz()==1) is met. So far it works.

If not (parkreihenPlatz()==0) the flow should stop until the requirement is fulfilled again (e.g. after 300 sec.).

Where and how can I implement delayednodefunction or any other solution? In the flow-tab "Send To Port" or in the tab "Transport Resource"?

At the moment the taskexecuter seems to ignore the "stop" and moves items anyway.

I don't use process flow. Below You can see parts of my code.

Send To Port:

int shortestRow = 1;
if(parkreihenPlatz(shortesRow,item)==0) 
{	
	shortesRow = delayednodefunction(c,300); //This code doesn't work
}
else
	return shortesRow;

Transport Resource:

treenode ts = createemptytasksequence(dispatcher,priority,preempt);
inserttask(ts,TASKTYPE_TRAVELTOLOC,NULL,NULL,loc00.x+2.65,loc00.y,loc00.z,0);
inserttask(ts,TASKTYPE_DELAY,NULL,NULL,15);
inserttask(ts,TASKTYPE_TRAVELTOLOC,NULL,NULL,loc00.x+2.65,loc00.y,loc00.z,0);
inserttask(ts,TASKTYPE_MOVEOBJECT,item,dispatcher);
inserttask(ts,TASKTYPE_SETNODENUM,spatialrz(item),NULL,270);
inserttask(ts,TASKTYPE_BREAK,destination,NULL,1,1,tonum(item));
dispatchtasksequence(ts);
return 0;
FlexSim 17.2.5
waitingdelayednodefunction
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel edited

Typically you can hold an item, if you "return -1;" or you select the template option Do Not Release Item, then you can initiate the releasing again by the command releaseitem(obj. item). If you don't set an output port optionally as the second parameter, the send to port function is executed again where the item is stored or hold.


5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.