A sink in my model accepts two different type of flow items. I'd like to keep count of how many of each type arrive at that sink and ideally have those numbers posted in my dashboard. m-line-transport-concept-d.fsm
A sink in my model accepts two different type of flow items. I'd like to keep count of how many of each type arrive at that sink and ideally have those numbers posted in my dashboard. m-line-transport-concept-d.fsm
You can create two number labels in your sink. Then you increment each label if a condition becomes true that one type has entered the sink. You can show any label of an object in a dashboard. I think it is dynamic text which will do this. With the eye dropper tool you can choose the label directly from the sink in your 3D model, if you adjust the parameters and functions of the dashboard object.
Jörg
Hi Jorg,
Thank you for the response. How would I code the condition statement so if it is true, then the label is incremented? Sorry, I'm not experienced in c++ coding..
The Label I created to keep track of the number of BuildModules that arrive at the sink is called BuildModule. Also at each source, I am assigning a unique item type (1, 2, or 3)
In the OnEntry trigger, I choose Data>Increment Value and then open the code edit, but I'm not sure what to enter? Here's what I have so far:
treenode item = param(1);
treenode current = ownerobject(c);
int port = param(2);
treenode thenode = label(item, "BuildModule");
if (getitemtype(item)==1);
{
double value =1; inc(thenode,value);
}
count-items-by-label-attribute-at-sink.fsm is a model wherein s source creates items with a label named as "yourLabel". This label gets at each item the randomly choosen value of 1 or 2 and the color is set by this Number. The OnEntry trigger of the sink contains a code snippet which distinguishes whether the label value is 1 or 2. If it is 1 the node of the label called "yourLabel_if_1" is incremeted by 1. Otherwise the label called "yourLabel_if_2" is incremented by 1. It is important that node is incremented and not the label value:
Node of the Label: current.labels["yourLabel_if_1"]
labels is the attribute name of all Labels.
Value of the Label: current.yourLabel_if_1
Thank you Jorg. I'll keep this code snippit handy. Appreciate you taking the time to write it out for me.
If you didn't want to have to worry about coding stuff up or adding labels, you could change the Sink object to be a Queue. Then set the Queue's Send To Port option to separate out the two different types of items and send one type to a Sink and send the other type to a different Sink. Then you could just chart the input of each of the Sinks to get the totals.
7 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved