question

Kari Payton avatar image
0 Likes"
Kari Payton asked Matthew Gillespie commented

How to reference a crane in a table?

I have a processor that uses a crane for transporting items. The crane is set to use an object by global table lookup. However, I'm having trouble referencing the crane in the global table.

FlexSim 17.1.3
object referencing
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

Matthew Gillespie avatar image
0 Likes"
Matthew Gillespie answered Matthew Gillespie commented

You should just use a table where you set the column to use pointer data. Then you can directly access the value in the table:

Object crane = Table("MyTable")[row][col];

The Object by Global Table Lookup pickoption was designed to get around the fact that, before 17.1, you couldn't store pointers in a table. So you have to put the object's name in the table and then that pickoption searches the model for an object of that name.

· 2
5 |100000

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

Matthew Gillespie avatar image Matthew Gillespie ♦♦ commented ·

That code snippet was purposely very generic because I didn't know how you were using it in your model. For your model you should just directly type this into the Use Transport field:

Table("MyTable")[1][1]

The row and col were placeholders for whatever code you want to put in to specify the row and column values. Also, you don't need to store the reference in a variable since you are just immediately returning it.

1 Like 1 ·
Kari Payton avatar image Kari Payton commented ·

Thanks @Matthew Gillespie I set the column to use pointer data. But when I try to change the use transport to pull from the table using the code snippett, I get an error. I attached sample model for reference. crane-pointer.fsm

0 Likes 0 ·
crane-pointer.fsm (18.0 KiB)