question

Axel Kohonen avatar image
1 Like"
Axel Kohonen asked Matthew Gillespie commented

What is the best way of getting the input object of a conveyor?

Hi,

How does one access the objects connected upstream of a conveyor? With the previous conveyor library one could use inobject, but how do you do it with then new conveyor library? Inobject from Sink5 gives the exit transfer, but the transfer does not have any input connections defined.

For example: How do you do if you want to get a reference to Queue6 when the item enters Sink5 in the attached image below?

Thank you!

Kind regards,

Axel

FlexSim 16.0.1
conveyorinobject
fueld.png (13.3 KiB)
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

jing.c avatar image
2 Likes"
jing.c answered Matthew Gillespie commented

Hi,Axel

You can try the code below. It will works even if the object have different upstreams (not only Conveyor Module but also ordinary objects)

  1. treenode ob = node("Sink5", model()); //the upstream object you want to get
  2. int innum = 1; //the input number
  3. treenode inob = inobject(ob,innum);
  4. if(classobject(inob) == node("/conveyor/ExitTransfer",library()))
  5. //Get downstream you can change "ExitTransfer" to "EntryTransfer"
  6. {
  7. inob = ownerobject(node("/1+",getvarnode(inobject(ob,innum),"transferPoint")));
  8. }
  9. return inob;
· 4
5 |100000

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