question

John Ceird avatar image
0 Likes"
John Ceird asked John Ceird commented

How do I remove pallets from my assembly after they have finished unloading?

Hi,

I wanted to know how I can remove pallets after an operator has moved all the boxes off it?

I've tried an exitTrigger, but I don't think the code is correct?


treenode pallet = param(1);

int boxCount = pallet.getLabel("BoxCount");

pallet.setLabel("BoxCount", boxCount - 1);


Please find attached the model.


Thanks,

John C

FlexSim 24.2.2
queuepalletexit trigger
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

@John Ceird, If I am trying to program a source code I look into a reference manual to find syntax, properties and methodes. It is not so, that I imagine what would fit and then I am convinced it will succeed. Using an undeclared local variable is not a good style. Using deprecated commands like getlabel is not a good style. You find the reference manual here. Please look into table of content on the right. There are some chapters dealing with your problems.

item.BoxCount -=1;
if (item.BoxCount == 0) {
    moveobject(item, current.as(Object).outObjects[1]);
}
1 Like 1 ·
John Ceird avatar image John Ceird Joerg Vogel commented ·

Hi Joerg, Thank you very much for helping me understand, and for providing advice on how to code better, that helps so much, thank you.

0 Likes 0 ·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered John Ceird commented

@John Ceird, This model replaces for queues standard transport 3D logic by an on message driven source code logic. It sends items by own created and dispatched tasksequences from a packed container item to a combiner. When the conatiner gets empty it releases the pallet (still as an item) by default transport mechanism to the object connected at an output port number in round robin setup. Because there is only a single output port and so it is always output port number one. If you want to let the pallet being transported to a diffenrent object you can connect the queue instead of to a combiner to a different object. This adjustment won't change anyhing in your unpack logic because the referenced destination is declared by a centerport connection.

I changed Queue11 On Message source code:

jc-flexsim-operator-issue-JV.fsm

I erased the unloadmore structure, because it will destroy the mechanism to unload the pallet completely. Or you have to find a different destination at output ports of Queue11 in your original model to let the partly unloaded pallet being transported to somewhere else. In attached model it would be sent to a sink.

Variable unloadmore values make sense with values of 1 or 2. A value of 1 unloads more, a value of 2 will result in a transport of the pallet to an connected output port of Queue11. Or you have to write a source code for a case 0, otherwise default case acts as an interrupt of unloading mechanism.


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

John Ceird avatar image John Ceird commented ·
Hi Joerg, thank you so much for explaining it, it makes sense now, and I am able to run the model without issues.
0 Likes 0 ·
David Seo avatar image
0 Likes"
David Seo answered John Ceird commented

@John Ceird

You should move the pallet into ourput port #1 like combiner's input #1 port when assemblying.

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

John Ceird avatar image John Ceird commented ·
@David Seo yes, I've done that now with Joerg's modifed code, which ensures it runs smoothly. Thanks
0 Likes 0 ·