close the input of a processor - error

close the input of a processor - error

leona_e
Not applicable
78 Views
2 Replies
Message 1 of 3

close the input of a processor - error

leona_e
Not applicable

[ FlexSim 17.2.4 ]

Hello,

I created a model to test the closeinput command model-close-input.fsm, but I get the following error "FlexScript exception: Property Reihe not available for Variant with value NULL. Must by a treenode type Variant. at MODEL:/Tools/ProcessFlow/ProcessFlow/Custom Code>variables/codeNode".

I added the output port number in a label called "Reihe" and a second label called "Stoerung" (with 95 % = 1 and 5 % = 2). If an item enters the list with value 2 in the label "Stoerung", it is pulled from list "Boxen im System" and is pushed to the list "Auslagerung". The next step is to evaluate the label "Reihe" and to close the input of the processor, which processed the Box.

How can I eliminate the error?

Thank you very much!


0 Likes
Accepted solutions (1)
79 Views
2 Replies
Replies (2)
Message 2 of 3

joerg_vogel_HsH
Mentor
Mentor
Accepted solution

Hello Elona,

there are problems to cope with.

  1. The Pull From List activity might not pull anything from the list. Then There is nothing that can be pushed. An conditional Decide activity between Push To and Pull From List filters the empty pulled data tokens.

    token.pulled.length > 0
    
    or shorter
    token.pulled.length
    

    a value > 0 is logical true.

  2. In the second Process you need a reference or pointer to the item. The Event Triggered Source reactes in the push to list activity on the On Entry event. The token, which triggers the event, is the entering token in Pull From List activity.

    10277-identify-token-of-event.jpg

    I set a label to get access to this token (I call the label "pullerToken"). pullerToken contains a label, too, pointing to the item. Its name is "pulled" which is set in the Pull From List activity. Because the pull from List activity can return an array; I have to decide which item I want to get a reference to. First reference in the array is token.pullerToken.pulled[1] . The last can use a method: token.pullerToken.pop().
    In a script could this be:
    Array releasingItems = token.pullerToken.pulled;
    Object item = releasingItems.pop();
    

At the end there is missing a label at the item. It is the Label "Reihe". You can add a Set Label template in the source of the 3D model.

model-close-input-1-jv.fsm

0 Likes
Message 3 of 3

emily_hardySTLSK
Autodesk
Autodesk

@Leona E, did this resolve your question?

0 Likes