question

kaka avatar image
0 Likes"
kaka asked kaka answered

esthetic forklift

hello,

I want to produce an esthetic effect: I want the fork of the forklift to elevate the product to Z = 5m after loading it.

How can I acheive that using codescript in processflow.

Thank you

1722146892660.pngesthetic-forklift.fsm


FlexSim 24.2.0
forklift simulation
1722146892660.png (244.1 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.

Paula LG avatar image
2 Likes"
Paula LG answered

Hi,

To do so, the easiest way I could think of is as follows:

1722239985376.png

Essentially, the logic operates by changing some variables of the transporter.

The first custom code sets the "forkbegintime" variable to the current time, and the "forkdestheight" one to 5 (since we want the item to be lifted until it reaches 5m high). It also creates a label on the token called "liftTime" which represents the calculated time it will take the forklift to elevate the product to such height.

After that, you need to add a delay task for the token to respect this elevation time and not continue to further activities before it finishes; the delay time will be token.liftTime.

Lastly, I have added another custom code which sets the "forkdestheight" variable to 5 again, because after the lifting movement is finished FlexSim automatically updates "forkinitialheight" to 5 and "forkdestheight" to its default value, making the forklift lower its fork again when the travel activity starts. You can remove both activities (Breathe + Act fork height) if you want the behavior described, or preserve them if you want the transporter to travel with the product elevated.

I hope it helps!

esthetic-forklift.fsm


5 |100000

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

kaka avatar image
0 Likes"
kaka answered

Thank you @Paula LG


5 |100000

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