question

Orry avatar image
0 Likes"
Orry asked Arun Kr edited

What means about "param"

Hello

I don't know where the "param()" point, and what data it actually contain.

Thanks

Best wish

qq截图20230602101818.png
FlexSim 23.1.2
customcode
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

Arun Kr avatar image
1 Like"
Arun Kr answered Arun Kr edited

They are basically input parameters to the down function. Similarly, you will also see the param() commands in the triggers code.

FunctionName(param1,param2,....);

param(1) ;//means input parameter 1

You need these data to apply logic to the object where this function is executed or triggered.

If you want to see the values of these parameters, you can put a debugger and visit the local variables' values.

1685682832534.png


https://docs.flexsim.com/en/23.1/Reference/CodingInFlexSim/Debugging/Debugging.html#overview

For example, in the down function case, you have put the snapshot. The purpose of the down function is to bring the object which is under MTTF-MTTR/ Timetable to a down state. For that, the function needs to know which object is going to go down. So FlexSim is passing the object reference as parameter1(param(1)) to the down function and by using that reference stop object () command is used to set the object in the downstate.

Similarly in an on-entry trigger of an object, if you want to add some info or change some info on the item which is entering an object. So you need the entering item info, which is passed by FlexSim as a param(1) in the on-entry trigger of the object. Otherwise, you will not get the reference of the incoming object.

So to conclude the triggers, down function-resume function, send port, etc are all functions, which need some input parameters which is passed into them by FlexSim and those parameters can be accessed using the param() command. In FlexSim these functions are called node function ().

Regards,

Arun KR


1685682832534.png (43.1 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.