question

Patrick Cloutier avatar image
0 Likes"
Patrick Cloutier asked Patrick Cloutier commented

How to create conditions for time tables?

Hello, is it possible to create conditions for when a timetable should be used?

For example, Processor follows TimeTable1 (8 hours shifts) but if there is a defective product it then switches to TimeTable2 (24h/7d) to fix the defect.

The only way that I found so far would be to create another Processor at the same place to which the first one sends defective product and which follows a different table. And I'd also have to close the input of the 1st one during repair time. This could work.

But I was wondering if there is a simpler more direct way to code the timetable switch?

Thanks,

FlexSim 19.0.2
time tables
· 2
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 ·

Add members to time tables?

0 Likes 0 ·
Patrick Cloutier avatar image Patrick Cloutier Joerg Vogel commented ·

When a defective item enters the processor, I put this in the trigger on entry:

	item.color = Color.red;
	memberremove(current,"TimeTable1-16/5",1);

The item color changes to red but the current (processor) doesn't get removed from the table.

0 Likes 0 ·

1 Answer

Joerg Vogel avatar image
1 Like"
Joerg Vogel answered Patrick Cloutier commented

The function memberremove(child obj, string timetable, member type) works as expected, if you use a suitable name as a timetable string. The slash character is responsible for not executing the command correctly. Some characters shouldn’t be used inside of strings.

memberremove and memberadd let you control dynamically the members that follow the down times in timetables (member type = 1) or in MTTR MTBF (member type = 2).

· 5
5 |100000

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

Patrick Cloutier avatar image Patrick Cloutier commented ·

Should I remove the dash - the slash / or both?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Patrick Cloutier commented ·

Only the slash is necessary to remove.

0 Likes 0 ·
Patrick Cloutier avatar image Patrick Cloutier commented ·

Also, is there a way to dynamically Enable or Disable which timetable to use for a particular model run?

I'd like to put buttons in a dashboard which allows the user to choose which timetable to use.

Should I post this as a new question instead?

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel Patrick Cloutier commented ·

I think a new question would be best.

0 Likes 0 ·
Patrick Cloutier avatar image Patrick Cloutier Joerg Vogel commented ·

I found it:

setvarnum(Model.find("Tools/TimeTables/TimeTable1"),"enabled",0);

0 to disable and 1 to enable.

Thanks a lot for your help.

1 Like 1 ·