question

Gilles avatar image
0 Likes"
Gilles asked Logan Gold answered

model is freezing - using script to create conveyors system

Hello,

I am using a script to create my conveyor system. my script is very simple. in the beginning I create 48 conveyors. the first image below shows you how I create these conveyors. then I have few for loops where I create additional conveyors. the second image show an example of one of the for loop. I started having issue when I added a third for loop in the script. what happens is, when I run the script, it looks like the model is taking forever and nothing is happening. and I have to close the model to stop it. if I run the script in a debug mode with many debugging points, I won't have the issue and I will get the results that I expected.

1734061467270.png

1734061588178.png


FlexSim 23.2.1
conveyorsscriptissue
1734061467270.png (51.5 KiB)
1734061588178.png (195.8 KiB)
· 7
5 |100000

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

Logan Gold avatar image Logan Gold ♦♦ commented ·

Hi @Gilles ,

It's hard to know how to help without looking at your model. To receive a more accurate solution, please post your model or a sample model that demonstrates your question.

If your model contains sensitive information, you could first toggle your post as private using the "make private" option under your question's "gear" menu. Private questions are visible only to site moderators. You can also contact your local FlexSim distributor for phone or email help.

1 Like 1 ·
Joerg Vogel avatar image Joerg Vogel commented ·
@Gilles, it looks like a runtime problem. There are functions, that you are calling that needs to be completed before another step of code begins or same function is allowed to be called again. I would recursively call my code by messages again and use in my code a switch structure to return in a next block of code. Messages have an ability start a new execution of a processor cycle.
0 Likes 0 ·
Gilles avatar image Gilles Joerg Vogel commented ·

@Joerg Vogel , thank you!

I understand your solution but I can't figure out how to implement it in a script. I am using script (see image below) to write my code. so I don't see how to use message and switch in that script.

1734107121349.png

Could you send me an example of script which implements your solution?

0 Likes 0 ·
1734107121349.png (76.7 KiB)
Joerg Vogel avatar image Joerg Vogel Gilles commented ·

@Gilles please print to an output console c.

print(c);

if it is path to your script then try if you can call your script recursively. But be aware of an indefinite loop you may create.

@Gilles additional solution: Please put your script into an object trigger like on Message and On Reset Event and test it if you can get it to work by recursive calls in switch to case structure. This would tell you that my suspicion would be right. Then developers can suggest methods to get a similar approach for a loadable script code for a script window.

0 Likes 0 ·
Show more comments
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Gilles ,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·
Gilles avatar image Gilles Jeanette F ♦♦ commented ·

Hi @Jeanette F ,

the issue is not resolved. 3 weeks ago I created a similar ticket in private mode where I am sharing the script and have not yet received any update.

refer to "

model stops working and is frozen

"

0 Likes 0 ·

1 Answer

Logan Gold avatar image
0 Likes"
Logan Gold answered

I just wanted to note that we are helping with this model in a separate private question, but we have found an intermittent issue when using the Object.SetProperty() method when trying to set the EndLocation property of a Conveyor. We don't know the cause of the issue yet, but we're still digging into it.

5 |100000

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