question

Thomas H3 avatar image
1 Like"
Thomas H3 asked Joshua S commented

Split item based on multiple labels

split-based-on-multiple-labels.fsmModel description:

My line produces parts in batches of 100 items.
Multiple processors in line that produce parts and based on yield generate NOK parts and OK parts. To reduce computing power 1 flow item represents 100. At the end of the line I want to split the NOK items into the NOK box at the machine. At each processor I have code that asserts two labels, one for the amount of OK parts are remaining and one for the amount of NOK parts created at that process step.

So at the separator I receive a flowitem that has for instance the labels: OrderSize =100, OK = 83, NOK_Processor1 = 6, NOK_Processor2 = 11.

Now I want the separator to split that 1 item into 83 OK, 6 NOK_Processor1 and 11 NOK_Processor2.

The 3 different components need to send to different sink nodes afterwards.

Can anyone help with this?

FlexSim 17.1.6
split item flow based on quantitysplit based on recipe
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

Joshua S avatar image
0 Likes"
Joshua S answered Joshua S commented

Is this what you are looking for? I disconnected the sinks, then created a certain amount of objects based on the label into each sink specified by the label. 12616-split-based-on-multiple-labels.fsm


· 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.

Thomas H3 avatar image Thomas H3 commented ·

Hi Joshua,

Thanks for your reply!

The process flow solution gets the job done, however in my model I have additional labels on my flowitem (approximately 125 in total), which i do not want deleted. Is there a way to append the labels of the item to be splitted to the OK item?

Do you perhaps also have a solution that does not make use of the Process flow functionality?

Something I tried was to not have the process flow create the OK items, but let the separator take care of this based on the OK label, however this gives me the following error for each item processed:

  • time: 644615.052902 exception: Exception Caught in FixedResource::getItemInfo(treenode flowitem)
  • time: 644615.052902 exception: Exception Caught in FixedResource::setItemState(treenode flowitem, int state)
  • time: 644615.052902 exception: Exception Caught in FixedResource::releaseItem(treenode item) object: /WIP_PA
  • time: 644615.052902 exception: Exception Caught in Rack::onTimerEvent(treenode involved, int code, char *datastr) object: /WIP_PA
  • time: 644615.052902 exception: Exception Caught in ObjectFunction251__project_library_FlexSimObject_behaviour_eventfunctions_OnTimerEvent object: /WIP_PA class: /WIP_PA
  • time: 644615.052902 exception: Exception caught in TreeNode::receivemessage()
  • time: 644615.052902 exception: Exception caught in Executive::processeventinlist(). Throwing.
  • time: 644615.052902 exception: Exception caught in Executive::steptotime(). Throwing.
  • time: 644615.052902 exception: Exception caught in Executive::tick(). Throwing.
  • time: 644615.052902 exception: int runthemessageloop() #4 exception: Executive::instance.tick();
  • time: 644615.052902 exception: int runthemessageloop() #6

WIP_PA is the rack to which I am sending my OK parts. (in the example model this is the sink OK

0 Likes 0 ·
Joshua S avatar image Joshua S Thomas H3 commented ·

@Thomas H3

Process Flow will be a big advantage with this model, and with many future projects you may have. Why I say this is to accomplish what you want you would need to write several lines of code to accomplish what a few drag and drop activities in process flow can do. I can still help you with the code part, but I'm a little confused as to why you want all those labels to stay on the items since they are going directly to a sink and being destroyed. Also a separator will only split items that it has, it doesn't create new items, and in your case I don't necessarily see the reason for your separator object besides using it as a basic processor.

0 Likes 0 ·