I can get the cell reference by flattening the structure
treenode Bays = getvarnode(Model.find("Rack1"), "bays");
Table newt = Table.query("SELECT $3 AS Cell FROM $1x$2 ORDER BY Cell ASC",
/*$1*/ Bays,
/*$2*/ $iter(1).find("cells"),
/*$3*/ $iter(2).subnodes["loc"].up
);
newt.cloneTo(Table("dump"));
IMPORTANT: I must set a ORDER BY clause after the flattening otherwise the query returns as result <No Data> for all cells.
Flexsim 19.2:
treenode Bays = getvarnode(Model.find("Rack1"), "bays");
Table newt = Table.query("SELECT $4 AS Slot FROM $1x$2x$3 ORDER BY Slot ASC",
/*$1*/ Bays,
/*$2*/ $iter(1).find("levels"),
/*$3*/ $iter(2).find("slots"),
/*$4*/ $iter(3).subnodes["loc"].up );
newt.cloneTo(Table("dump"));
The global table "dump" contains references of every slot in a rack. You can get access by evaluating the Variant of a table cell of "dump" for deeper nodes by the method find(string path) and with the property up for higher nodes.
Storage System all racks since 19.2:
treenode qnode = Model.find("Tools/StorageSystem>variables/storageObjects");
Table t1 = Table.query("SELECT $5 AS Node, $6 AS Slot, $7 AS Level, $8 AS Bay, $9 AS Rack FROM $1x$2x$3x$4"
,qnode
,getvarnode(ownerobject(Model.find($iter(1).value.getPath(model()))),"bays")
,$iter(2).find("levels")
,$iter(3).find("slots")
/*$5 slot node*/ ,$iter(4).subnodes["loc"].up
/*$6 slot num*/ ,$iter(4).subnodes["loc"].up.rank
/*$7 level num*/ ,$iter(3).rank
/*$8 bay num*/ ,$iter(2).rank
/*$9 rack node*/ ,ownerobject($iter(2))
);
t1.cloneTo(Table("dump"));