huli преди 3 години
родител
ревизия
2bd83ed4c8
променени са 4 файла, в които са добавени 13 реда и са изтрити 4 реда
  1. 1 1
      main.cpp
  2. 5 1
      setting/communication.prototxt
  3. 6 1
      setting/snap7_communication.prototxt
  4. 1 1
      snap7_communication/snap7_communication_base.cpp

+ 1 - 1
main.cpp

@@ -64,7 +64,7 @@ int main(int argc,char* argv[])
 
 
 
-	int t_id = 0;
+	int t_id = 2;
 	if ( argc == 2 )
 	{
 		t_id = stoi(argv[1]);

+ 5 - 1
setting/communication.prototxt

@@ -22,7 +22,7 @@ communication_parameters
  #  connect_string_vector:"tcp://192.168.2.183:30000"
 
 
-    connect_string_vector:"tcp://192.168.2.233:30000"
+ #   connect_string_vector:"tcp://192.168.2.233:30000"
 
  #   connect_string_vector:"tcp://192.168.2.165:30000"
  #   bind_string:"tcp://192.168.2.177:30009"
@@ -30,5 +30,9 @@ communication_parameters
   #  connect_string_vector:"tcp://192.168.2.127:30001"
 
 #    connect_string_vector:"tcp://192.168.2.174:30002"
+
+    connect_string_vector:"tcp://192.168.1.233:30000"
+    connect_string_vector:"tcp://192.168.1.240:30010"
+
 }
 

+ 6 - 1
setting/snap7_communication.prototxt

@@ -6,6 +6,11 @@ snap7_communication_parameters
 
  #ip_string:"192.168.0.6"
 
- ip_string:"192.168.2.6"
+ #ip_string:"192.168.2.6"
+
+
+
+ #ip_string:"192.168.0.112"
+ ip_string:"192.168.0.1"
 }
 

+ 1 - 1
snap7_communication/snap7_communication_base.cpp

@@ -55,7 +55,7 @@ Error_manager Snap7_communication_base::communication_init_from_protobuf(Snap7_c
 		}
 	}
 
-#ifndef S7_CLOSE
+#ifdef S7_CLOSE
 	//启动通信, run thread
 	communication_run();
 #endif