Changed ids of feedback command
This commit is contained in:
parent
ff4050e180
commit
a1a7614dbe
20
classCAN.py
20
classCAN.py
|
|
@ -85,23 +85,25 @@ class CANBackend:
|
|||
mv07Cmd = node.sdo[0x2015][1].raw
|
||||
mv08Cmd = node.sdo[0x2022][1].raw
|
||||
|
||||
mv02fb = node.sdo[0x3000][1].raw
|
||||
mv03fb = node.sdo[0x3000][2].raw
|
||||
mv04fb = node.sdo[0x3000][3].raw
|
||||
mv05fb = node.sdo[0x3000][4].raw
|
||||
mv06fb = node.sdo[0x3000][5].raw
|
||||
mv07fb = node.sdo[0x3000][6].raw
|
||||
mv08fb = node.sdo[0x3000][7].raw
|
||||
mv02fb = node.sdo[0x3000][2].raw
|
||||
mv03fb = node.sdo[0x3000][3].raw
|
||||
mv04fb = node.sdo[0x3000][4].raw
|
||||
mv05fb = node.sdo[0x3000][5].raw
|
||||
mv06fb = node.sdo[0x3000][6].raw
|
||||
mv07fb = node.sdo[0x3000][7].raw
|
||||
mv08fb = node.sdo[0x3000][8].raw
|
||||
|
||||
self.latest_data[pu_number] = {
|
||||
"FM1": (fm1 / 100.0) * 60.0,
|
||||
"FM2": (fm2 / 100.0) * 60.0,
|
||||
"FM3": (fm3 / 100.0) * 60.0,
|
||||
"FM4": (fm4 / 100.0) * 60.0,
|
||||
|
||||
"PS1": ps1 / 1000.0,
|
||||
"PS2": ps2 / 1000.0,
|
||||
"PS3": ps3 / 1000.0,
|
||||
"PS4": ps4 / 1000.0,
|
||||
|
||||
"MV02_sp" : mv02Cmd,
|
||||
"MV03_sp" : mv03Cmd,
|
||||
"MV04_sp" : mv04Cmd,
|
||||
|
|
@ -109,6 +111,7 @@ class CANBackend:
|
|||
"MV06_sp" : mv06Cmd,
|
||||
"MV07_sp" : mv07Cmd,
|
||||
"MV08_sp" : mv08Cmd,
|
||||
|
||||
"MV02" : mv02fb,
|
||||
"MV03" : mv03fb,
|
||||
"MV04" : mv04fb,
|
||||
|
|
@ -121,18 +124,15 @@ class CANBackend:
|
|||
print(f"[PU{pu_number}] FM1: {fm1}, PS1: {ps1}")
|
||||
except Exception as inner_e:
|
||||
print(f"[SDO READ ERROR] PU{pu_number}: {inner_e}")
|
||||
|
||||
except Exception as outer_e:
|
||||
print(f"[SDO POLL ERROR] {outer_e}")
|
||||
|
||||
time.sleep(1.0)
|
||||
|
||||
|
||||
def get_latest_data(self, pu_number: int):
|
||||
with self.lock:
|
||||
return self.latest_data.get(pu_number, {}).copy()
|
||||
|
||||
|
||||
def read_current_state(self, pu_number: int):
|
||||
try:
|
||||
node = self.nodes.get(pu_number)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user