Head (before)

Count specific label in Activities/Queues — SIMUL8 Community Forum

Head (after)

Ask the SIMUL8 Community

Content (before)

Count specific label in Activities/Queues

SeMSeM
Created at
in Community support

Hi,
is there a way to count specific labels in Activities and Queues via Visual Logic?
I found the "Get label total in object" command, but it just returns how many main work items are in the object.

Example Model:

https://i.ibb.co/YNnsFXR/Model-SIMUL8.jpg

Start Point - Label Action:

https://i.ibb.co/Jm8nKhw/Work-Entry-Point-Label-Action-SIMUL8.jpg

Current content Queue:

https://i.ibb.co/RSF4X0J/Queue-Current-Content-SIMUL8.jpg

I was thinking about using the routing out function and built a queue for each material number, but therefore my model would be to confusing regarding to many different material numbers.

https://i.ibb.co/hsqcTdB/Group-SIMUL8.jpg

Can anyone help me please?
Best regards,
Sebastian



Comments

  • Was this answer helpful?


    0

    Hello! You can build some code on that. I have an example for a Queue. Open a new Visual logic section and write in the following:
    LOOP 1 >>> i >>> Queue for Activity 1.Count Contents
    Select Current Work Item Queue for Activity 1 , i
    IF lbl_type = 1
    SET gbl_Count_Type1 = gbl_Count_Type1+1

    This loops through the Objects of a Queue, selects an item (i is used as a variable for looping, but on the second command is used for defining the position of the selected item in the Queue), checks whether the type of the selected item, and uses a counter variable for summing up the items with a Label value of 1.

    Cheers :)

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Attach file
Attach image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Content (after)