question

Sam avatar image
0 Likes"
Sam asked Jason Lightfoot edited

How to get parameters between Object and Object?

For example I draw PhotoEye on my conveyor1 and a box is covered PE1 then I want to send my box to other conveyor lines by getting a parameter and replacing agv's port number. I dont how to do it.

FlexSim 22.0.2
photoeyeparam
· 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.

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Jason Lightfoot edited

This is quite a broad question, as there are many different possible solutions to situations like this.

In the attached model I added a pointer label to the queue that refers to the Photo Eye. In the Send to Port option the queue checks the current status of the Photo Eye. If it is not "blocked", the item is send to port 1, otherwise to port 2.

ObjectRefExample.fsm

Instead of the pointer label, you could use a centerport connection between the two objects to get a reference to each other.

Or you could use a global variable that gets set by the Photo Eye and read by the queue.

You could also use the "Model.find()" command to get a reference to an object in the model , though if you access it often, it's usually better to store it somewhere instead of having to search for the object each time.

There's probably even more ways but which is "best" always depends on the given situation (which object accesses which other object and how often) as well as personal preference.


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