When I use the following code below, I get errors when the "processingTime" label is a decimal.
When I run the model and look at the cycle time variable it seems to round up the decimal point. I don't understand why.
When I use the following code below, I get errors when the "processingTime" label is a decimal.
When I run the model and look at the cycle time variable it seems to round up the decimal point. I don't understand why.
numtostring(num value)
is evaluated as
numtostring(num value, 0, 0)
So a floating value is converted to a string without a defined minimum length of characters and without any characters of a possible decimal part of the number. If you want to get a desired conversions you have to compute and convert the num value before you parse the num value into the command numtostring. Otherwise the command rounds the value as the Flexsim engine always rounds number values.
For me it works if I add the precision in the numtostring command.
string timeStr = numtostring(time,0,2);
but it seems that this is not the best way to set the processtime/ cycletime of the processor. In my example there is a gap between Setting the value and the cycletime the processor takes!
Maybe you should try to add this Code to the Processor, or set a Label and just reference this.
8 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved