question

Edwin Purwanto avatar image
3 Likes"
Edwin Purwanto asked Brandon Peterson commented

can outobject command be cascaded?

Hello,

In this case, we just need to distribute the flowitem moving in conveyor into an empty buffer placed alongside it. Actually we can make it work using just a command of content(node("queue110",model())) for instance, but to set it like that while we have quite lots of buffer (queue110 being a particular buffer), it become tedious.

So I thought of using pointer outobject, as follow (this script is at on arrival on each decision point):

  1. int contentleft = content(outobject(outobject(current, 1), 1));
  2. int contentright = content(outobject(outobject(current, 2), 1));
  3.  
  4. if (contentleft < 1) { // check left buffer space
  5. // send to left buffer space
  6. conveyorsenditem(item, outobject(outobject(current, 1), 1));
  7. } else if (contentright < 1) { // check right buffer space
  8. // send to right bufferspace
  9. conveyorsenditem(item, outobject(outobject(current, 2), 1));
  10. } else // continue
  11. return 0;

But this command result in an error as below.

time: 302.369221 exception: Exception caught in flexscript execution of MODEL:/DP100>variables/localType/onArrival line 8 instruction 19. Discontinuing execution.

So I was under impression that the cause of this error is most likely because I cascade the outobject. is this possible to be done? or some syntax error?

Thank you very much for your kind help

Best Regards,

Edwin

conv-dist.png

FlexSim 16.1.0
conveyordecision pointoutobject
conv-dist.png (324.9 KiB)
· 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.

Brandon Peterson avatar image
4 Likes"
Brandon Peterson answered Brandon Peterson commented

Edwin,

Your problem is not being caused by cascading the outobject command. You can cascade the outobject, inobject, and centerobject commands as much as you want. The problem is that the object you are returning is not to a point within the conveyor system. In the image you shared in your post it appears that the reference you are returning is to one of the queues connected to the conveyor.

The description for the conveyorsenditem command states that the destination must be a "decision point, a photo eye, or an exit transfer." The destination must also be reachable from the current location within the conveyor system, or in other words, it must be downstream from the current location.

As the queues cannot be part of the conveyor system you would need to specify an alternate location. I would recommend that you specify the exit transfer in the conveyorsenditem command and then use the "Send To Port" trigger on the exit transfer to send the item to the appropriate queue.

I hope this helps,

Brandon

· 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.

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered

the cascading of outobject commands is not a problem. It is a problem to place the cascading referrence in the conveyorsenditem command. The destination has to be the next object and not the following of the next object.

5 |100000

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