   }
 
   uint8_t port = strToInt(query);
-  bitClear(di_stream_enable_ports, port);
-
-  return okIoJson(port, 0);
-}
-
-String streamAiOnTask(String query){
-
-  String error = checkPortQuery(query);
-  if(error){
-    return error;
-  }
-
-  uint8_t port = strToInt(query);
-  bitSet(ai_stream_enable_ports, port);
-
-  return okIoJson(port, 1);
-}
-
-String streamAiOffTask(String query){
-
-  if(query == "all"){
-    ai_stream_enable_ports = 0;
-    return okIoJson(0xff, 0);
-  }
-
-  String error = checkPortQuery(query);
-  if(error){
-    return error;
-  }
-
-  uint8_t port = strToInt(query);
-  bitClear(ai_stream_enable_ports, port);
+  if(port >= AI_MAX_PORT_NUM){
+    return NgReturnJson(ILLEGAL_PORT_NUMBER);
+  }
+  ai_stream_info[port].interval_ms = 0;
 
   return okIoJson(port, 0);
 }

  return NULL;
}

String checkPortWithValue(String portWithValue, int *port, int *val){

  String valQuery;


// D0 - D13
#define DI_MAX_PORT_NUM 14

struct STREAM_INFO {
  uint64_t interval_ms;
  uint64_t counter;
};

volatile struct STREAM_INFO ai_stream_info[AI_MAX_PORT_NUM];
volatile struct STREAM_INFO di_stream_info[DI_MAX_PORT_NUM];

// AI Reference電圧の名前と値を保持するテーブル.
const struct STR_UINT8_PEAR AI_REF_TBL[] = {
