ExcelActiveX atom

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
GroepT
Posts: 4
Joined: Monday 25 April, 2016 - 16:47

ExcelActiveX atom

Post by GroepT »

Hi,

We have a question concerning the ExcelActiveX atom.
We want to read the data in the Excel-file as inter-arrival times in the source atom.
In total, we have 112 data (so 112 rows and 1 column).
Now we say in the source atom in the inter-arrival time field that: MyTable(1,1) and MyTable is the alias name for our table. However, when we run the model, the source creates products according to the first row only, and repeats this 112 times. So it takes always the same inter-arrival time. How can we take all 112 different times as our inter-arrival time?

Kind regards
User avatar
HarryBunnik
Posts: 362
Joined: Monday 07 February, 2011 - 11:22

Re: ExcelActiveX atom

Post by HarryBunnik »

Ha,

When you use MyTable(1,1) then it's indeed only the 1st row that is used. You'll have to find a way to update the row number based on what is handy for you.

You could use something like Input(c) instead of 1, which simply counts how many products have entered the sink. That way you automatically update this inter-arrival time. Another way may be to use dUniform(1, 112). Here you pick a random integer number between 1 and 112.

Cheers and success,

Harry
GroepT
Posts: 4
Joined: Monday 25 April, 2016 - 16:47

Re: ExcelActiveX atom

Post by GroepT »

Hi,

Thank you for the fast replay.

I used Input(c)+1 instead of 1 in the "inter-arrival time" box and in the "time till first product" i put MyTable(input(c),1) and it worked as I wanted.

Thanks again,
Kind regards
Post Reply