How do I make a basicTE to load 2 objects

How do I make a basicTE to load 2 objects

Stefan13
Not applicable
300 Views
11 Replies
Message 1 of 12

How do I make a basicTE to load 2 objects

Stefan13
Not applicable

[ FlexSim 24.2.0 ]

I have a project with my own elevator made with cinematic and I want to make it to load 2 objects on the turntable, it looks like this 1724827163716.png


On the triggers, I got all this done1724827225924.png

and the On Load code looks like this 1724827292603.png

on top of that I also created a MySurrogate to kinematically define the position where the box will be placed and it's called "MySurrogate1"


And I would like if you can help me to get it to load 2 objects and randomly download them on the transfer points. Varianta_2.fsm

0 Likes
Accepted solutions (1)
301 Views
11 Replies
Replies (11)
Message 2 of 12

moehlmann_fe
Enthusiast
Enthusiast
Accepted solution

This is just a question of giving the TE the proper task sequence. For example by pushing the items to a list and using a Process Flow to loop between loading two items and unloading them.

varianta-2_1.fsm

Though you might need to do some work to adjust the travelled offsets depending on whether the first or second item is loaded/unloaded.

0 Likes
Message 3 of 12

Stefan13
Not applicable

And to place the object on the platen, do I need to add the On Draw trigger? Or should it be modified elsewhere?1724833377719.png

0 Likes
Message 4 of 12

moehlmann_fe
Enthusiast
Enthusiast

I'd use the On Draw trigger as shown in the previous post, yes. Just modify it to loop over all subnodes in a for-loop and place them according to their rank.

0 Likes
Message 5 of 12

Stefan13
Not applicable

1724834993341.png

I tried this and it doesn't work and I get the error exception: FlexScript exception: invalid index at MODEL:/BasicTE1>variables/ondrawtrigger at line 0.


And this is the old code 1724835111635.png



0 Likes
Message 6 of 12

moehlmann_fe
Enthusiast
Enthusiast
You loop 'i' from 0 to 1, so you need to add an offset when assigning the item variable since the subnodes start counting at 1.
Object item = current.subnodes[i+1];
0 Likes
Message 7 of 12

Stefan13
Not applicable

It works, thanks a lot for your help, one more question, now the elevator has a single exit on the left side, in reality it has 2 exits next to each other because there are 2 segments with rollers, how could I make it have two exits so that the boxes go out on both and not translate them to the defined exit? which is now given by MySurrogate??

0 Likes
Message 8 of 12

moehlmann_fe
Enthusiast
Enthusiast
Hm, yeah, I guess you'd need to mark the items somehow as the belonging to the first or second slot, probably by setting a label on entry. That way the second item can continue to be placed on the second section even after the first item is unloaded.
0 Likes
Message 9 of 12

Stefan13
Not applicable

1724844685827.png

Here I'm trying to apply a kinematic and I want to move the first object to the left by translation and it doesn't work

0 Likes
Message 10 of 12

moehlmann_fe
Enthusiast
Enthusiast
You generally need a "Create Kinematics" activity first, if you haven't already initialized a kinematics node.
0 Likes
Message 11 of 12

Stefan13
Not applicable

1724850066164.png

1724850082801.png

1724850099290.png I tried but the token is wearing out and it still won't move my box to the left. Sorry to bother you but this is my first time working with kinematic.Varianta_cu_conveioare.fsm

0 Likes
Message 12 of 12

moehlmann_fe
Enthusiast
Enthusiast

You also have to specify which object the kinematic is supposed to move. And moving the box won't work, because the On Draw will readjust its position.

I don't think you need kinematics anyway. As I said, assigning a label to the items that denotes which slot they belong to and using that information in the On Draw and On Begin Offset triggers is enough to make the TE move as at least I would expect.

varianta-cu-conveioare_1.fsm

0 Likes