question

G C avatar image
1 Like"
G C asked Matt Long edited

billboard display process flow zone staytime

Need help with flexscript. I want to display a text billboard with the data highlighted red below and divide it by 150 and round to 2 decimal places. If it works, it should show "Cycle Time: 1.98 hours".

@Matt Long

FlexSim 16.1.0
flexscriptbillboard
help.png (39.0 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
1 Like"
Matt Long answered Matt Long edited

The command you are looking for is the getstat() command.

getstat(getactivity("ProcessFlow", "Zone1"), "Staytime", STAT_CURRENT)

To place this in a billboard select the Display Text pick option and enter:

concat("Cycle Time: ", numtostring(getstat(getactivity("ProcessFlow", "Zone1"), "Staytime", STAT_CURRENT) / 150, 0, 2), " hours")

The numtostring command's 3 parameter is the precision. Setting this to 2 will have it display two decimal places of precision.

5 |100000

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