- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Title: Digital twin: items created by Emulation Control action all route to port 1
Body:
I'm using a FlexSim 2026 Education license. I'm preparing a digital twin class for next semester, and I appreciate your help. I built two models connected via KEPServerEX 6 (OPC DA).
Master model writes item type (1/2/3) to a tag. Twin model has an Emulation Control variable subscribed to that tag, with three Actions (Value 1, 2, 3). Each action is a Code Snippet that creates the matching item:
treenode template = first(rank(node("/Tools/FlowItemBin", model()), 1));
treenode newitem = insertcopy(template, model());
setitemtype(newitem, 1);
colorarray(newitem, 1);
setlabel(newitem, "Type", 1);
applicationcommand("trackdefaultsoncreate", newitem);
moveobject(newitem, Model.find("EntryTransfer1"));All three actions fire — I get red, blue and green items in the correct sequence, so the colors prove the right action runs each time. But every item routes to lane 1.
The Decision Point trigger (same as in my working master model) is Case Function item.Type, Case 1 → current.outObjects[1], Case 2 → [2], Case 3 → [3].
Why doesn't my digital twin follow the master model? I'm struggling with it.
Thanks.
Solved! Go to Solution.