question

Sebastien avatar image
0 Likes"
Sebastien asked Sebastien commented

How to get process time of an instance from its tree ?

Hello !

I would like to store the total processing time of each instance of my machines.

I used to do it with a statistics collector but all the state times are already registered in each instance's tree under the path: "instance/stats/state_current/profile".

Is it possible to access the processíng time stored in the instance's tree from the model, for instance from the instance's Exit trigger ?

Best regards,

timestatestree
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

Joshua S avatar image
1 Like"
Joshua S answered Sebastien commented

You can use this code

  1. executefsnode(getvarnode(Model.find("Processor1"), "cycletime"),0);

The node for processing time is a script node, so this executes the script in that node and returns the processing time, but only if the processing time was a set number, not based off the item's type or such. If the processing time is constantly changing, then in the code for the processing time, tell it to change a label on the processor and read that label on the instances exit trigger.

· 9
5 |100000

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