question

Kuo Lien avatar image
0 Likes"
Kuo Lien asked Julie Weller commented

Syntax error in FlexSim Script

I input the program code in FlexSim Script, but there are syntax errors all the time, can you help me to solve it?

0524model.fsm

FlexSim 22.2.0
codemodelscript
0524model.fsm (154.8 KiB)
· 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.

Julie Weller avatar image Julie Weller commented ·

Hi @Kuo Lien, was one of Jason Lightfoot's or Joerg Vogel'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 ·
Jason Lightfoot avatar image
2 Likes"
Jason Lightfoot answered

Processor3 only has one output port so it doesn't need a sendtoport trigger - you should delete 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.

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Joerg Vogel edited

send-to-port-depending-on-subnodes-length.jpg

currently this function lets items send to a port number

for true:

Model.find("StraightConveyor12").subnodes.length, which is equal to the number of items on straightConveyor12. For example there are 2 items on this conveyor, then the output port is 2 where the is going to.

for false:

Model.find("DP9").subnodes.length which is equal to number of subnodes of this decision point. I assume the value can be in a range of [0,1]. A result of 1 send involved item to port 1. 0 sends an item to any available port.

I don't know what you want to accomplish in the dynamically choosing of output ports. Perhaps you can describe what it is.


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.