question

Sohee P avatar image
0 Likes"
Sohee P asked Sohee P commented

How to set label and write to grobal table using user command

(I use FlexSim 20.2.3 version)

I want to set item label using user command. It is not hard to making a user command but i wonder what I set return type(I want to set label numeric and string both of all).


Also I want to write tracked variables value to global table, In that case, could I set User command return value to num?


Thank you for your kindly response.

FlexSim 20.2.3
user commandset labelwrite to global table
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

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Sohee P commented

You can return a variant using 'var' as the return - that will give you the most flexibility.

Note that passed in parameters are variant type too, so you can pass in a reference to an object, node, a string or numeric and if you know the parameter type you can specify, obj, str, num to check the type when you're writing the code to call the command.

Also note that if you pass in an array, any changes to the array are preserved so can be read by the originating code that passed it to your user command.

· 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.

Sohee P avatar image Sohee P commented ·

Thank you for replying my question. I didnt know that User command doesn't have to have a return. I solve a problem through your command. I really appreciate 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.