question

dougdurbin avatar image
0 Likes"
dougdurbin asked Jason Lightfoot commented

Conveyor Speed in Process Flow

I'm looking at the question asked here: https://answers.flexsim.com/questions/36162/can-you-set-the-speed-of-a-conveyor-from-processfl.html

In the attached model I'm trying to figure out a way to change the conveyor speed through the process flow using:

Table GlobalTable = reftable("GlobalTable"); conveyorsetspeed(conveyor, GlobalTable[rownum][colnum]);//setting speed of a conveyor from a global table cell value

In my model I'm trying to use the custom code activity at the top of After Punch Press process flow labeled "Change Conveyor Speed":

Table GlobalTable = reftable("Conveyor Speed"); conveyorsetspeed(Group("Station 1 Conveyors"), GlobalTable[1][1]);//setting speed of a conveyor from a global table cell value

It seems like it's not overwriting the speed under "Conveyor Behavior" in the properties tab. Is there a better way to do this in a process flow?

Manufacturing Model.fsm

FlexSim 21.0.1
process flowconveyorflexsim 21.0.1speed
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 Jason Lightfoot commented

manufacturing-model_convSpeed.fsm

Doug, there was no Custom Code activity called "Change Conveyor Speed" in the model you uploaded that I could see.

The best thing might be to get an array of the conveyors using an "Assign Labels" activity where the expression is Group("Station 1 Conveyors).toFlatArray(), and then call a subtask that creates a token for each conveyor using token.conveyors.length as the quantity and token.conveyors[creationRank] as the value of the Conveyor label. The in the subflow you can use the standard pick option for settting a conveyor speed which sets the 'targetSpeed' attribute (conveyorsetspeed is deprecated).

I've attached an example in your model that does this at time zero reading from your Global Table.



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

dougdurbin avatar image dougdurbin commented ·

I must have taken out the code before I saved and before I attached here. Are the speed units based off of the model settings or are they based off the speed units representation under "Conveyor Behavior"? I assume this code overwrites the conveyor speed on reset?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ dougdurbin commented ·
Setting the targetSpeed of the conveyor is done in units consistent with the model settings - not the Conveyor Behaviour. The speed value and units on the conveyor behaviour is used to set the value on reset.
1 Like 1 ·

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.