question

TomasAE avatar image
0 Likes"
TomasAE asked TomasAE commented

Combiner Logic

Hi,

I'm having some difficulties with combiner logic. I'm trying to make the combiner only combine the same type of product. I found some code here on the forum that uses pull strategy, but it doesn't combine the same type. Maybe I'm not using it right, coding is not my strongest area. Does anyone have a solution for this?

Thanks in advance :)

Combiner.fsm

FlexSim 20.0.10
combiner itemtype
combiner.fsm (26.5 KiB)
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

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered TomasAE commented

Large parts of that code are deprecated. The important bit is that in earlier versions an item's "type" was an inherent value to the flow item, whereas now, the type is represented as a label (potentially one of many) on the item. "getitemtype()" tries to read that previous inherent value and returns 0 because that value isn't set/doesn't exist. (Not sure if it could still be set in this version)

In the attached model I updated the code to use current syntax (labels accessed through dot-syntax and use of subnodes to reference items within other objects, instead of rank() and content(), though those still work).

combiner_1.fsm


combiner-1.fsm (26.7 KiB)
· 1
5 |100000

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

TomasAE avatar image TomasAE commented ·

Works perfectly, thank you Felix

0 Likes 0 ·