question

Donghuang L3 avatar image
1 Like"
Donghuang L3 asked Donghuang L3 commented

Directly move an item to/from the conveyor through codes or process flows

Hi, I am building a model that automatically generates objects through user command codes. I need to implement a process that moves a box item from an arbitrary non-conveyor location to a conveyor, and also from a conveyor to an arbitrary non-conveyor location.

I realized that it requires Conveyor Transfer objects for the item to enter/exit the conveyor. However, because I am auto-generating the model, the Conveyor Transfer objects cannot be created through codes.

Is there a way that I can directly move an item to/from the conveyor through codes or process flows --- preferably without creating Conveyor Transfers? (E.g., a single command like transfernodeobj)

FlexSim 22.2.2
conveyorconveyor transfer
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 Donghuang L3 commented

You can stop an object on a conveyor and move it off without a transfer - the point is it should have no events scheduled when you remove it.

You can also use a single transfer (side transfer along the length of the conveyor) to put any item onto a conveyor at any position (you just need to set the x location when you move it).


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

Donghuang L3 avatar image Donghuang L3 commented ·
Thank you Jason. Is there any way to create a Conveyor Transfer to a conveyor just by codes? (e.g., by createinstance(), without connecting the conveyor to another other object)
0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Donghuang L3 commented ·

Yes but uses a function_s call that might not be supported in the future, so put it in a user command rather than littering your mode with function_s calls.

This code will also size the transfer to the whole length of the conveyor:

Conveyor conv=Model.find("StraightConveyor1");
Object transfer=function_s(conv,"addEntryTransfer");  //or create, connect and destroy a queue
double convlen=conv.getProperty("HorizontalLength");
treenode convPoint=transfer.find(">variables/transferPoint/1+");
setsdtvalue(convPoint,"isAtSide",1);
setsdtvalue(convPoint,"distAlong",convlen/2);
setsdtvalue(convPoint,"rangeWidth",convlen);
setsdtvalue(convPoint,"distOffCenter",-0.5);
function_s(conv,"finalizeSpatialChanges");
0 Likes 0 ·
Donghuang L3 avatar image Donghuang L3 Jason Lightfoot ♦♦ commented ·
Thank you Jason -- just tested this approach and it works great.

(Hope it will still be available through function_s or alternative approaches in future versions)

0 Likes 0 ·