Showing results for 
Search instead for 
Did you mean: 

Color signal



I have 3 small question.
1. Is it possible to create some color signal? 

         if rand < 0.98 then

I have that situation and I want if rand<0.98 some green signal and if rand>0.02 then red.
Can I create some lamp or something?
2. The second question refers to the first.
This rate "0.98" I would like to change without opening the code.
Some field where the value will be determined and in every moment I can change it?
3. I would like to create table with parts in Drains and Store at the time when I check (no in the end of process)
How I should use to do it?



Re: Color signal

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

you can create your lamp e.g. from a SingleProc; just add two icons, make them red and green and name them "red" and "green". Then you can switch between them using the attribute currIcon (see help).


To change the value you can use a global variable.


To see all the parts, you can use the eínheritance of the MUs (just click with the right mouse button on the Mu in the class library --> Show inheritance). You can also access all parts in SimTalk; see childNo + numChildren.

Steffen Bangsow
freelance simulation specialist