question

Chris Ligetti avatar image
0 Likes"
Chris Ligetti asked Matthew Gillespie answered

Combiner On Reset exception

I have a combiner where I am resetting some variables on the On Reset Trigger (target quantities from specific ports and target component sum). The flexscript I show below seems to work correctly, however, I am wondering why I am getting an exception in my system console (but not when I apply the changes on the trigger):

exception: FlexScript exception: MODEL:/Combiner>variables/resettrigger

Here is the flexscript. Any idea what the issue is?

Object current = ownerobject(c);

current.find(">variables/componentlist/From Input Port 2/1").value = 0; 
current.find(">variables/componentlist/From Input Port 3/1").value = 0; 
current.find(">variables/componentlist/targetcomponentsum").value = 0;
FlexSim 17.0.0
combinerflexscript error
5 |100000

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

1 Answer

Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered

The targetcomponentsum variable isn't inside the componentlist variable. The path should look like this:

>variables/targetcomponentsum

The error message isn't very helpful. I'll add an item to the dev list to see about improving the error message when trying to access data on an invalid treenode.

5 |100000

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