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.