question

Hailey Oh avatar image
0 Likes"
Hailey Oh asked Felix Möhlmann commented

Conveyor length and speed from global table

I'm trying to set conveyor horizontal length & speed using the global table. Each conveyor has been named and each row in GlobalTable2 has that conveyor name in the first column, speed in the 9th column, and length in the 11th column. I want to use columns 9 & 11 to set the speed and length of each conveyor using the conveyor names. I was looking around in the forum and tried to implement some of them to my model but I'm don't know how I would modify each method to fit my need. The part that is missing from other forums is the name matching part that has to happen for all conveyors (not just groups).

MHE_SIM_V0.2.fsm

FlexSim 23.0.2
conveyorglobal tableconveyor speedconveyor length
mhe-sim-v02.fsm (805.4 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.

1 Answer

Felix Möhlmann avatar image
0 Likes"
Felix Möhlmann answered Felix Möhlmann commented

Table().getRowByKey or Table().getValueByKey let you find the row/value where the specified column equals the given value.

Table convData = Table("GlobalTable2");
int row = convData.getRowByKey(token.Conveyor.name, "Name"); token.Conveyor.as(Conveyor).targetSpeed = convData[row][9];

Is there a reason why you change the speed after the start of the model and not on reset?

Also, do you plan to use the virtual length property to make the conveyors act as if they had the given length or do you plan to change the actual object size? In the second you would also need information about which conveyor connects to which other conveyor so you can adjust their locations based on the new sizes.

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

Hailey Oh avatar image Hailey Oh commented ·

Hi Felix, thanks for the answer.


1.When these conveyors are off, they are supposed to start only when the previous conveyor sees an object through the photoeye. Hence they have to start the simulation at the "motor stopped" state.


2. I don't fully understand the difference between virtual length vs changing the actual size, but I think it's the latter. If I were to change the horizontal length of a conveyor, it would change the length in the model and lose connection to one of the conveyors and I wouldn't want that. So you're saying I need to also specify which conveyor connects to which to make sure that the conveyors in the model stay together? Would I do that in process flow custom code (where I would change the conveyor length/speed)?

0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Hailey Oh commented ·

1. Stopping a motor will also automatically halt the conveyor that is connected to it. There is no need to stop the conveyor separately. Futhermore, the "Speed" property of the conveyor is independent from the state. So you could in fact set the speed on model reset. Stopping and resuming the motors will then have the conveyor toggle between stand still and the set speed.

2. Setting a virtual length will adjust the speed at which items move across the conveyor so the items take as much time to reach the end of the conveyor as if the conveyor had that length, regardless of its actual dimensions in the model.

If the length of time for which the photo eyes are blocked is not of concern, you can use this feature to adjust the system to behave as if all conveyors had the correct length without needed to move around any objects.

1694153584060.png

0 Likes 0 ·
1694153584060.png (2.4 KiB)