question

Omar Aguilera Rico avatar image
0 Likes"
Omar Aguilera Rico asked Phil BoBo answered

decision point does not detect its content

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!

FlexSim 18.2.0
conveyordecision pointscurrent
dp.fsm (31.8 KiB)
· 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.

tannerp avatar image tannerp commented ·

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 0 ·
Omar Aguilera Rico avatar image Omar Aguilera Rico tannerp commented ·

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

1 Answer

·
Phil BoBo avatar image
1 Like"
Phil BoBo answered
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:

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.


5 |100000

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

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.