question

Marian C avatar image
0 Likes"
Marian C asked Matthew Gillespie edited

How to travel to a flow item xyz location

testmodel.fsmHello all,

I have a small simulation of a receiving area where trucks are unloaded. Every pallet is unloaded into queues (buffers) . Using the OnEntry trigger I set labels to each pallet. The most important label is "Stare" which means that after unloading I don't really know what is inside so I have to make a visual inspection of each pallet. After the visual inspection the label "Stare" goes from 0 to either 1 or 2 ---"1 = full pallet, 2 = mixed pallet, 0 = not checked".

Each pallet that enters any buffer is Pushed to a List.

I need to make Operator 1 travel to each pallet and inspect and then set the "Stare" label to 1 or 2 (30 percent 1 and 70 percent 2).

How can I get Operator 1 to go to each pallet xyz position by using TravelToLocation activity ?

Thank you.

Regards,

FlexSim 19.0.0
travel to locationvector project
testmodel.fsm (1.3 MiB)
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

Regan Blackett avatar image
1 Like"
Regan Blackett answered Logan Gold commented

You should be able to use the project() method as part of the Object class;

So in your Travel to Loc activity for the X Location you could type (this assumes your pallet is the item and you are using the default item label name from a Create Object activity, substitute the label name as needed):

token.item.as(Object).location.project(token.item.up, model()).x

and then do the same for the Y and Z locations.

Basically this means that we are treating the data in the item label as an Object class, asking for its location property and then projecting it's coordinates (specifically the 'x' coordinate) from the Pallet's container (Buffer) to the Model coordinate space.

· 1
5 |100000

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

Logan Gold avatar image Logan Gold ♦♦ commented ·

@Marian C,

The specific code for your model (in the Travel to Loc activity) would be:

token.pulled.as(Object).location.project(token.pulled.up, token.resource.up).x
token.pulled.as(Object).location.project(token.pulled.up, token.resource.up).y

Since the pallets are being pulled off a list and stored on the pulled label. You'll also want to clear the checkbox called Relative in the Travel to Loc activity, because the above code gives you global coordinates in the model and not coordinates that are relative to the Operator.

0 Likes 0 ·