ATTENTION

This 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

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 09-29-2008
Matthias Hofmann Matthias Hofmann is offline
Flexsim User
 
Join Date: Jun 2008
Posts: 15
Downloads: 1
Uploads: 0
Thanks: 11
Thanked 0 Times in 0 Posts
Rep Power: 146
Matthias Hofmann is on a distinguished road
Default Import of data in schedule of a source

Hello,

I want to import data directly from a Access database into a schedule in a source. But I don't know how to do it. Is dbimportnode the correct command? And how can I add the typical schedule attributes as for example itemtype or quantity to the schedule table?
I'm able to import data from a database in a global table, but that doesn't help with a schedule.

thanks in advance for all answers,

Matthias
  #2  
Old 09-29-2008
Lars-Olof Leven Lars-Olof Leven is offline
Flexsim Distributor
 
Join Date: Aug 2007
Location: Sweden, Borlnge
Posts: 312
Downloads: 278
Uploads: 2
Thanks: 300
Thanked 256 Times in 139 Posts
Rep Power: 330
Lars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to beholdLars-Olof Leven is a splendid one to behold
Default

Hi Mattias,

I normally not use database connection, but I think you should do something like this:

Code:
treenode schedule = getvarnode(current,"schedule"); 
dbimportnode(schedule,startrow,startcol,numrows,numcols)
Put the code in the OnReset trigger in your Source or replace current with
your Source.

Lars-Olof
The Following User Says Thank You to Lars-Olof Leven For This Useful Post:
Matthias Hofmann (10-07-2008)
  #3  
Old 09-29-2008
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

Hello Matthias,

I don't know how good you are with flexscript but actually the schedule of a source is nothing more than a table based on a variable node. Just as the global tables are base on a variable node.

if you create a pointer to that particular node:
treenode Schedule = getvarnode( current, "schedule");

you can use all the table commands, such as:
settablesize, settablenum etc..

So if you want to set for instance the quantity on the first line you can write:
int Quantity = 11;
settablenum (
Schedule , 1, 4, Quantity );

Of course the name should be changed with "settablestr" ofcourse!

So now you could read in your db in a global table and then create the schedule based on that global table.

Hope this was of any assistance.

Steven
The Following User Says Thank You to Steven Hamoen For This Useful Post:
Matthias Hofmann (10-07-2008)
  #4  
Old 10-07-2008
Matthias Hofmann Matthias Hofmann is offline
Flexsim User
 
Join Date: Jun 2008
Posts: 15
Downloads: 1
Uploads: 0
Thanks: 11
Thanked 0 Times in 0 Posts
Rep Power: 146
Matthias Hofmann is on a distinguished road
Default

Thanks for your answers. They were very helpful.

I tried now both methods and the method with the table commands works. The only thing I want to mention is that you have to assign the correct data type to each cell/node before you write data in that cell. I used the command nodeadddata for that.

I didn't managed to get the data imported with dbimportnode, but I don't know why. Maybe I didn't tried hard enough.


Thread Thread Starter Forum Replies Last Post
Excel Data Import Sung Kim Q&A 2 07-16-2010 10:41 AM
how to import excel in source? qin tian Q&A 6 01-11-2010 10:58 PM
Problems with import of data from a database Matthias Hofmann Q&A 1 09-26-2008 09:42 AM
Help on flexsim data input into source and processer TanSiying Q&A 4 10-30-2007 07:55 PM
How to use the actual date/time data in Arrival Schedule Mode of Source syseo Q&A 0 10-12-2007 08:22 PM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.