ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
#1
|
|||
|
|||
Data Bundles Help
Hi All,
I am trying to get information regarding data bundles. How do they work, how to setup a data bundle, read and writing from them and then also exporting them to excel afterwards and also what is the benefits? I have a very large model at this stage that record massive amounts of data during the simulation, my model executes extremely slow at this stage due to the large global tables that I am forced to use. Thus the requirement for a better method to store data. Any help would be much appreciated. |
#2
|
|||
|
|||
Feedback from Flexsim support, Thanks Scot
Bundles are definitely the way to go when you have a large amount of data. They run faster and take much less memory than the default tables. They function very similar to SQL tables if you're familiar with that. If not, don't worry about it.
In order to use bundles, you're going to need to use a lot of code in 7.5. (In our new release 7.7 that's currently in beta, we've integrated bundles with Global Tables so you only have to check the option and everything else will work.) The commands concerning bundles can be viewed by typing "bundle" into the Command Help, but I'll go over the important ones here. In the Tree view, expand the Tools folder and the GlobalTables folder inside of that. Create a blank node by selecting the last node in that folder and pressing the spacebar. Name it whatever you want your table to be named. Right click on it and select Node->Add Bundle Data. You'll be able to access this node by calling the node("/Tools/GlobalTables/nodeName", model()) command. Before you add any actual data to this node, you'll need to set up the bundle table inside of it. You do this by using the addbundlefield command. A field is a column in a table, and an entry is a row. Every value in a field must have the same datatype, string or number. addbundlefield will add one column at a time. After you've added all the columns, use addbundleentry to add the desired number of rows. After you've added an entry to a bundle, you can't add any more fields, so you'll need to use clearbundle to reset it if you need to add more fields. The script window or an OnReset trigger would be a good place to do this. Now that the node is set up, use setbundlevalue and getbundlevalue to set or get the data inside of the table. The normal table commands won't work with bundles in 7.5. (With 7.7 they work fine) If you're not familiar with FlexScript, using bundles will probably be very difficult for you. If you are, though, they're not bad to work with. The speed up to your model will be very significant. To export, the easiest way is to open up the Excel Import/Export Interface, go to Export, and change the table type to Other. After you select your node you'll be able to export the bundle in an Excel format. If you need some other format, you'll need to write your own export script using getbundlevalue. I'd write the values to the output console and copy/paste to a text file from there. |
The Following 5 Users Say Thank You to Ian Collins For This Useful Post: | ||
sagar bolisetti (08-04-2015) |
Tags |
data bundles, exporting to excel, large data |
Thread | Thread Starter | Forum | Replies | Last Post |
how to set the data of the source | west zhang | Q&A | 4 | 12-05-2011 01:14 AM |
data display | Alex Christensen | User Development | 3 | 10-06-2011 12:25 AM |
Data integration | Unregistered | Pre-sales Questions | 4 | 07-25-2010 12:14 AM |
data structure | juan alberto | Q&A | 1 | 09-23-2009 05:21 AM |
data from different objects | bsantens | Q&A | 2 | 05-13-2009 09:31 AM |