question

Ankur A3 avatar image
0 Likes"
Ankur A3 asked Ankur A3 commented

How to call the user command having array as a parameter?

Hi Team,

I have created a user command and passing array as a parameter. But, it is showing errors while calling the user command.

1726063660777.png


1726063984957.png

Could you help me to know where it is going wrong?

Thank you!

FlexSim 23.2.1
arrayuser commandsparameter
1726063660777.png (75.6 KiB)
1726063984957.png (79.9 KiB)
· 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.

K_yun avatar image K_yun commented ·

002.png

try here

0 Likes 0 ·
002.png (1.5 KiB)

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Ankur A3 commented

Here's the documentation - you should use "var seq" in your list of parameters.

· 8
5 |100000

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

Ankur A3 avatar image Ankur A3 commented ·

@Jason Lightfoot

Thanks for providing the documentation link.

Before, I was using Array seq = param(1); while defining user command.

Now, I made the correction as below:

var seq = param(1);

Even I am getting the same errors while calling the user command as

int Min_Time = Min_Changeover_Time([1,2,3]);

It is not accepting array as a parameter.

Do I need to change anything else?

Thank you!

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Ankur A3 commented ·

The Array type is correct in the code but not in the parameter definition of the user command where you must use 'var' or Variant.

Example attached.

UserComand_minValInArray.fsm

0 Likes 0 ·
Ankur A3 avatar image Ankur A3 Jason Lightfoot ♦♦ commented ·
@Jason Lightfoot

I can't open it as it is in 2024 version.

Could you share it 2023 version?

Thank you!

0 Likes 0 ·
Show more comments