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
FAQ Downloads Calendar Search Mark Forums Read

Q&A Using Flexsim and building models

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2012
Shahin Gelareh Shahin Gelareh is offline
Postdoctoral Researcher
 
Join Date: Sep 2011
Location: Polytech'Lille, France
Posts: 100
Downloads: 93
Uploads: 0
Thanks: 46
Thanked 3 Times in 3 Posts
Rep Power: 106
Shahin Gelareh is on a distinguished road
Default 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,
Reply With Quote
  #2  
Old 02-23-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 767
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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.
Reply With Quote
  #3  
Old 02-23-2012
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 313
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

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
Reply With Quote
The Following User Says Thank You to Sebastian Hemmann For This Useful Post:
Shahin Gelareh (02-23-2012)
  #4  
Old 02-23-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 767
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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.
Reply With Quote
  #5  
Old 02-23-2012
Shahin Gelareh Shahin Gelareh is offline
Postdoctoral Researcher
 
Join Date: Sep 2011
Location: Polytech'Lille, France
Posts: 100
Downloads: 93
Uploads: 0
Thanks: 46
Thanked 3 Times in 3 Posts
Rep Power: 106
Shahin Gelareh is on a distinguished road
Default

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.
Reply With Quote
  #6  
Old 02-23-2012
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 313
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

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
Reply With Quote
  #7  
Old 02-23-2012
Sebastian Hemmann's Avatar
Sebastian Hemmann Sebastian Hemmann is offline
Flexsim User
 
Join Date: Sep 2009
Location: Braunschweig (Germany)
Posts: 439
Downloads: 52
Uploads: 0
Thanks: 472
Thanked 217 Times in 154 Posts
Rep Power: 313
Sebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to beholdSebastian Hemmann is a splendid one to behold
Default

@ 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
Reply With Quote
  #8  
Old 02-23-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 767
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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.
Reply With Quote
The Following 2 Users Say Thank You to Jason Lightfoot For This Useful Post:
Shahin Gelareh (02-23-2012), Steven Hamoen (02-23-2012)
  #9  
Old 02-23-2012
Shahin Gelareh Shahin Gelareh is offline
Postdoctoral Researcher
 
Join Date: Sep 2011
Location: Polytech'Lille, France
Posts: 100
Downloads: 93
Uploads: 0
Thanks: 46
Thanked 3 Times in 3 Posts
Rep Power: 106
Shahin Gelareh is on a distinguished road
Default

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.
Reply With Quote
  #10  
Old 02-23-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 767
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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?
Reply With Quote
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
Phil BoBo (02-23-2012)
  #11  
Old 02-23-2012
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1169
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

Quote:
Originally Posted by Shahin Gelareh View Post
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.
Based on my knowledge about the architecture of Flexsim as one of its developers, I can tell you that Jason is entirely correct about this.

Please post an example model showing your problem so we can explain why your code is behaving how it is.
Reply With Quote
The Following User Says Thank You to Phil BoBo For This Useful Post:
Shahin Gelareh (02-25-2012)
  #12  
Old 02-25-2012
Shahin Gelareh Shahin Gelareh is offline
Postdoctoral Researcher
 
Join Date: Sep 2011
Location: Polytech'Lille, France
Posts: 100
Downloads: 93
Uploads: 0
Thanks: 46
Thanked 3 Times in 3 Posts
Rep Power: 106
Shahin Gelareh is on a distinguished road
Default

Thanks a lot. I try to reproduce it on an small example and post it here.

regards,
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -6. The time now is 03:01 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.