question

Patrick Zweekhorst avatar image
0 Likes"
Patrick Zweekhorst asked Jason Lightfoot edited

What is the recommend way to change the default conveyor speed?

Hi,


What is the recommend way of changing the default conveyor speed in FlexSim 2021? In 2020 we used the OnModelReset trigger to change the speed of a conveyor OnReset by setting the speed property in the conveyor type. Something like this:

Model.find("ConveyorSystem>variables/conveyorTypes/ConveyorTypeWassen/speed").value =  newSpeed;

What is the best option to do this now? I understand that we need a for loop to loop over all the conveyors of that type (since they are now in a group and don’t have a conveyor type property anymore). I thought of doing something like this:

double newSpeed= someValue;
Group conveyorWassenGroup = Group( "ConveyorTypeWassen" );
for( int i = 1; i <= conveyorWassenGroup.length; i++ )
{
    Conveyor conveyor = conveyorWassenGroup[ i ];
    conveyor.default= newSpeed; //Not working, throws error, can't set this property
    conveyor.targetSpeed = newSpeed; //Not working
}

But that is not allowed, since we can’t set the defaultSpeed. Do we still need to go in the tree and change the speed variable or is there an option that I am missing here?

Thank you for your time

FlexSim 21.0.2
conveyorflexsim 21.0.2onmodelresetdefault speed
· 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.

Jason Lightfoot avatar image Jason Lightfoot ♦ commented ·

Should be conveyor.setProperty("Speed",newspeed) but will investigate further.

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

Seems this is a bug in the ModelParameter setting that I used to check - if you open the popup option having selected Speed, it will then populate the code with "Speed" instead of "ConveyorSpeed"

0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered Matthew Gillespie commented
conveyor.setProperty("ConveyorSpeed", newspeed)
· 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.

Patrick Zweekhorst avatar image Patrick Zweekhorst commented ·

@Matthew Gillespie,
Thank you for your answer. How do you know you need to use ConveyorSpeed and not Speed like Jason does? Is this because this object in from the Conveyor module?

0 Likes 0 ·
Matthew Gillespie avatar image Matthew Gillespie ♦♦ Patrick Zweekhorst commented ·

@Patrick Zweekhorst You can see the actual name in the SQL dropdown.

It's not ideal right now, but the ConveyorSpeed property is named differently than the task executer's Speed property to avoid a name collision. We're hoping to update the setProperty method to also accept the alias (Speed in this case) of the property. We're also working on providing a documented list of properties by object.

0 Likes 0 ·
1611679574360.png (12.9 KiB)

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.