question

Ouliwen134 avatar image
0 Likes"
Ouliwen134 asked Ouliwen134 commented

How to create a PreArrival Event

Hello

I want to create a event to trigger AGVNetWork controlPoint's waypoint pre arrival logic,and I find this kind event type is AGV::AGVData::PreArrivalEvent ,But I have not found a method to make this kind of event. Any advices are appreciated!

FlexSim 18.2.3
flexsim 18.2.3prearrival event
· 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.

Ryan Clark avatar image Ryan Clark commented ·

Hi @ouliwen134, was Logan Gold's answer helpful? If so, please click the red "Accept" button at the bottom of the one that best answers your question. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Logan Gold avatar image
0 Likes"
Logan Gold answered Ouliwen134 commented

Hey @Ouliwen134, I'm not aware of a way to refer to the AGV::AGVData::PreArrivalEvent type like you can some other nonAGV Event Types. The only way I am aware of to create the PreArrivalEvent is to have an AGV travel to, or through, a Control Point. Also, I believe this Event Type is technically the AGV's OnPreArrival event, but I do know Control Points have their own OnPreArrival that is different and probably fires at the same time.


So I think we need some more information about what you are trying to do.

Are you just trying to execute the code that is part of the "Way Point Logic" field in a Way Point? If so, you can use something like treenode.execute(). The treenode in question is found at:

MODEL:/AGVNetwork>variables/wayPoints/WayPointName/wayPointTrigger

And it takes two parameters; the Task Executer that is acting as the AGV as p1, and a Control Point as p2. You can even use the fireRequirement node in the same tree (AGVNetwork>.../WayPointName/fireRequirement), using the same parameters, to check if the Trigger Requirement returns true or false, like this:

Object te = Model.find("TaskExecuter1");
Object cp = Model.find("ControlPoint1");
treenode wayPoint = Model.find("AGVNetwork>variables/wayPoints/WayPoint1");

if (wayPoint.subnodes["fireRequirement"].evaluate(te, cp)) {
    wayPoint.subnodes["wayPointTrigger"].evaluate(te, cp);
}


Or is there a different reason that you want to trigger the PreArrivalEvent? If so, you will probably need to do something else, like in a Process Flow, with the kind of logic that you are trying to execute at that time and have a different event kick off that logic, like an Event Triggered Source.

Other than that, we'll need some more information about your end goal before we can help you do whatever you are trying to do.

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

Ouliwen134 avatar image Ouliwen134 commented ·
Hi Logan, Thankyou! what you have replied is exactlly what i wanted to find.
0 Likes 0 ·