Create kinematic for flowitem while loading or unloading

Create kinematic for flowitem while loading or unloading

K_yun
Not applicable
31 Views
6 Replies
Message 1 of 7

Create kinematic for flowitem while loading or unloading

K_yun
Not applicable

[ FlexSim 21.1.2 ]

load item smoothly.fsm

1644823212631.png

snipaste-2022-02-14-15-21-30.png

Target: Create kinematic for flowitem while loading/unloading.

Problem: I have created kinematic for flowitem by coding in "On Begin Offset" and "On Update Offset", but it won't move in visual. Can't figure out the error.

And by the way, how to implement this by PF?

0 Likes
Accepted solutions (1)
32 Views
6 Replies
Replies (6)
Message 2 of 7

joerg_vogel_HsH
Mentor
Mentor

Have you set an update in a drawtrigger? And do you call on kinematic finish time a final update? Typically you get an event for final update by a delayed message.

0 Likes
Message 3 of 7

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

You have a spelling mistake in the update offset trigger's label name.

You should add an onPreDraw trigger and leave it empty to get the offset update to fire.

Also you'll need to move the item from the conveyor in order to have the update offset code free from competing conveyor drawing logic. This snippet moves the item into the model and then restores its position so it appears to start moving from it's original location:

Vec3 absloc=item.location.project(item.up,model());
moveobject(item,model());
item.location=absloc;

You'll need to add the TE as a member instance of the process flow if you want to use that technique instead.

0 Likes
Message 4 of 7

K_yun
Not applicable

Thanks for your reply. It works well and I have modified my model. As shown in the new model i just upload, something wrong with the location when the te load the item from conveyor after execute kinematic, though i did set the location in te's "OnLoad" trigger.snipaste-2022-02-15-14-59-21.pngsnipaste-2022-02-15-15-00-15.pngload item smoothly.fsm

0 Likes
Message 5 of 7

K_yun
Not applicable
You mean a beginoffset trigger and a updateoffset trigger are not enough, additionally, a drawtrigger and a onmessagetrigger are also needed?
0 Likes
Message 6 of 7

moehlmann_fe
Observer
Observer

Seems like a bug with the "Finish Kinematics" activity not working properly. If I use "deactivatekinematics()" in a custom code activity it works as expected.

load-item-smoothly(2).fsm

0 Likes
Message 7 of 7

K_yun
Not applicable

Yeah, this can work. And the parameter passed in the deactivatekinematics function must be "token.labels["kinematics"]", rather than "token.kinematics".

0 Likes