question

Cale H avatar image
1 Like"
Cale H asked Cale H commented

Consuming material on conveyor workstations

assembly-conveyor-wsp.fsm

We are trying to model a conveyor station where parts are loaded into an assembly (simulated by a container flow item loaded upstream). We have the upstream process for the parts set up to output into a sink located under the workstation on the conveyor. The output of the processor is closed at reset and after exit to simulate the processor waiting for the conveyor to be ready to receive the part. Once the assembly is in position (on entry into the conveyor station/decision point), it sends a message to the processor to open its output ports and the operator then transfers the part to the sink, effectively "consuming" the material. The station stops the assembly at the station and waits for the message from the sink to resume.

The issue we are having is that the assembly (container flow item) cannot be resumed on message from the sink when the part was consumed (on entry at the sink). In attempting to use the same style of code that was used to stop the item to resume it, we get the following error/exception:

time: 43.701231 exception: FlexScript exception: Invalid item in Conveyor.itemData[] call at MODEL:/DP1>variables/localType/onMessage

We also tried using a station with closing input and output ports, however the item never even stops at this station. Attached is the model.

Our preferred approach would be to be able to set up the station to act as a combiner, but that doesnt seem possible. Additionally, the station is desired to be portable (i.e. placed into a library, inserted and ports connected, as oppose to re-doing all of the control work every time). The other approach we looked at was to use processors and combiners connected by conveyor to depict the work, however, this is more difficult to adjust and doesnt capture the indexing time into and out of stations or the operators travel and unload time as well.

FlexSim Version 17.1.2 (not an option from drop down menu)

FlexSim 17.0.12
conveyor station
5 |100000

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

Raja Sekaran avatar image
0 Likes"
Raja Sekaran answered Cale H commented

Hi @Cale H

When you are storing a item data to the pointer label named as ItemInConveyor in OnArrival trigger of Decision point, set the value as item to that label. Then you can access the item by using the below one in OnMessage trigger

Object item = current.ItemInConveyor;

Or, you can directly access the item that is currently associated with the decision point by using the below one in OnMessage trigger

Object item = current.activeItem; 

Here are the models with the changes.

assembly-conveyor-support.fsm

assembly-conveyor-support-1.fsm

Thanks


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

Cale H avatar image Cale H commented ·

Thank you both. Raja your second solution is probably the most elegant way it can be done and what I was looking for. We'll use this in the future.

0 Likes 0 ·
Cale H avatar image
0 Likes"
Cale H answered Emily Hardy converted comment to answer

Yes. The decision point runs into the same issue. The on arrival trigger supplies the item as a parameter and so it can easily be stopped. However I cant find a way to store a reference to the item (label or otherwise) to then reference it in the on message trigger. On message doesnt provide the item as a parameter, so there's no means to easily resume it. There's the potential to use process flow, however given that it is a conveyor workstation, I dont know how I would make that easily portable. The only other option I would see would be to make the conveyor stations individual sections and stop and resume the motors, however with that I get an error as well: "

time: 15.000000 exception: FlexScript exception: Label property motor retrieved on /Conveyor2. Label does not exist. at MODEL:/DP2>variables/localType/onMessage"

If you have an example where you've used decision points to stop and resume, that would be helpful. Attached is a model with a couple different attempts to use decision points.

conveyor-station-rev-3.fsm


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

Joerg Vogel avatar image Joerg Vogel commented ·

You can put the item reference into the message. But the reference must be converted to an number. The command is: tonum(item-reference). You place this number in one of the three parameters of your message. In the OnMessage Trigger you evaluate the message parameter by the command msgparam(1) for the first parameter, or msgparam(3) for the third parameter. Then you convert this number back to a node reference by the command tonode(number of the converted item-reference).

Object or Trigger sending the message

double itemAsNumber = tonum(item);
treenode receiver; // set reference to the receiver of the message
double delay = 123.3;// delay time of the message
senddelayedmessage(receiver, delay, current, itemAsNumber);

OnMessage-trigger of the receiver

Object item = tonode(msgparam(1));

As an alternative you can set the transmitter of the message to the reference of the item. But then you can not identify the object which has contained the message command originally.

senddelayedmessage(receiver, delay, item);

OnMessage-trigger of the receiver

Object item = msgsendingobject();
0 Likes 0 ·
David Seo avatar image
0 Likes"
David Seo answered

@Cale H

Did you try to solve your issue to use the decision point replacing with the station?

The decision point can stop and resume the flow item according to your wish.

Your issue looks like to be solved if you try to use the decision point in the station location.

5 |100000

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

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.