question

Nurul Shuhaida KS avatar image
0 Likes"
Nurul Shuhaida KS asked tannerp commented

How to start in the Script?

I would like to calculate the availability of a single equipment using the equation

availability=uptime/(uptime+downtime)

I have included the uptime and downtime in the MTBF/MTTR functionality.

FlexSim 18.2.3
flexscript
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
0 Likes"
Joshua S answered Nurul Shuhaida KS commented

This code will accomplish this

Object Processor=Model.find("Processor1");
double downtime =Processor.stats.state().getTotalTimeAt(11);// gets the total time the object was stopped up until the time the code was run
double uptime =time()-downtime;
double availability= uptime/time();
return availability;
· 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.

Nurul Shuhaida KS avatar image Nurul Shuhaida KS commented ·

I have tried it several time but error in line 2 and still can't proceed.. tried to amend but still not working.

It written there, unexpected "."

Can I get the manual for this or anything that I can relate. Actually I am quite new to this software.

0 Likes 0 ·
Joshua S avatar image Joshua S Nurul Shuhaida KS commented ·

If I remember right you previously posted this with a flow works model, which has some differences in how the data is gathered, is this correct? The manual is built into flexsim, and also at the top of answers it gives you a link to the online manual.

1 Like 1 ·
Nurul Shuhaida KS avatar image Nurul Shuhaida KS Joshua S commented ·

Okay thank you so much.. will try to look into it

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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