question

Patricia_brenny R avatar image
2 Likes"
Patricia_brenny R asked Jeanette F commented

Module SDK creating a custom Task Sequence

Hello there,

I'm developing a behavior for a custom machine and I need it to create a Task Sequence which an opreator will interact with a flowitem being processed (Take it for a trip, delay and return it).

I started running into problems while using the Task Sequence class (as recommended by the documentation) to generate and dispatch these tasks via DLL, getting the following excpetions:

1663278663847.png

1663278677851.png


I've also tried using the deprecated methods, with no results.


What may be causing this behavior? How do I sucessfully create and dispatch Tasks Sequences using the DLL?

FlexSim 22.2.2
tasksequencedllcustom machinecustom behaviormodulesdk
1663278887036.png (379.1 KiB)
1663278898372.png (329.0 KiB)
· 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.

Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Patricia_brenny R, was one of Patricia_brenny R's or Jason Lightfoot's or Steven Hamoen's answers helpful? If so, please click the "Accept" button at the bottom of the one that best answers your question. 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 unaccept and comment back to reopen your question.

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

The create() method is static so I think you need to use is against the class and not the instance.

TaskSequence inspection=TaskSequence::create(operador,1,0,1);

in FlexScript it's:

TaskSequence inspection=TaskSequence.create(operador,1,0,1);
· 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.

Patricia_brenny R avatar image Patricia_brenny R commented ·

hmm we tried that and got this, then proceeded to use it against the instance which created no error. Also don't understand why.


1663332966917.png


0 Likes 0 ·
1663332966917.png (108.0 KiB)
Jason Lightfoot avatar image Jason Lightfoot ♦ Patricia_brenny R commented ·
Yes I wrote the FlexScript initially, but try using the scope resolution operator '::' to access the static method.
0 Likes 0 ·
Patricia_brenny R avatar image
0 Likes"
Patricia_brenny R answered

I could resolve it by using the deprecated methods as follow:

1663340352999.png



1663340352999.png (80.1 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.

Steven Hamoen avatar image
0 Likes"
Steven Hamoen answered Patricia_brenny R commented

@Patricia_brenny R Have you used the C++ debugger to check all the variables and what their value is? I don't see anything really strange. Except maybe that I think that holder is the current machine so I think you can write: treenode currentMachine = holder; (which would make it shorter and faster)


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

Patricia_brenny R avatar image Patricia_brenny R commented ·
Yes, I've used it and it has stored all the values that were supposed to be stored, just this "access denied" message when using the add task method for no apparent reason. We implemented the currentMachine like that as to odd out any other issues but it doesn't seem to be the problem.
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.