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
|
|||
|
|||
Multiple access to a global table
hi everybody
I have some racks where each time a new item is inserted in the rack I need to record its arrival time etc in a table. The table is a global table and the problem is that apparently it happens taht two or more racks try to write in the global table and simulation is freezed adn table gets messed up. How can one manage the multiple accesses to the table? I aprpeciate any comment. best regards, |
#2
|
|||
|
|||
Only one event is executed at a time in Flexsim so they should never conflict like you seem to describe. I'd check your code using the debugger and step through your model looking at the eventlist.
|
#3
|
||||
|
||||
I´ve got regularly same problems. Last time i built up a counter of Items in spezific place. And there sometimes Values get negative.
This shouldn´t be possible anyway. We found out, that this happens because writing and reading from different objects allways brings strange results. Tryed it with using one central object with message trigger and different switch cases. But even this doesn´t solve it. As a fast solution we built a counter that gets all actuall results by a special time. But this is for different reasons a worse solution.
__________________
Hemmi |
The Following User Says Thank You to Sebastian Hemmann For This Useful Post: | ||
Shahin Gelareh (02-23-2012) |
#4
|
|||
|
|||
There is no problem in Flexsim with writing to a central area from multiple objects. The problem is likely to relate to how you've defined what should happen at certain events and the structure of the data you're using to record them. If you have examples where you think Flexsim is doing something that it shouldn't please feel free to post them here or send them to support.
|
#5
|
|||
|
|||
Well, I do not see where I said there is a PROBLEM with flexsim. I exaplained my observation and welcomed any comment --which indeed meant "constructive comments"!
Unless one can technically justify one's claims such as "Only one event is executed at a time in Flexsim so they should never conflict like you seem to describe." or "There is no problem in Flexsim with writing to a central area from multiple objects." based on some knowledge about the architecture of Flexsim and its implementation, I would suggest to not block the way of further communications by such statements. |
#6
|
||||
|
||||
OK, I said there are problems with flexsim for this task.
Can´t post the model here because of sensitive Data. Tried to build up an example model and found out that it only occurs, when changing size of involved table. So maybe this is the right hint!?
__________________
Hemmi |
#7
|
||||
|
||||
@ Shahin,
did you try the solution with sending a message with all informations to one object and writing to the table by using onMessage trigger!?
__________________
Hemmi |
#8
|
|||
|
|||
Sorry if I confused this.
So basically we know the commands to update tables work consistently and immediately. If they're not doing what you expected then maybe the sequence they get called is not what was expected. That's why I recommend using the debugger to check when the triggers fire; checking the event list to understand when you expect them to fire, and if that doesn't solve your problem, post an example here of what you're trying to do, or send it to support. Trying to be constructive and avoid confusion or doubt about what Flexsim is doing when writing to tables. There's currently only one thread in Flexsim 5.1.2 and that means only one action to write to a table can occur at a given point/ execution step. The tables are not like databases which serve multiple clients and might require locks, rollbacks and so forth. Last edited by Jason Lightfoot; 02-23-2012 at 08:04 AM. |
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post: | ||
Steven Hamoen (02-23-2012) |
#9
|
|||
|
|||
thanks for comments.
Sebastian: yes, that works fine as long as there is only one who writes to the table. Well, Jason knows that flexsim is using single thread therefore the problem should not be that two threads or more are accessing the table. if there is only one trigger then every thing is fine. it adds one row each time it gets called but if there are more ... The funny thing is that some time the row starts from the middle of another row instead of starting from the first cel in a new row. Jason, I had tried to put breakpoints and check the steps with no real gain. |
#10
|
|||
|
|||
Would it be possible to post your model or a small example for us to help figure out what's happening? Can you describe the requirement in a bit more detail too? It sounds like you need to add records (rows) to the table(s) and then also update the records that are already there - so at which events and with which values do you need them recorded/altered?
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Phil BoBo (02-23-2012) |
#11
|
||||
|
||||
Quote:
Please post an example model showing your problem so we can explain why your code is behaving how it is. |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
Shahin Gelareh (02-25-2012) |
Thread | Thread Starter | Forum | Replies | Last Post |
Plotting Global Table | shashanktrivedi | Q&A | 2 | 06-17-2011 05:50 AM |
Excel_Book_Name in Multiple Table Import | KelvinHo | Q&A | 1 | 01-14-2010 08:49 AM |
Multiple Table Excel Import problem | zhang xin | Q&A | 3 | 11-05-2009 05:31 PM |
Excel Multiple Table Import Problem | Bill Lank | Q&A | 2 | 12-12-2008 12:06 PM |
Can I make a column of a global table to type table? | qin tian | Q&A | 0 | 10-01-2008 09:27 PM |