Adding Rows in Write Block

Post Reply
velcro
Posts: 25
Joined: Thu Apr 15, 2010 8:49 am
First Name: Steve
Last Name: Cohen

Adding Rows in Write Block

Post by velcro » Fri Nov 15, 2019 12:45 pm

I am feeding data into a Write Block, which is putting the data in a Global Array.
All the data is going into the first row and overwriting.
I can create an incremental counter to increment the Row input to get a new row every time, but is there a built-in way to create a new row for every new piece of data?

Thanks

ceciledamiron
Posts: 55
Joined: Wed Jul 02, 2008 12:10 pm
First Name: Cecile
Last Name: Damiron

Re: Adding Rows in Write Block

Post by ceciledamiron » Tue Nov 19, 2019 12:53 pm

Hello,

In the Option table of the block you need to:
-select; Input data: is added to destination data
and:
-check the option "Expand number of rows in the data destination, if necessary"

Cecile

velcro
Posts: 25
Joined: Thu Apr 15, 2010 8:49 am
First Name: Steve
Last Name: Cohen

Re: Adding Rows in Write Block

Post by velcro » Tue Nov 19, 2019 1:14 pm

Just to clarify:

I am writing values to a global array, and I am using the Value Write, not the Item Write, which seems to only write to databases.

I made a simple model with Create, Set, Get and Exit. I fed a random number into a parameter on Set, and fed the output of the Get for the same parameter to the Write block.
I checked the boxes as suggested.

The "Input data: is added to destination data" simply adds the numerical result to the single cell.
"Expand number of rows in the data destination, if necessary" does not solve the problem. There is a single cell in the global array.

If I add an information block inline and feed the # connector into the R connector of the Write block, it does expand number of rows. I was hoping there was a simpler way.

ceciledamiron
Posts: 55
Joined: Wed Jul 02, 2008 12:10 pm
First Name: Cecile
Last Name: Damiron

Re: Adding Rows in Write Block

Post by ceciledamiron » Wed Nov 20, 2019 9:30 am

Hello,

Sorry for the misunderstanding.
For some reason I cannot find your example model.

As a note, the use of Global arrays for model building is fading and unusual. It has been mostly replaced by the use of the Extendsim database.
It is likely that the options work with a database table but have not be tested with a global array.

Can you send your model to support@extendsim.com, we will look at your model and fix the Write block if it does not behave as intended.

Cecile Pieper

Post Reply