Skip to content
snipsnipsnip edited this page Dec 7, 2012 · 3 revisions

« Examples

リアルタイムシミュレーションでswitchを入れたり切ったりすると8つのライトが順番に点灯される。

実際動かすにはチャタリング対策を挟む必要がある。

   ||                                                                                     ||
   ||     Xswitch             _            [count <]             {ADD  count  :=}         ||
 1 ||-------] [-----------[OSF \_]----+----[ 8     ]-------------{ count + 1    }---------||
   ||                                 |                                                   ||
   ||                                 |   [count >=]                      {count  :=   }  ||
   ||                                 +---[ 8      ]----------------------{ 0       MOV}--||
   ||                                                                                     ||
   ||                                                                                     ||
   ||                                                                                     ||
   ||                                                                                     ||
   ||                    [count ==]                                           Ylight0     ||
 2 ||----+------+----+---[ 0      ]---------------------------------------------( )-------||
   ||                |                                                                    ||
   ||                |   [count ==]                                           Ylight1     ||
   ||                +---[ 1      ]---------------------------------------------( )-------||
   ||                |                                                                    ||
   ||                |   [count ==]                                           Ylight2     ||
   ||                +---[ 2      ]---------------------------------------------( )-------||
   ||                |                                                                    ||
   ||                |   [count ==]                                           Ylight3     ||
   ||                +---[ 3      ]---------------------------------------------( )-------||
   ||                |                                                                    ||
   ||                |   [count ==]                                           Ylight4     ||
   ||                +---[ 4      ]---------------------------------------------( )-------||
   ||                |                                                                    ||
   ||                |   [count ==]                                           Ylight5     ||
   ||                +---[ 5      ]---------------------------------------------( )-------||
   ||                |                                                                    ||
   ||                |   [count ==]                                           Ylight6     ||
   ||                +---[ 6      ]---------------------------------------------( )-------||
   ||                |                                                                    ||
   ||                |   [count ==]                                           Ylight7     ||
   ||                +---[ 7      ]---------------------------------------------( )-------||
   ||                                                                                     ||
   ||                                                                                     ||
   ||                                                                                     ||
   ||------[END]--------------------------------------------------------------------------||
   ||                                                                                     ||
   ||                                                                                     ||
Clone this wiki locally