question

Gonzalo Herrera avatar image
0 Likes"
Gonzalo Herrera asked Steven Hamoen answered

get the variable processTime from code Snippet

Hi friends.

Is it possible to get the variable "process time" from a processor to use it in a label.

I traied this:

getlabelnum(current,"processTime") 
and this
getlabelnum(current,"cycleTime")

but doesn't work.

any helps?

i'm using Flexsim 7.3.

Thanks in advance

FlexSim (other - please specify)
FlexSim (other)
Choose One
processtimecode snippet
· 2
5 |100000

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

Sam Stubbs avatar image Sam Stubbs ♦ commented ·

Can you clarify a little more what you're trying to do? Are you trying to assign the Process Time field from a Label you've set on your processor? Or are you trying to access the process time variable from the Processor in the model tree, and assign that to a label? Perhaps if you could explain what it is you're trying to do with your model, that would help give us context.

0 Likes 0 ·
Gonzalo Herrera avatar image Gonzalo Herrera Sam Stubbs ♦ commented ·

Thanks for your time. I have a "processor" and I set the "process time" in ther properties. Now, i want to access to that "process time variable" in the trigger "on exit" to use it for calculate something.

Hope you understand, sorry my english.

Regards,

0 Likes 0 ·

1 Answer

·
Steven Hamoen avatar image
4 Likes"
Steven Hamoen answered

@Gonzalo HerreraThe processtime of the processor is actually a variable called cycletime. You can access a variable with getvarnum, getvarnode etc.

But the problem is that if your cycle time is a distribution, everytime you query it, you will get a different value. If you want to make this easy put a label on the processor or on the item. Give it a processtime in the onentry trigger and then use that label in the process time field. And that way you can access that label also in the onexit trigger and you will have 1 value during the whole process of 1 flowitem. A label on the processor is fine if capacity is 1 but a label on the item will also work if capacity of the processor > 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.

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.