question

Leo L6 avatar image
0 Likes"
Leo L6 asked Felix Möhlmann commented

Code to Release/Acquire Conveyor Restricted area

Hi,

How do I release and acquire a restricted area with code in the process flow? I know I could use a zone for this, but I think it'd be simpler if I could instead use a piece of code to refer directly to a decision point and either acquire/release a restricted area from it.

Thanks

FlexSim 22.0.11
conveyordecision points
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

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Felix Möhlmann commented

Do you mean there's a capacity to send a certain number of items to a decision point? Or even to multiple decision points?

One way is to push the decision point(s) to a list multiple times (make sure you uncheck Unique Values on the List properties) and then pull them as needed before sending them to the pulled DP. When continuing from the DP's restricted area push the DP back onto the list.

· 3
5 |100000

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

Felix Möhlmann avatar image Felix Möhlmann commented ·

You could also just copy the code from the decision point trigger options and provide the necessary references (marked below) through other means (such as labels on the token).

If you have a reference to the decision point, you can access the corresponding conveyor through "DP.as(Conveyor.DecisionPoint).conveyor".

1678439176794.png

The "owner" can theoretically be any object. By default the downstream object of the decision point is used.

Jason's suggestion is good when the Process Flow is the only entity exerting any control pver the conveyor system.

But if you want to interact with the area restriction that also gets used in the 3D model, then copying the code might be easier, since otherwise the synchronization between the two systems would add more work.

1 Like 1 ·
1678439176794.png (33.1 KiB)
Leo L6 avatar image Leo L6 Felix Möhlmann commented ·

Thanks a lot Felix. Yes this is what I was looking for. What about release restricted area? It's slightly different and I'm unfamiliar with what "c" references in the trigger code:1678485884961.png

What shall I use as a decision point reference?

Thanks in advance

0 Likes 0 ·
1678485884961.png (30.3 KiB)
Felix Möhlmann avatar image Felix Möhlmann Leo L6 commented ·
"c" is the node that contains the code. So "ownerobject(c)" is the object the code is defined on (the decision point or in the case of a Process Flow activity it would point to the activity). "delayednodefunction(c, ...)" executes the same code again after a delay time. You would leave this as is.

I don't know your model, so I can't tell you how to reference the decision point. Generally I would assume that a Wait for Event activity or Event Triggered Source listens to an event on the DP (or a group of points) and that you could get a reference that way.

Note that if you paste this code into a custom code activity, you shouldn't overwrite the variable definitions in the first few lines with those from the trigger. I only included those in the screenshot to show what variables you have to provide for the code to function.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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