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.

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.