question

MR avatar image
0 Likes"
MR asked Jason Lightfoot commented

OnBeginOffset in processflow

Dear all:

There are three attachment below. Name called "basicturntables" is the reference I want to use. I had using the code of OnBeginOffset to processflow.

Name called "use token" is assign labels to X Location, Y Location,...rotatewhiletraveling in event-triggered source, and let variables be token.xloc ,token.yloc in the code node. But it will have system console.v1654086703773.png

1654086691998.png

Name called "use param" is didn't assign labels to X Location, Y Location,...rotatewhiletraveling in event-triggered source, and let variables be param in the code node. But it still will have system console.

1654086731064.png

While I am debugging, the results of variables using param will same as the results using OnbeginOffset in the trigger, which is the attachment called basicturntables.

basicturntables.fsmuse param.fsmuse token.fsm

FlexSim 20.0.10
conveyorflexsim scriptturntable
1654086691998.png (147.0 KiB)
1654086703773.png (145.2 KiB)
1654086731064.png (193.9 KiB)
basicturntables.fsm (57.7 KiB)
use-param.fsm (57.8 KiB)
use-token.fsm (61.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.

1 Answer

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

Here is some student level guidance:

  • Change your process flow to an object based one so that you can refer to 'current' as the basicTE (you can copy the activities across and edit the fields).
  • Add your BasicTE20 instance as a member of that process flow.
  • In the OnBeginTravel offset event triggered source activity assign the token label values
  • Check the "Override return value" on the event triggered source
  • Use an "AssignLabel" activity to write the kinematicDelay label to your token.
  • Use code of the label value to return the correct delay - using the code you have in "Rotate to the offset location.....etc". Preserve the default header and remove any duplicated local variables you have in "Rotate to the offset location....." code.
  • Change the references in that code to read token.xloc, token.yloc instead of param(1), param(2) etc as these are used by the default header (you do this correctly in UpdateKinematics so not sure why you're not doing the same thing in your "Rotate to the offset location..." code.
  • Add a "Finish" activity instead of a sink and select the "kinematicDelay" label as the value to be returned.

The OnBeginOffset section should look like this:

1654091949356.png


1654091949356.png (12.9 KiB)
· 18
5 |100000

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