question

Vikram Ramnath avatar image
1 Like"
Vikram Ramnath asked Vikram Ramnath commented

how to access the label of an item on a trailer using Process Flow

Hi,

I am modeling a tugger application for material delivery, in which the delivery location is defined in an item label. If I define the trailer using codes, I am able to access the data. However, when I try the same in Process Flow, I get errors.

Please let me know how to access item labels in Process Flow. A sample model is attached for your reference.

agv-trailer.fsm

FlexSim 17.1.2
process flow
agv-trailer.fsm (37.5 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.

Raja Sekaran avatar image
2 Likes"
Raja Sekaran answered Vikram Ramnath commented

@Vikram Ramnath

I have attached the model with some changes, you can access label of an item by sending a message.

In the attached model,

Store >> On Entry trigger, I sent a label "Station" as message parameter to a current object.

Then Store the label value in an int variable.

In Process flow >> Wait for event activity, I access and assign the label value as "Station".

In Process flow >> Assign Labels, Based on the Station label value, I have defined the destination object

Then you can set the destination of agv based on Destination label. I hope this will help you.

agv-trailer.fsm agv-trailer-v1.fsm


store-on-entry.jpg (63.1 KiB)
wait-for-event.png (17.5 KiB)
assign-label.jpg (54.2 KiB)
agv-trailer.fsm (39.1 KiB)
agv-trailer-v1.fsm (38.7 KiB)
· 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.

Vikram Ramnath avatar image Vikram Ramnath commented ·

Hi Raja, thanks for your post. It gives the solution to what I was looking for.

1 Like 1 ·
Sam Stubbs avatar image
2 Likes"
Sam Stubbs answered Vikram Ramnath commented

The problem is that you can't load a null reference. So in your Process Flow logic you have the AGV "load" the first item in the Store. But then it goes to a decide activity to see if there are any items left, so it cycles around to the Load activity. The problem here is that you are creating a token for each item entering the the store, so you have two tokens both trying to load two items. Eventually it cycles back from the decide activity to the Load activity, trying to load an item that isn't there. So it returns the error saying that it can't find the item to load, because there is none.

Instead it seems like the logic you'd want to use is a List. Where items come into the store are pushed to a list, and then they are pulled by the agv and loaded/unloaded. Would this work for your situation?

I've included an example of what I'm talking about.

agv-trailer-example.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.

Vikram Ramnath avatar image Vikram Ramnath commented ·

Hi Sam, thanks for the quick response. I will look into using Lists and get back to you if I run into any issues.

0 Likes 0 ·