etherlab/CommonEtherCATFunction.py
changeset 2356 c26e0c66d8d5
parent 2355 fec77f2b9e07
child 2358 8e5a9830867e
--- a/etherlab/CommonEtherCATFunction.py	Fri Sep 28 17:20:11 2018 +0300
+++ b/etherlab/CommonEtherCATFunction.py	Fri Sep 28 17:48:10 2018 +0300
@@ -44,9 +44,9 @@
                 return name.getcontent()
     return default
 
-#--------------------------------------------------
+# --------------------------------------------------
 #         Remote Exec Etherlab Commands
-#--------------------------------------------------
+# --------------------------------------------------
 
 # --------------------- for master ---------------------------
 MASTER_STATE = """
@@ -136,9 +136,9 @@
 returnVal =result
 """
 
-#--------------------------------------------------
+# --------------------------------------------------
 #    Common Method For EtherCAT Management
-#--------------------------------------------------
+# --------------------------------------------------
 class _CommonSlave:
 
     # ----- Data Structure for ethercat management ----
@@ -181,9 +181,9 @@
 
         self.ClearSDODataSet()
 
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     #                        Used Master State
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     def GetMasterState(self):
         """
         Execute "ethercat master" command and parse the execution result
@@ -207,9 +207,9 @@
 
         return master_state
 
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     #                        Used Slave State
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     def RequestSlaveState(self, command):
         """
         Set slave state to the specified one using "ethercat states -p %d %s" command.
@@ -228,9 +228,9 @@
         self.SlaveState = return_val
         return return_val
 
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     #                        Used SDO Management
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     def GetSlaveSDOFromSlave(self):
         """
         Get SDO objects information of current slave using "ethercat sdos -p %d" command.
@@ -270,9 +270,9 @@
         for count in range(6):
             self.SaveSDOData.append([])
 
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     #                        Used PDO Monitoring
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     def RequestPDOInfo(self):
         """
         Load slave information from RootClass (XML data) and parse the information (calling SlavePDOData() method).
@@ -397,9 +397,9 @@
         self.RxPDOInfos = []
         self.RxPDOCategorys = []
 
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     #                        Used EEPROM Management
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     # Base data types in ETG2000; format = {"Name": "BitSize"}
     BaseDataTypeDict = {"BOOL": "01",
                         "SINT": "02",
@@ -1519,9 +1519,9 @@
 
         return eeprom
 
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     #                        Used Register Access
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     def RegRead(self, offset, length):
         """
         Read slave ESC register content using "ethercat reg_read -p %d %s %s" command.
@@ -1551,9 +1551,9 @@
         """
         error, return_val = self.Controler.RemoteExec(RESCAN%(self.Controler.GetSlavePos()), return_val = None)
 
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     #                        Common Use Methods
-    #-------------------------------------------------------------------------------
+    # -------------------------------------------------------------------------------
     def CheckConnect(self, cyclic_flag):
         """
         Check connection status (1) between Beremiz and the master (2) between the master and the slave.