Find the position of elevator and TaskExecuter

Find the position of elevator and TaskExecuter

marco_b8
Not applicable
18 Views
6 Replies
Message 1 of 7

Find the position of elevator and TaskExecuter

marco_b8
Not applicable

[ FlexSim 17.2.5 ]

Hi at all.

In my model I have a rack, an elevator and 2 types of task executer (2 shuttle and 2 satellite).

I would like to know how to find the exact position of the task executer when they are not on the ground floor (they can move on x, y - if are on the elevator - and z direction - because the rack can contain more than 1 item on each aisle). This because, based on this information, they have to do different work or going in different way using a "decide" activity.

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

joshua_s
Not applicable
Accepted solution

You can access the objects position using

YourObject.location

which will return the objects x,y,z position. Now there are several things that you might need to do to get the object's location depending on the scenario. If it is part of another object, like you moved it onto the elevator, you need to add it's location to that of the elevators position to get its global position. To reference an object you might need to use this as well so that it recognizes it as an object.

YourObject.as(Object).location
Message 3 of 7

marco_b8
Not applicable

Thanks for your answer Joshua!

There is a method to assign to a variable, ad exemple, the z location using a custom code?

0 Likes
Message 4 of 7

marco_b8
Not applicable

I'm attacching you the model on which I'm working. As you can see, in some "decide" activity I have to send the lift in a particular position. To do this I need to know where it is in that moment.

I hope you can give me a suggestion because I really don't know how to do!!!

10-versione-1.fsm

0 Likes
Message 5 of 7

joshua_s
Not applicable

Can you snapshot which decide activity you want to change?

0 Likes
Message 6 of 7

marco_b8
Not applicable

I would like to change the 2 activity in the red box and change, consequentelly, the two activity that follow them.

decide.png

0 Likes
Message 7 of 7

joshua_s
Not applicable

@Marco B8

for the decide "Is Lift on Sh level?" use

token.lift.as(Object).location.z==token.shuttle2.as(Object).location.z

Then take this same idea and apply it to your other decides, comparing the z locations