The idea is to assign different speeds according to the type of product being transported
The idea is to assign different speeds according to the type of product being transported
Hi @Manuel M43, was Felix Möhlmann's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.
If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.
The speed and acceleration values are stored in the crane's "variables" tree.
You can set these using code with the following syntax:
Model.find("craneName>variables/cranespeeds/Part/var").value = N
"Part" should be replaced with which speed you want to set (Gantry, Trolley, Hoist_Lift or Hoist_Drop). "var" should "1" to set the maximum speed, "2" for the acceleration and "3" for the deceleration. This can also be seen in the tree in the "Gantry" node, but for the others the subnodes are not named so they have to be referenced by rank.
To change the speeds depending on item, you could use this in the load trigger of the crane. In that case the expression can be shortened because the crane is already referenced with "current" variable - a reference to the ownerobject of the event, in this case the crane itself.
If you only have a few different types you can use if - else condition to set the speed. With numerous values I'd suggest to use the switch - case syntax.
https://docs.flexsim.com/en/19.2/Reference/CodingInFlexSim/WritingLogic/#flow
In the "Unload" and "Reset" you then reset the speeds/acceleration/deceleration to their default values. Attached is an example model in which items of type 1 (red) are transport with a max speed of 4 and type 2 (green) with a max speed of 1.
Rather than adjusting the variables nodes directly, you should use the Object.getProperty() and Object.setProperty() methods:
Object crane = Model.find("Crane1"); var craneSpeeds = crane.getProperty("CraneSpeeds"); //return craneSpeeds; craneSpeeds[2][1] = 3; // change Trolley Max_Speed crane.setProperty("CraneSpeeds", craneSpeeds); return craneSpeeds;
https://docs.flexsim.com/en/22.0/Reference/3DObjects/TaskExecuters/Crane/Crane.html#properties
17 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved