question

Cristian Daniel SG avatar image
0 Likes"
Cristian Daniel SG asked hermione12 commented

How can I change the speed of a transporter and an operator?

Model.fsmhi tech support team. @Ben Wilson @Jörg Vogel @jason.lightfoot


in this model there is a group of operators, with the same speed with load and without product load (each with its respective speed). but I need them to change speed when walking with product and without product. for example: operato1 with load 1 km / h and without load 2km / h; transporter1 with load 2km / h and without load 3 km / h.

How can I change the speed variable?


Thanks in advance

FlexSim 20.1.0
flexsim 20.1.0speed change
model.fsm (50.7 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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered hermione12 commented

Custom Code activity after load or unload: Identify conditionally the class by classobject(..)

Set variable of the taskexecuter (Operator or Transporter) "maxspeed" to a matching speed.

  1. double speed = 3; // transporter empty [m/s]
  2. if(classobject(current) == library().find("?Operator"))
  3. speed = 2; // operator empty [m/s]
  4. token.OAlistador.setVariable("maxspeed",speed);

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