question

mary avatar image
0 Likes"
mary asked Jason Lightfoot edited

Item Id to pull from global table using code

Hi I have created a model where I assigned Id to each item. I want to send those item to processor referring to global table Id how can I do that with coding. Please help to write code.

post.fsm

FlexSim 20.0.10
global tablecode
post.fsm (27.0 KiB)
· 3
5 |100000

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

Kavika F avatar image Kavika F ♦ commented ·
Hey @mary, could you clarify your intentions for the model a little? I'm struggling to understand your desired outcome. From what I understand, you want to assign flowitems the ID numbers from the global table "mytable" based on the order they come from the source. For example, the first flowitem will get the ID "5", the second would be "4", third is "1", and so on.

The next part is where I'm mostly confused. Do you want to send the flowitems to the processor in the order of their IDs? (Like after labeling them all, you send the flowitem with ID "1" first, then ID "2", etc.?)

Finally, when you say "help to write code" are you referring to actually coding it (with FlexScript) or using Process Flow? Thanks for helping me understand!

1 Like 1 ·
mary avatar image mary Kavika F ♦ commented ·
I have created 5 Parts in source1 and in trigger I am generating part ID. Example for part1 it is 1 for part 2 ID is 2 etc.. So now with those assigned id i need to pull item in order to global table. so my first pull Id will be 5.
0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @mary,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·

1 Answer

·
Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

It's another pull requirement task but this time you can use the processor stats to determine which row of the table to read:

1654513931825.png

post_jl.fsm


1654513931825.png (10.2 KiB)
post-jl.fsm (25.7 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.

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.