Module SDK creating a custom Task Sequence

Module SDK creating a custom Task Sequence

patricia_brenny_r
Not applicable
154 Views
7 Replies
Message 1 of 8

Module SDK creating a custom Task Sequence

patricia_brenny_r
Not applicable

[ FlexSim 22.2.2 ]

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?

Accepted solutions (1)
155 Views
7 Replies
Replies (7)
Message 2 of 8

SCHamoen
Advisor
Advisor

@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)


0 Likes
Message 3 of 8

patricia_brenny_r
Not applicable
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
Message 4 of 8

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

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);
0 Likes
Message 5 of 8

patricia_brenny_r
Not applicable

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
Message 6 of 8

jason_lightfootVL7B4
Autodesk
Autodesk
Yes I wrote the FlexScript initially, but try using the scope resolution operator '::' to access the static method.
0 Likes
Message 7 of 8

patricia_brenny_r
Not applicable

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

1663340352999.png


0 Likes
Message 8 of 8

Jeanette_Fullmer
Community Manager
Community Manager

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