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-25-2012
George Serhan George Serhan is offline
Flexsim User
 
Join Date: Oct 2011
Posts: 49
Downloads: 10
Uploads: 0
Thanks: 59
Thanked 0 Times in 0 Posts
Rep Power: 107
George Serhan is on a distinguished road
Default Writing to global table

Hi,
I'm trying to write the output of the number of orders processed into a global table. I was able to get the order number to be written on the table but only on row 1. Added the code "addtablerow("Feedback") so it insert a row to the table every time the trigger is activated. It doesn't seem to like it, I don't see any row increment and when I manually add a row to the table, it doesn't go to the next cell in the table. model is attached ver 6.02
Thanks
George
Attached Files
File Type: fsm write to global table.fsm (113.6 KB, 137 views)
  #2  
Old 09-25-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: 773
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

Your code hasn't been applied. Hit apply on the exittrigger and then on the Combiner Properties and run it again.
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
George Serhan (09-26-2012)
  #3  
Old 09-26-2012
George Serhan George Serhan is offline
Flexsim User
 
Join Date: Oct 2011
Posts: 49
Downloads: 10
Uploads: 0
Thanks: 59
Thanked 0 Times in 0 Posts
Rep Power: 107
George Serhan is on a distinguished road
Default Reset is jumpy

Hi Jason,
On the reset button I have a loop that go through the number of rows and delete them except the first one. That's not what occur when I reset the model. If I have 10 rows in the "Feedback" table for instance, the reset only delete 5 rows, and if I push it again it delete 2 rows. It seems that it's dividing the total count of rows by 2 and delete them every time the reset button is pushed. I don't know why is that happening, any idea!!!!!!
Thanks
George
  #4  
Old 09-26-2012
George Serhan George Serhan is offline
Flexsim User
 
Join Date: Oct 2011
Posts: 49
Downloads: 10
Uploads: 0
Thanks: 59
Thanked 0 Times in 0 Posts
Rep Power: 107
George Serhan is on a distinguished road
Default

This is the model
Attached Files
File Type: fsm write to global table.fsm (97.1 KB, 111 views)
  #5  
Old 09-26-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: 1174
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

Code:
for(int i = 2; i <= numrows; i++)
{
	deletetablerow("Feedback",i);
}
When you delete the 2nd row, the 3rd row becomes the 2nd row and doesn't get deleted.

You can fix it using something like these examples:

Code:
for(int i = numrows; i > 1; i--)
{
	deletetablerow("Feedback",i);
}
or

Code:
while(gettablerows("Feedback") > 1)
{
	deletetablerow("Feedback",2);
}
The Following User Says Thank You to Phil BoBo For This Useful Post:
George Serhan (09-26-2012)


Thread Thread Starter Forum Replies Last Post
Dispatcher and Global table Manoj Kumar Q&A 4 07-06-2012 07:07 AM
Plotting Global Table shashanktrivedi Q&A 2 06-17-2011 05:50 AM
Tasksequence by using global table Jelmer Js Q&A 7 04-20-2011 09:01 AM
Global Table string value Congshi Wang Q&A 1 05-24-2010 07:38 AM
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.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.