question

Hai L2 avatar image
0 Likes"
Hai L2 asked Hai L2 commented

Tracking operator used on a flow items?

Hi,

I have a 3d model with a dispatcher and multiProcessors. There are 10 named operators assigned to the dispatcher. How can I track which named operator was selected to work on the flow item?

Thanks,

Hai

FlexSim 20.1.2
flexsim 20.1.2
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

·
Parker S avatar image
0 Likes"
Parker S answered Hai L2 commented

@Hai L2

You can do this in an On Receive Task Sequence on the operator. This is the custom code which calls the item using taskSequence.tasks[4].involved1

Object current = ownerobject(c);
TaskSequence taskSequence = param(1);
Object item = taskSequence.tasks[4].involved1;

{ // ************* PickOption Start ************* //
/***popup:SetLabel*/
/**Set Label on Item*/
Object object = /**\nObject: *//***tag:object*//**/item/**/;
string labelname = /**\nLabel: *//***tag:label*//**/"Operator"/**/;
Variant value = /**\nValue: *//***tag:value*//**/current/**/;
object.labels.assert(labelname).value = value;
} // ******* PickOption End ******* //

Here's a sample model:

operatorlabels.fsm


operatorlabels.fsm (41.9 KiB)
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

Note that everything inside the pickoption Start and End equates to one line:

item.labels.assert("Operator").value=current;

so you could just have that as your 4th line and remove all the PickOptions stuff. All the extra special characters and phrases in the pick option section are so you can use the pop-up template gui - but unfortunately they make the code look difficult, which it isn't.

Also note that this assumes the tasksequence is a standard structure - if you have a custom sequence where the 4th task's involved1 is not the item, it will not work.


1 Like 1 ·
Hai L2 avatar image Hai L2 Jason Lightfoot ♦ commented ·

That is much cleaner.. Thank you!

0 Likes 0 ·
Hai L2 avatar image Hai L2 commented ·

I will give that a try. Thanks!

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.