question

Bryan Suharik avatar image
0 Likes"
Bryan Suharik asked Adrian Haws commented

Number of Operators depending on item type from Global Table?? via code

Hello,

I thought i had the right command for my processor to choose the amount of operators needed depending on the item type that was on the processor.

setvarnum(bayrepair,"nrofprocessoperators",gettablenum("ProcessTimes",getitemtype(item),3));

This script seems to return a value of 0 as no operators move to the processors during the runtime.

ProcessTimes is the name of my global table.

IS this possible, or do i have to use an onentry trigger of some kind. if so, how would that code look? I'm a bit new and still getting the training wheels greased.

Thanks!

FlexSim 16.0.6
global tableoperatorprocessorcode
· 1
5 |100000

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

Jacob Gillespie avatar image Jacob Gillespie ♦ commented ·

Could you attach a model so we can check your code? Everything above looks correct.

1 Like 1 ·

1 Answer

·
Joerg Vogel avatar image
0 Likes"
Joerg Vogel answered Adrian Haws commented

You have asked this source code line in another question. The source code is a part of a source code string you are placing inside a process time function of a processor. Please test the functionality in the string with an easier content.

setvarnum(bayrepair,"nrofprocessoperators",2)

After that insert a print output console command which evaluates the stored value of the variable.

pd(getvarnum(bayrepair,"nrofprocessoperators "));

Then you look into the output console to check if the value is going to change. In the next step you print the value of the table ProcessTimes of one suitable row 3rd column to the output console by a command string in your source code for the process time function. Then you can be sure that asked code line is correct.

Then my following question is the last test.

Has you already add to the model structure a dispatcher object to transfer the Tasksequences to more operators as I mentioned in my answer.

· 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.

Bryan Suharik avatar image Bryan Suharik commented ·

Hi Jorg, yes i used the dispatcher as you recommended and that is working great! But i'm still unclear on how to assign the processors based on the item type stored in the global table.

Can you provide more details on how to do this with code?

Thanks!

0 Likes 0 ·
Adrian Haws avatar image Adrian Haws Bryan Suharik commented ·

@Bryan Suharik Have you found an answer or do you still need help?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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