question

Mike Mayer avatar image
0 Likes"
Mike Mayer asked Mike Mayer commented

Empty conveyors showing curr content 1

2020-02-12-15-21-18.png

I noticed that all of my empty conveyors show state "empty", yet have Curr content 1 in the statistics. There is 0 input and 0 output and the simulation is at time 0.0 i.e., it has not been run. Shouldn't a conveyor with nothing on it to show Curr 0?

Also, this FlexScript snippet returns a value of 1 on the same conveyor, even though it is empty:

Model.find("Conv 3_2_2").as(Object).stats.content.value

See attached screenshot.

FlexSim 20.0.2
conveyor content empty
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

tannerp avatar image
0 Likes"
tannerp answered Mike Mayer commented

Hi @Mike Mayer,

Could you upload your model so we can take a look at it? A newly-created, empty conveyor should have 0 as the current content as far as I know.

If you can't upload the model, maybe try looking at the conveyor in the tree to see if there are any subnodes. You can also check using this code to return an integer (which should be 0):

Model.find("myConveyor").as(Object).subnodes.length
· 2
5 |100000

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

Mike Mayer avatar image Mike Mayer commented ·

Thanks Tanner for the guidance.

You nailed it - there is indeed a subnode in every single empty conveyor in my model.

It's due to a trick I used to automatically place the name of the conveyor itself upon the surface of the conveyor as a Text item (and that text items shows up as a subnode because of how I did it).

The attached simple model shows 3 conveyors. The top two show the conveyor's name as text.

I did this by dragging-dropping a Text object (from Library > Visual > Text) onto the conveyor. Same as how one might drag objects on top of a plane as a way of grouping things together to make them easy to move and copy as a single group. I did get the warning popup after dropping the text item onto the conveyor "You are dragging the object into an object that does not usually act as a container. Click OK if you want to continue this action." Ignoring that warning, I forged ahead.

Then I put some FlexScript into the text item which simply assigns the name of the object (current.up.name) to the text item's value.

Once I've done that, the text sitting on the conveyor's surface automagically changes to the name of the conveyor itself. All I have to do then is copy/paste each conveyor as I continue building, and whatever name I give it will be reflected in the text sitting on the conveyor's surface. It winds up being a useful visual.

My main reason for this bit of conveyor naming sleight-of-hand, is that our shop floor conveyors actually have names with decimal points in them, like Conveyor 1.0.0, Conveyor 1.1.0, Conveyor 2.0.4, etc. Plant staff know each conveyor by those names, so it's a nice way for them to be come familiar with the FlexSim model more quickly, when I show it to them.

Since the FlexSim object naming does not allow any symbols except underscores (/+-.* etc. are not allowed), I do a trick inside the same text itself (FlexScript) to search and replace underscores with decimal points (periods). So in the conveyor you see named "Name With Decimal Points 3_1_4_1" is actually displayed with the text "Name With Decimal Points 3.1.4.1".

My workaround for the Content problem then, will be when I check for an empty conveyor (with subnodes.length == 1 for example) is to remember that my conveyors with no flowitems will actually have a value of 1 (which I will know really means "empty" or zero flowitems).

Or better yet maybe I do a "stats.input.value - stats.output.value" and if it's 0 then there's no flowitems on the conveyor at that moment. This works because the Input and Output stats are unaffected by the presence of the Text subnode, since I believe they are only doing a simple increment/decrement at the point of entry/departure of flowitems as they move along.

This also leads me to a couple future "Suggestion Box" items:

1. In the internal statistics-gathering for conveyors, perhaps only consider "flowitem" type subnodes in the "Curr" content calculations.

2. Consider including a new option in conveyor naming to show the name on top of the conveyor, maybe as a checkbox item. Also, as the conveyor is moved, stretched, and angled that the text will remain in-place and centered on the conveyor. With my trick, I can move the conveyor around and the text moves with it (because it's a subnode), but if I change the conveyor's length or angle it, I have to tweak the text too.

In any case I'm good to go for now, since I can easily work-around interpreting a "Curr 1" as actually an empty conveyor.

Thanks again.

conveyor-naming-example.fsm

0 Likes 0 ·
Braydn T avatar image Braydn T Mike Mayer commented ·

@Mike Mayer
Thanks Mike! Would you mind posting an "idea" with those suggestions? It makes them quite a bit easier to track.

Thanks!

0 Likes 0 ·