question

Alessio Merlo avatar image
0 Likes"
Alessio Merlo asked Matt Long commented

Are optional command parameter no more optional?

Hi,

today I opened an old model in FlexSim 17.0.3 and some errors in compiler console appear. I fixed all, except two.

They are related with the command "initkinematiks" and "listpush". The compiler requires that all optional parameters will be passed. Fot the first I have no problem to pass the missing parameter, but for the second one the optional parameters change the result of the command.

I created two user commands to test the optional parameter, but everything works with them.

Where is my error? If there isn't an error, why does compiler return to me an exception? Is commands definition changed?

@Matt Long @phil.bobo @anthony.johnson, can you help me?

Thank in advance.

compiler-error.fsm

FlexSim 17.0.3
compiler erroroptional parameter
compiler-error.fsm (20.2 KiB)
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

Matt Long avatar image
0 Likes"
Matt Long answered Matt Long commented

For the listpush(), the displayed list of parameters is incorrect. When you use the listpush you need to both define the list to push to, and what you want to push.

listpush(List, whatToPush)

The initkinematics looks like the definition in the engine is not correctly written. We'll need to get that fixed. You should be able to pass in the following parameters (which are what the default parameters are when you omit them)

initkinematics(kin, residual, 0, 0, 0, 0, 0);
· 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.

Alessio Merlo avatar image Alessio Merlo commented ·

Thanks @Matt Long!

From your answer I understand that the behaviour of command listpush() is changed. From the help I read:

If pushVal is not passed, it will just re-evaluate all back orders without pushing anything onto the list.

Then how can I revaluate the back orders now?

0 Likes 0 ·
Matt Long avatar image Matt Long Alessio Merlo commented ·

Right, so it has a similar problem to the initkinematics where the default parameters are incorrect. We'll get that fixed, but for now the work around would be to use a Back Order Reevaluation Event. You could just listen to the On Message of an object and then send a message to that object anytime you want to reevaluated the back orders.

0 Likes 0 ·