question

Robin Brunner avatar image
2 Likes"
Robin Brunner asked Robin Brunner commented

Coding BasicFR to use like a Processor

Hello Community,

I want to create my own FixedResource. Quite similiar to the Processor FR. I want to insert a custom 3D Shape to the BasicFR with a custom Load and Unload Position for the Task Executors. But I already fail at making a simple material flow through my BasicFR. I uploaded my actual progression here in a .FSM File with all the coding done by now. I can receive FlowItems, but not release them through my output port. Maybe can somebody explain what is wrong in my coding?

EDIT: Somehow I can't upload the files right now. Will upload them later!

FlexSim 17.0.0
codecustom codebasicfrrelease flowitem
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

Arun Kr avatar image
3 Likes"
Arun Kr answered Robin Brunner commented

Hi Robin Brunner,

The attached is a simple example of Basic FR.basic-fr.fsm

Basically, I used commands given below. You can also use location commands to set the position of the flow items and senddelayedmessage() to create processing delay.

  1. receiveitem(current);//current is receiving object
  2. releaseitem(item,1);//item is the received item

Furthermore, you can go through the manual to create a basic FR using process flow, which is really easy to model.

Regards,

Arun KR


basic-fr.fsm (18.3 KiB)
· 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.

Robin Brunner avatar image Robin Brunner commented ·

Thank you for your help @Arun KR,

I finally can release my items from my BasicFR. I coded the BasicFR to receive and handle 4 FlowItems at a time. But then if I want to release them all at the same time, everytime just one FlowItems goes out through my output port. I didn't really figured out whats the deal with the initialising "Object item = param(1);" at the start of every custom code. Has it something to do with setting up pointer on objects? How can I say for example FlowItem1 release now, FlowItem2 release in 5 seconds and FlowItem3 release when trigger "..." is fired?

I uploaded my progress. EDIT: Sorry. Upload is still not possible.

Regards Robin

0 Likes 0 ·
Arun Kr avatar image Arun Kr Robin Brunner commented ·

Hi Robin,

Object item = param(1);//Simple explanation

For example, if you are performing some logic in the on entry trigger of the Basic FR, then the above initialization will give the reference to the flow item, which enters at the time of execution of the trigger.

You may refer the current and item section of the user manual for deep understanding.

Again for releasing more than one flow item, you have to create a reference to the child flow items using the following command and release them(You may need a loop for releasing them together).

  1. Object FlowItem = current.subnodes[rank of flow item];

Regards,

Arun KR

2 Likes 2 ·
Robin Brunner avatar image Robin Brunner Arun Kr commented ·

Thank you for your hint and advice @Arun KR,

I finally figured out how the initialising works. I also can really recommend to read the User Manual's "Item and Current" section like you said.

Regards Robin

0 Likes 0 ·