--- a/etherlab/runtime_etherlab.py Thu Apr 04 17:50:43 2013 +0900
+++ b/etherlab/runtime_etherlab.py Fri Apr 05 11:55:09 2013 +0900
@@ -1,6 +1,7 @@
import subprocess,sys,ctypes
from threading import Thread
+from targets.typemapping import LogLevelsDict SDOAnswered = PLCBinary.SDOAnswered
SDOAnswered.restype = None
@@ -12,11 +13,12 @@
def SDOThreadProc(*params):
if params[0] == "upload":
- command = "ethercat upload -p %d -t %s 0x%.4x 0x%.2x"
+ cmdfmt = "ethercat upload -p %d -t %s 0x%.4x 0x%.2x" - command = "ethercat download -p %d -t %s 0x%.4x 0x%.2x %s"
+ cmdfmt = "ethercat download -p %d -t %s 0x%.4x 0x%.2x %s" - proc = subprocess.Popen(command % params[1:], stdout=subprocess.PIPE, shell=True)
+ command = cmdfmt % params[1:] + proc = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True) output = proc.communicate()[0]
@@ -35,6 +37,10 @@
+ LogLevelsDict["WARNING"], + "%s : %s"%(command,output)) def EthercatSDOUpload(pos, index, subindex, var_type):
@@ -89,4 +95,3 @@