question

Pedro Ortelani avatar image
1 Like"
Pedro Ortelani asked Pedro Ortelani commented

Make a Custom FixedResource receive and release flowitem

Hello,

I am trying to make a FixedResource that simulates a path where flowitens can pass by.

The approach I am using is, I copied the BasicFR node inside the Library/fixedresources/ tree path and added it to my modules library path, them I changed the class node value to point the class inside my dll file. The connection with the dll is working, I tested it.

Connections with other objects are now working, but i can't get the flowitem to pass through my fixedresource.

I tried overriding the methods "onTransportInNotify" and "onTransportOutNotify" making them call the receiveItem and releaseItem methods, but couldn't make it work.

Any advices on what I could be doing wrong? What methods should I be looking at to make my FixedResource receive and release flowitem throught the DLL file?

Thank you!

FlexSim 20.0.2
module sdkfixed resource
· 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.

Pedro Ortelani avatar image Pedro Ortelani commented ·

By the time my source create the flowitem, the modeltime just stops because my fixedresource can't receive the flowitem.

1 Like 1 ·

1 Answer

·
Phil BoBo avatar image
0 Likes"
Phil BoBo answered Pedro Ortelani commented

Call receiveItem() in onReset().

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

Pedro Ortelani avatar image Pedro Ortelani commented ·

Thanks for the info, it is now receiving the flowitem.

Following the same logic, my guess would be that I have to put the releaseItem on the onTimerEvent method, right? I did override the onTimerEvent to call the releaseItem, but it didn't work.

1 Like 1 ·
Phil BoBo avatar image Phil BoBo ♦♦ Pedro Ortelani commented ·

You need to put releaseItem() in whatever event you want to release the item in.

In a Processor, it releases the item when it is finished its processing time.

In a Queue, it releases the item as soon as the item enters or once the batch is complete (if batching).

In your object, you define when it releases the item and when it receives the next item.

1 Like 1 ·
Pedro Ortelani avatar image Pedro Ortelani Phil BoBo ♦♦ commented ·

Understood, I'll take a look at the events and try to figure out the best option.

Thank you!

1 Like 1 ·

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.