浏览代码

20210922,test s7

huli 3 年之前
父节点
当前提交
2bd83ed4c8

+ 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