question

Martin K5 avatar image
0 Likes"
Martin K5 asked Jeanette F commented

How to change conveyor's direction by code?

Hi,


I would like to ask if it possible to change conveyor's direction by code (if so, how)?

Thank you.

Martin

FlexSim 22.2.0
codeconveyor direction
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Martin K5, was one of Jason Lightfoot's or Matthew Gillespie's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. 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.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Jason Lightfoot edited

You can make the speed negative to reverse the flow during a run.

conveyor.targetSpeed=-1*conveyor.targetSpeed;

Note that any routing is based on the forward direction at reset - so you can't send an item based on it following a route when in reverse. Note that the object should be cast as a Conveyor class.


You can change the direction shown at reset using.

function_s(object, "switchDirection");

but since this uses a function_s call, it may not work in the future and so don't litter your model with multiple calls like this - put it in a user command so you can change it once if needed.

5 |100000

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

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.