decision point does not detect its content

decision point does not detect its content

omar_aguilera_rico
Not applicable
88 Views
3 Replies
Message 1 of 4

decision point does not detect its content

omar_aguilera_rico
Not applicable

[ FlexSim 18.2.0 ]

dp.fsm

Hello boys. I'm working on a model, and notice something strange. So I attached the following model, to make the problem clearer. I am using "Model.find("DP1").subnodes.length" for when a box arrives at the Decision Point I do a Stop of the box, it does it but when I evaluate in the Script the content of the DP, it throws me zero. If I check its contents, it tells me that it has an object. What is the reason that "Model.find("DP1").subnodes.length" does not detect the object on it? How can i fix this? Regards!

0 Likes
Accepted solutions (1)
89 Views
3 Replies
Replies (3)
Message 2 of 4

tanner_p
Not applicable

The reason why it doesn't show up, I think, is because the object is still a subnode of the conveyor and not of the decision point. I'll look more into this and find out how you can reference the object at a decision point.

0 Likes
Message 3 of 4

omar_aguilera_rico
Not applicable

I found the following that if it detects the content of the DP: Model.find ("/DP1>stats/stats_content"). Value Only that I have several DP and I will have to modify the path of each one to find the content of each DP. Will there be another solution?

0 Likes
Message 4 of 4

philboboADSK
Autodesk
Autodesk
Accepted solution
Object current = Model.find("DP1");
return current.stats.content.value;

Assign the decision point to a label on your token, then access it that way:

14242-assign-event-object.png

Conveyor.DecisionPoint dp = token.dp;
int dpContent = dp.stats.content.value;

The OnArrival event happens before the content stat has been updated, so you may need a Delay of 0 (Breathe) between the Event-triggered Source and when you read the stats value.



Phil BoBo
Sr. Manager, Software Development