question

Maria B17 avatar image
0 Likes"
Maria B17 asked Jeanette F commented

Add new process in Multiprocessor with Flexscript

I'm setting up an automatic reading of a customized document with FlexScript, and part of the work involves assigning the numbers from a global table to the processors.

I have cases where a single station performs more than 2 processes and I would like to use the multiprocessor for this.

but I couldn't find anything that helps me add more than one process to the multi processor and assign their values via flexscript, could you help me?

FlexSim 24.0.0 beta
flexscriptprocesstimemultiprocessornewprocess
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·

@Maria B17, please investigate a multiprocessor with one or a few processes and a multiprocessor with one more process in its model tree. Then you are able to replicate the mechanism to customize a multiprocessor by process flow or Flexscript.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Maria B17, was Matthew Gillespie's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·

1 Answer

·
Matthew Gillespie avatar image
1 Like"
Matthew Gillespie answered

There isn't a single function to do this yet, but you could use something like this:

treenode multiprocessor = Model.find("MultiProcessor1");
treenode optable = getvarnode(multiprocessor, "optable");

// Add new operation variable
treenode newOperation = optable.first.copy(optable);
int num = newOperation.rank;
string processName = "Process" + num;
newOperation.name = processName;

// Add new state to the MultiProcessor state profile
treenode profile = applicationcommand("enumeratestatelist", multiprocessor, 1);
treenode newProfile = profile.subnodes.add();
newProfile.dataType = DATATYPE_NUMBER;
newProfile.name = processName;
newProfile.rank = newOperation.rank;
applicationcommand("commitstatelist", multiprocessor, 1, profile);
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.