question

martin.j avatar image
1 Like"
martin.j asked jing.c commented

How to read nodes with the DATATYPE_SIMPLE

I am attempting to read statistics information form a process flow activity. see image below

In the stats/instances/[instance] I find a number of nodes with DATATYPE_SIMPLE that contain statistics data for the activity. Using getnodenum(node) I can read the Input and Output nodes, but the tokens node contains the information seen above, and a getnodenum() call returns only 0.

Is there a way to read this information, to get the Size: value for instance? I am not only interested in this specific situation but more generally on how to acces the DATATYPE_SIMPLE. I see it used several places throughout Flexsim, but so far much of it is inaccessible.

FlexSim 16.2.0
statisticsdatatypegetnodenumread simple data
datatype-simple.png (10.4 KiB)
5 |100000

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

1 Answer

Matt Long avatar image
4 Likes"
Matt Long answered jing.c commented

Generally we would recommend not reading data directly from these nodes as their structure and naming could change, breaking old models. For gathering statistics, you should use the getstat() command.

However, there are two commands that can be used to get and set data on a SimpleDataType (SDT).

  1. getsdtvalue(sdtNode, "valName");
  2. setsdtvalue(sdtNode, "valName", value);
· 3
5 |100000

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