question

Xabier A avatar image
0 Likes"
Xabier A asked Xabier A commented

Initially populate Global List from database

My concern is how to populate a Global List with labels from the information of a database.
I have been able to do with a global table and also in a Global List with an itemflow element, but no way to add rows/lines in a Global List without creating an item. The problem is that the items appear in the model
Is there another way to populate (add rows/lines) a Global List without creating an item?
(Ah! I am also going to repopulate the Global List during the simulation)
Any help will be appreciated.
GlobalList.fsm
Thanks in advance.

FlexSim 20.1.2
flexsim 20.1.2global list
globallist.fsm (29.9 KiB)
· 9
5 |100000

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

tannerp avatar image tannerp commented ·

@Xabier A,

What kind of information are you storing in the list? I think lists are great for storing items, locations, etc., but in your case, you might be able to just store the information you need in a Global Table. Have you looked at that?

If you want to stick with the list, you could consider using the "Initial Content" to add things to the list at the beginning of the model. But again, these entries would generally be items or objects of sorts and not just information.

0 Likes 0 ·
tannerp avatar image tannerp commented ·

To answer your question about adding rows/lines without creating an item: you can use an On Reset trigger for the model. Just another idea.

0 Likes 0 ·
Xabier A avatar image Xabier A commented ·

Thanks for the answer.

What I know to do in Flexsim is: create a source schedule with a table that I push to a list that is used by an operator to do the pickings from a rack (pull). The info is bay and level.

I know how to populate a global table with the info from a database.

My problem is, or I create a global list and populate it with the info of the database to use the rest of the code(my first question). Or another one that is how to do pickings with the info of a global table from a process flow.

Remember that I am going to repopulate the list during simulation.

Thanks in advance

0 Likes 0 ·
tannerp avatar image tannerp Xabier A commented ·

This idea of order picking is commonly modeled using Process Flow.

I created an example that populates a list using Process Flow tokens. You can make this as elaborate as you want, assigning bay, level, slots, types, etc. to the items. The key is that the items are pushed to a list.

Then, the operator pulls the items from a list (you can pull based on certain bays, slots, etc. using the list query feature) and unloads them at a queue or other destination.

This is a basic model, but is this what you're after?

globallist (1)_1.fsm

0 Likes 0 ·
globallist-1-1.fsm (54.2 KiB)
Xabier A avatar image Xabier A commented ·

Thanks for the effort.

Sorry, this is the example I have already "coded" (something similar). I have already done this example, is what I have tried to explain previously.

What I need is the first step: how to populate the list (the one you use in your example) with the information from a database. For this issue, in the model I have provided, I have tried to create a row/line to insert into a global list using flexsim in several ways but no one works properly. The only one that works is the one that creates an itemFlow, inswrts it in the list but draws it in the model. My problem to solve is:

1.- How to insert a row/line into a global list with the information brought from a database using flexscript. (See the tries in the model). Remember that Iam going to populate it during simulation time.
2.- If the previous one doesn't work, I have successed populating a global table with the information of a database but I can't link it to a list (I have read that is not possible).

Thanks again.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Xabier A commented ·

If your list value is an item, you need an item in your model. Then you must create one. If your database has got an ID for every product, then you can push this ID as a value onto a list. But then this is not automatically an item. It is still an ID. If you want to get an item, then you create one in your model by this ID.

0 Likes 0 ·
Xabier A avatar image Xabier A Joerg Vogel commented ·

"you can push this ID as a value ", I think that this is what Iam asking for, try to push "something" to a List but Iam not able.

Sorry for my lack of knowledge.

0 Likes 0 ·
Show more comments
Joerg Vogel avatar image Joerg Vogel Xabier A commented ·

Another approach consists of pushing tokens onto the list. Later if you have items in your model you can push items. The label structure is the same.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Joerg Vogel commented

If you want a total independent list similar to a table, you can do this with push arguments. The value can be anything. A number is just fine.

List(“myList”).push(1,0,“aText“,2.345)

1 = the value, as standard you find often here item, but it can be anything

0 = partition ID

“aText” = first push argument as string

2.345 = second push argument as floating number

You need to Add Fields in your list as Push Arguments

· 2
5 |100000

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

Xabier A avatar image Xabier A commented ·

I appreciate a lot the efffort and the attention paying to this topic.

The added code I have also try but I do not "arrive" to the labels, thats my problem.


0 Likes 0 ·
1594370367068.png (22.6 KiB)
Joerg Vogel avatar image Joerg Vogel Xabier A commented ·

But there are different types of fields you can add:

But you won't be able to change the caracter of the list anymore - a push arguments stays a push argument and it won't be a label.

1 Like 1 ·