Just 2 questions:
1) I have 4 sources with a specific inter arrival time but I need one of this sources stops to dispence products after a specific time... For example: the source starts to work like the other sources, but after 4 hours it stops to dispence. This is possible? How to?
2) I can't find tha guide for 4D Script... Someone could say me where to find it? In the help window there is no voice about this... Perhaps it's because I have only the student version?
Thanks in advance!!!!
Timing sources
Re: Timing sources
Hi Spaggio86,
1.a For this you can use the User Events atom. This atom executes a certain function according to a certain time schedule. It can be found under the category '6 TIME' in the atom library.
1.b Connect the input channel of the User Events atom to the information channel of the Source atom. Give the event a name and add 'hr(4)' in the time field to let the event execute after 4 hours simulation time. On the edit event tab you can use the following code:
2. Additional study materials are available under:
http://academy.incontrolsim.com/documen ... ation.html
Regards, Nick
1.a For this you can use the User Events atom. This atom executes a certain function according to a certain time schedule. It can be found under the category '6 TIME' in the atom library.
1.b Connect the input channel of the User Events atom to the information channel of the Source atom. Give the event a name and add 'hr(4)' in the time field to let the event execute after 4 hours simulation time. On the edit event tab you can use the following code:
Code: Select all
CloseOutput(in(1,c))
http://academy.incontrolsim.com/documen ... ation.html
Regards, Nick
Re: Timing sources
Great, it works.. but in 4D Script I'can to understand how to write more expressions than one. For example.. If in my User Events I write
hr(4) in time field
and
CloseOutput(in,c) in the edit
It close the output of the atom linked to the first input of the current atoms... Perfect... But, If I want to close the atom linket to the secont imput too? How can I write?
The seguents expression in Edit Event didn't work:
CloseOutput(in(1,c)),CloseOutput(in(2,c))
CloseOutput(in(1,c),in(2,c))
CloseOutput(And(in(1,c),in(2,c)))
CloseOutput(in(1,2,c))
How to write this?
hr(4) in time field
and
CloseOutput(in,c) in the edit
It close the output of the atom linked to the first input of the current atoms... Perfect... But, If I want to close the atom linket to the secont imput too? How can I write?
The seguents expression in Edit Event didn't work:
CloseOutput(in(1,c)),CloseOutput(in(2,c))
CloseOutput(in(1,c),in(2,c))
CloseOutput(And(in(1,c),in(2,c)))
CloseOutput(in(1,2,c))
How to write this?
Re: Timing sources
Hi Spaggio,
Your first solution was almost correct. However, whenever you want to execute multiple functions you always have to use the Do function. The Do function is the function to nest various other functions (See also ED Help).
How to use the function 'do':
How to use the function 'in':
Regards, Nick
Your first solution was almost correct. However, whenever you want to execute multiple functions you always have to use the Do function. The Do function is the function to nest various other functions (See also ED Help).
How to use the function 'do':
Code: Select all
Do(
CloseOutput(in(1,c)),
CloseOutput(in(2,c))
)
Code: Select all
{first inputchannel}
In(1,c)
{second inputchannel}
In(2,c)
{atom connected to second input channel of the atom connected to the first input channel of atom c)
In(2,in(1,c))
Re: Timing sources
Thanks Nick for all your help. I didn't considerate the DO expression. It works perfeclty!!!