question

Julio R avatar image
0 Likes"
Julio R asked Julio R commented

get a conveyor reference from Station

I want to get a reference to the conveyor from a Station that is positioned on it.

The only reference I could find is the following:

getvarnode(Model.find("Station1"), "conveyorPoint").first.value.up.up.up;

Is there a easier reference I could use?

I am working with version 2019 but I am also interested on doing this in version 2023.

Thank you

FlexSim 19.1.2
conveyorstation
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

·
Logan Gold avatar image
0 Likes"
Logan Gold answered Julio R commented

Where are you trying to make the reference? On the Station objects themselves, there is a variable that references the Conveyor object in anything where you can open the code editor (Process Condition, Process Time, Triggers, etc.).

Also, an event-triggered source (or wait for event) activity in Process Flow, where a station is the Object, will have a way to assign the conveyor as a label on the token for most station events that you can listen to.

At the very least, you can use the On Reset trigger to set a label on the station that is a reference to the conveyor. You could then refer to that label later in the model run to get the conveyor reference.

And finally, while not a ton better, a slightly different way with code:

ownerobject(getvarnode(Model.find("Station1"), "conveyorPoint").first.value);
· 2
5 |100000

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

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

You can also use the conveyor property on the Conveyor.DecisionPoint class.

FlexScript Class - Conveyor.DecisionPoint (flexsim.com)

Model.find("Station1").as(Conveyor.DecisionPoint).conveyor
0 Likes 0 ·
Julio R avatar image Julio R Phil BoBo ♦♦ commented ·
This is what I was loking for, it works great for 2023 version but does not work for 2019 version.

Thank you!

0 Likes 0 ·

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.