question

Ahmed H2 avatar image
0 Likes"
Ahmed H2 asked Joseph Gillespie commented

Separators take value of only one day from the global table

Hello,

i need your help guys as in my model the seprators are working and read all the data in all the 28 days of the global table except the seprators (S1,S2,S3,S4,S5,S6,S7,S8,S9) reads the value of the first day only i want all the seprators read the value of the 28 days and work continously for the 28 days not one day only.

Thank in advance.

model-18-5.fsm

global tableseparatorcontinuous simulation
model-18-5.fsm (40.5 KiB)
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·

@Ahmed H2, can you please attach a smaller sample model to show us what the problem is? Many Thanks!

0 Likes 0 ·

1 Answer

Joseph Gillespie avatar image
0 Likes"
Joseph Gillespie answered
@Ahmed H2

I found a problem with your UserCommand "Check4EndOfDay". In it, you check if separators F1, F2, T, LML, ML2 and J have finished with their Daily Quantity, but you don't check for S1 through S9. Here is the code I'm talking about:

if(!inputopen(ProcF1) && !inputopen(ProcF2) && !inputopen(ProcT) || 
		inputopen(ProcLML) && !inputopen(ProcML2) && !inputopen(ProcJ) && CurrDay < Rows)
	{
		CurrDay += 1; // Add one to the current day/
		if(CurrDay <= Rows)
		{
			for(int x=1; x<=6; x++)
			{
				switch(x)
				{
					case 1:
						CurrProc = ProcF1;
						break;
					case 2:
						CurrProc = ProcF2;
						break;
					case 3:
						CurrProc = ProcT;
						break;
					case 4:
						CurrProc = ProcLML;
						break;
					case 5:
						CurrProc = ProcML2;
						break;
					case 6:
						CurrProc = ProcJ;
						break;
				}
				CurrProc.CurrQty = 0;
				CurrProc.DailyQty = Table("DailyProduction")[CurrDay][x];
				if(CurrProc.DailyQty > 0) // If daily production is greater than zero, open input port.
				{
					CurrProc.input.open();
				}
			}
			// Return true ONLY if it is a new day.
			return 1;
		}
	}

In this code you also update the separators to accept more items each day according to the amounts listed on the Global Table, but as I mentioned before you've left out separators S1-S9.

If you fix "Check4EndOfDay" to include the other separators, your model should work as you want it to.

Hope this helps!

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.