question

jing.c avatar image
2 Likes"
jing.c asked Adrian Haws edited

How to get RN data?

Hi everyone. I want to get specified value in RN data. Not only numeric values but also string or other(if have) values, such as "curFR", "Type" or "vars[1]" in the pics attached.

I had try to use the command getstat() with @Matt Long's Answer. But I failed because I don't know how to set the 2nd and the 3rd parameters.

Any suggestion will be appreciated!

FlexSim 16.0.1
flexsim commandsgetstatrn data
1.png (24.3 KiB)
2.png (16.2 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
5 Likes"
Matt Long answered Adrian Haws edited

The values stored in the item's itemtype are not stats so the getstat() command won't help you here. There are a set of commands you can use to get this information if needed.

getitemsendto(item)
getitemstate(item)
getitemvar(item, 1)
getiteminvolved(item)

You can get the current, min, max, average and entry values by using the getstat command. Just change the 3rd parameter to either STAT_CURRENT, STAT_MIN, STAT_MAX, STAT_AVERAGE, STAT_COUNT.

getstat(node("Queue4", model()), "Content", STAT_AVERAGE)

Those stat nodes (the ones color purple) are actually tracked variables. Type defines how it stores and calculates the information it is given. If for some reason you need to know the type, you could use the getsdtvalue() command. But you have to call it on the tracked variable node itself:

getsdtvalue(stats_content(node("Queue3", model())), "type")

For more information on tracked variable types see the inittrackedvariable() command documentation.

· 1
5 |100000

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

jing.c avatar image jing.c commented ·

Matt, Thanks for your answer.

Your advice really helpful for getting item's itemtype. But I also want to know how to get string or other values in RN data, such as "Type" in "stats_content" you can see it in pic2.

0 Likes 0 ·