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):

int contentleft = content(outobject(outobject(current, 1), 1));
int contentright = content(outobject(outobject(current, 2), 1));

if (contentleft < 1) { // check left buffer space
	// send to left buffer space
	conveyorsenditem(item, outobject(outobject(current, 1), 1));
} else if (contentright < 1) { // check right buffer space
	// send to right bufferspace
	conveyorsenditem(item, outobject(outobject(current, 2), 1));
} else // continue
	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.

Edwin Purwanto avatar image Edwin Purwanto commented ·

Hello all, thank you very much for your answer.

So, to conclude from all of your advice that the main problem is from the conveyorsenditem command.

However, when I tried only this command

int contentright = content(outobject(outobject(current, 2), 1));

I still get the same error, so i have no idea on how to dynamically check the content of the buffer for now, instead of one by one doing content(node("queue110",model())).

Thanks and best regards,

Edwin

			
0 Likes 0 ·
Brandon Peterson avatar image Brandon Peterson ♦ Edwin Purwanto commented ·

Edwin,

If you post your model I can look at it and tell you what is going wrong with your function call. From your picture it looks like you should not be having any problems.

If you make an output connection (holding "A") from the conveyor to the second queue then you should get a different exit transfer that you can place on the opposite side of the conveyor. You may need to move the second queue to a temporary location that is further down the conveyor from the 1st queue when you make the connection and then move it back to its proper location.

Brandon

5 Likes 5 ·
Edwin Purwanto avatar image Edwin Purwanto Brandon Peterson ♦ commented ·

Hello Mr Peterson,

Thanks a lot for your help, actually I alter it with all queue goes to 1 exittransfer.

But I am anyway still curious on how this thing happen, so I also attach the model here.

Here, DP8 should direct at least 1 flowitem each buffer. It is not done.

test9.fsm

0 Likes 0 ·
test9.fsm (71.1 KiB)
Edwin Purwanto avatar image Edwin Purwanto Edwin Purwanto commented ·

Another question is regarding the characteristic of exitransfer. Whenever I tried to make connection on the other side, it is compacted in one exitransfer.

Actually, if there is two exitransfer, it makes the work rather easier, but It seems i cannot do it, what is the problem here?

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

Brandon Peterson avatar image Brandon Peterson ♦ commented ·

Edwin,

Here is your model with some corrections so that it will work. Here are the changes that I made and why:

  • Changed the Arrival code of DP8
    • Both Queues were still using the same exit transfer and as a result your content code was not looking in the correct place for one of the queues.
    • Set a label on the item that tells the exit transfer which port to send the item to.
  • Moved DP8 closer to the queues, set the Item Edge value to leading, and changed the Send To Port field.
    • With DP8 so far away from the queues it was sending multiple items to the same queue because the queue was still empty when the following items would reach DP8
    • Set the Item Edge to leading so that I could place DP8 as close the the queue exit transfer as possible
    • I changed the send to port field to send to the port specified by a label that I set in the Arrival code of DP8
  • Removed the output port connections on the queues that connected back to the conveyor.
    • I did this so that the test results would be more clear
      • Queues do not delay items from exiting and as a result the items were staying in the queues for zero time
  • Created a copy of DP8 to send items to the 3rd and 4th queues on the line

I hope the changes in the model answer your questions and clear things up for you,

Brandon

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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