question

j08j avatar image
0 Likes"
j08j asked j08j commented

How to control ASRS behavior

In my model, there are currently three items in the queue are waiting to be placed on the rack, and the rack already contains three items. I want to specify a sequence of actions for the ASRS vehicle using an array, for example: Array IO = [0, 1, 0, 0, 1, 0, 1, 0, 0], where 1 indicates moving an item from the queue to the rack, and 0 indicates moving an item from the rack to the sink. How can I implement this?
There is my model: asrs_IO.fsm

Thanks!

FlexSim 24.0.2
flexscriptasrsasrsvehicle
asrs-io.fsm (40.2 KiB)
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

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered j08j commented

here is an example

Tasksequences are pushed to a list. In this code there is a message to pull a tasksequence from this list again. On Message a query string is edited to pull an entry matching a field of destination classified by 1 or 0 with a first element of an array. Pulled Tasksequence is moved to and dispatched in ASRS.

Queue strategy of Tasksequences is straight FIFO.

asrs-io_JV.fsm


asrs-io-jv.fsm (42.0 KiB)
· 6
5 |100000

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

j08j avatar image j08j commented ·

I hope that ASRS can act according to the sequence I gave, but my current model cannot execute it.

This is the model I modified: asrs_IO.fsm

0 Likes 0 ·
asrs-io.fsm (48.2 KiB)
Joerg Vogel avatar image Joerg Vogel j08j commented ·

@j08j , there does not exist a global list with a expression field name "bound", that is reponsible to identify any pushed tasksequence. The expression returns values of 1 or 0 to be the right loading station accordingly your condition sequence.

You need to add a tasksequence list to your model.

Currently, there is not a method introduced, that stops this model, if a requested loadstation is not available in list of tasksequences.

Please investigate my attached model thoroughly.

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Joerg Vogel commented ·

Some improvements to the On Message code to make @Joerg Vogel's model work more as expected.

- Only remove the first entry of the array if the pull was successful.

- Do not create a back order for the pull (or change the code to handle the back order on the pull result if no value was pulled).

- Place the code in a loop, so it pulls as many entries as possible, to pick up any task sequences that might have been skipped when first pushed to the list, but are now of the right type.

- To prevent any error messages when the array runs out, I add an invalid value (-1) to the array once its empty.

int done = 0;
while(!done) {
    int valuebound = current.label1[1];
    string qrystr = "WHERE bound == "+string.fromNum(valuebound);
    TaskSequence pulledTs = List("TSList1").pull(qrystr, 1, 1, current, 0, LIST_DO_NOT_BACK_ORDER);
    if (pulledTs){
        pulledTs.move(current);
        pulledTs.dispatch();
        current.label1.shift();
        if(current.label1.length == 0) {
            current.label1 = [-1];
        }
    }
    else {
        done = 1;
    }
}


Edit:

Also wanted to add that you can get the same functionality without using a list by storing the task sequences in the tree of the ASRS and looping through them until the right type is found.

All this can happen in the "Use Transport" field of the queue and rack, making the message trigger redundant.

asrs-io-jv-fm.fsm

0 Likes 0 ·
asrs-io-jv-fm.fsm (42.3 KiB)
Show more comments