Compare commits

..

21 Commits
v1.0.0 ... main

Author SHA1 Message Date
eb917a1a30 Created fast api repo for endurance testbench 2025-09-01 11:12:47 +02:00
97f1e57233 Added pressure controller and removed unnecessary files 2025-08-29 17:17:01 +02:00
c01307159f Updated the latest code working on testbench 2025-08-25 11:42:14 +02:00
77d8b4f997 Updated Object dictionary for data reading 2025-04-25 16:53:21 +02:00
db38c17a5e Added connect and disconnect button 2025-04-14 10:34:05 +02:00
25d8dc7d05 Added a simple gui to see the status of the testbench and test script base for future logging (requiremnts to be fixed) 2025-04-10 16:44:25 +02:00
e904c98fac Small refactoring 2025-04-10 12:01:55 +02:00
d2de7da0e3 Pump speed decrease in case of high pressure 2025-04-02 13:17:18 +02:00
71b468cc6e Pump voltage check and disabling mechanism if high 2025-04-01 17:02:38 +02:00
e081882ad7 Added adc, fixed file loc issue 2025-04-01 15:31:17 +02:00
1d8f6d6b4f Removed unneccesary comments and variable. 2025-04-01 15:01:30 +02:00
0b4bbb85e2 Valve and pump running simultaneously 2025-04-01 10:41:31 +02:00
7ccde7933f Analog modules reading and pump set speed implemented (untested) 2025-03-27 13:40:30 +01:00
200cdc48c7 Write to node and read implemented. Tested on system. 2025-03-20 09:44:03 +01:00
18d169eaa5 Node handling corrected 2025-03-17 16:44:58 +01:00
9ac0b4ff69 Endurance testbench data logging: Writing and reading the data from the node 2025-03-13 16:12:27 +01:00
4cc9c33563 Updated test bench code 2025-02-27 09:15:12 +01:00
06254dfaa4 Working state of test bench, few things left to be checked 2025-02-26 13:25:23 +01:00
5415e2c538 Changes to OD. Testing the LSS and CAN 2025-02-24 17:22:22 +01:00
15c84db741 Added fix for test bench lss not running. Changed heartbeat consumers settings 2025-02-24 11:51:19 +01:00
52ac4f0b1c Added state machine for endurance test bench, CAN LSS not working 2025-02-21 10:12:31 +01:00
336 changed files with 61013 additions and 10779 deletions

View File

@ -0,0 +1,157 @@
# Real CANopen data manager for Endurance Test Bench HMI
import canopen
import time
class EnduranceDataManager:
def __init__(self):
self.motor_data = {} # {node_id: {setpoint, feedback}}
self.pu_data = {"setpoint": {}, "feedback": {}, "flowmeter": {}, "pressure": {}, "pump": {}}
self.connected = False
self.network = None
self.nodes = {}
self.serial_numbers = {}
def connect_to_can(self):
try:
self.network = canopen.Network()
self.network.connect(bustype='pcan', channel='PCAN_USBBUS1', bitrate=250000)
self._init_pu_node()
self._init_motor_nodes()
self.connected = True
except Exception as e:
print(f"[CAN ERROR] Could not connect to CAN: {e}")
self.connected = False
def disconnect(self):
if self.network:
self.network.disconnect()
self.connected = False
self.motor_data.clear()
self.pu_data = {"setpoint": {}, "feedback": {}, "flowmeter": {}, "pressure": {}, "pump": {}}
self.nodes.clear()
def _init_pu_node(self):
try:
node = canopen.RemoteNode(1, r'C:\Users\vineetagupta\Documents\NorthStar_Bitbucket\EnduranceTestBench\EnduranceTestBench\coappl\enduranceTestBench.eds')
self.network.add_node(node)
node.nmt.state = 'OPERATIONAL'
node.tpdo.read()
self.nodes[1] = node
# Enable and hook TPDOs for valve and system data
tpdo_cobs = {
0x284: 'setpoint',
0x285: 'setpoint',
0x286: 'setpoint',
0x281: 'flowmeter',
0x282: 'pressure',
0x283: 'pump'
}
for cob_id, key in tpdo_cobs.items():
tpdo_num = self._get_tpdo_number_by_cob_id(node, cob_id)
if tpdo_num is not None:
node.tpdo[tpdo_num].enabled = True
def make_pu_cb(k):
def cb(map_obj):
for var in map_obj:
sid = f"0x{var.subindex:02X}"
self.pu_data[k][sid] = var.raw
return cb
node.tpdo[tpdo_num].add_callback(make_pu_cb(key))
except Exception as e:
print(f"PU node error: {e}")
def _get_tpdo_number_by_cob_id(self, node, cob_id):
for i in range(1, 9):
if i in node.tpdo:
if node.tpdo[i].cob_id == cob_id:
return i
return None
def get_valve_data(self):
result = {}
for i in range(5, 25):
sid = f"0x{i - 4:02X}"
setpoint = self.pu_data["setpoint"].get(sid, 0)
feedback = self.motor_data.get(i, {}).get("feedback", 0)
drift = abs(setpoint - feedback)
serial = self.serial_numbers.get(i)
status = "UNKNOWN"
try:
if i in self.nodes:
status = self.nodes[i].nmt.state or "UNKNOWN"
except:
pass
# Drift symbol
if drift >= 5 and drift <= 10:
drift_display = f"⚠️ { drift}"
elif drift >= 10:
drift_display = f"{ drift}"
else:
drift_display = f"{drift}"
result[i] = {
"node_id": f"{i}",
"setpoint": setpoint,
"feedback": feedback,
"drift": drift_display,
"status": status,
"serial": serial
}
return result
def _init_motor_nodes(self):
for node_id in range(5, 25): # Motor nodes
try:
motor_node = canopen.RemoteNode(
node_id,
r'C:\Users\vineetagupta\Documents\NorthStar_Bitbucket\MotorBoard\MotorValveBoard\coappl\motorcontrollervalve.eds'
)
self.network.add_node(motor_node)
motor_node.nmt.state = 'OPERATIONAL'
motor_node.tpdo.read()
motor_node.tpdo[1].enabled = True
# === Add callback to read feedback ===
def make_cb(nid):
def cb(map_obj):
for var in map_obj:
if var.index == 0x2004 and var.subindex == 0x0:
self.motor_data[nid] = {"feedback": var.raw}
return cb
motor_node.tpdo[1].add_callback(make_cb(node_id))
self.nodes[node_id] = motor_node
# === Serial number read (only once) ===
if not hasattr(self, 'serial_numbers'):
self.serial_numbers = {}
if node_id not in self.serial_numbers:
try:
serial = motor_node.sdo[0x1018][4].raw
self.serial_numbers[node_id] = serial
except Exception as e:
print(f"[Serial Read Error] Node {node_id}: {e}")
self.serial_numbers[node_id] = "Unknown"
except Exception as e:
print(f"[Motor Node {node_id}] Error: {e}")
def get_flow_data(self):
return self.pu_data["flowmeter"]
def get_pressure_data(self):
return self.pu_data["pressure"]
def get_pump_rpm(self):
return self.pu_data["pump"].get("0x00", 0)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,499 @@
; EDS file for motorcontrollervalve - generated by CANopen DeviceDesigner 3.14.2
[FileInfo]
FileName=motorcontrollervalve.eds
FileVersion=1.0
FileRevision=1.0
EDSVersion=4.0
Description=EDS
CreationTime=14:47PM
CreationDate=05-19-25
ModificationTime=14:47PM
ModificationDate=05-19-25
CreatedBy=Aniket Saha
ModifiedBy=Aniket Saha
[Comments]
Lines=1
Line1=generated by CANopen DeviceDesigner by emotas
[DeviceInfo]
VendorName=nehemis
VendorNumber=0x59A
ProductName=MotorValveController
ProductNumber=0
RevisionNumber=0
OrderCode=MotorValveController
BaudRate_10=0
BaudRate_20=0
BaudRate_50=0
BaudRate_125=0
BaudRate_250=1
BaudRate_500=0
BaudRate_800=0
BaudRate_1000=0
NrOfRxPDO=0
NrOfTxPDO=1
SimpleBootupSlave=1
SimpleBootupMaster=0
LSS_Supported=0
Granularity=8
DynamicChannelsSupported=0
GroupMessaging=0
[DummyUsage]
Dummy0001=0
Dummy0002=0
Dummy0003=0
Dummy0004=0
Dummy0005=0
Dummy0006=0
Dummy0007=0
[MandatoryObjects]
SupportedObjects=3
1=0x1000
2=0x1001
3=0x1018
[ManufacturerObjects]
SupportedObjects=9
1=0x2001
2=0x2002
3=0x2003
4=0x2004
5=0x2005
6=0x2006
7=0x2007
8=0x2008
9=0x3000
[OptionalObjects]
SupportedObjects=11
1=0x1003
2=0x1008
3=0x1014
4=0x1015
5=0x1016
6=0x1017
7=0x1029
8=0x1200
9=0x1800
10=0x1a00
11=0x1f51
[1000]
ParameterName=Device Type
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
DefaultValue=0
[1001]
ParameterName=Error Register
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
[1003]
ParameterName=Predefined Error Field
ObjectType=8
SubNumber=2
[1003sub0]
ParameterName=Number of Errors
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
DefaultValue=0
[1003sub1]
ParameterName=Standard Error Field
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
DefaultValue=0
[1008]
ParameterName=Manufacturer device name
ObjectType=7
DataType=9
AccessType=const
PDOMapping=0
DefaultValue=emotas Slave 1
[1014]
ParameterName=COB ID EMCY
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
DefaultValue=$NODEID+0x80
[1015]
ParameterName=Inhibit Time Emergency
ObjectType=7
DataType=6
AccessType=rw
PDOMapping=0
DefaultValue=0x0
[1016]
ParameterName=Consumer Heartbeat Time
ObjectType=8
SubNumber=2
[1016sub0]
ParameterName=Number of entries
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=1
[1016sub1]
ParameterName=Consumer Heartbeat Time
ObjectType=7
DataType=7
AccessType=rw
PDOMapping=0
DefaultValue=500
[1017]
ParameterName=Producer Heartbeat Time
ObjectType=7
DataType=6
AccessType=rw
PDOMapping=0
[1018]
ParameterName=Identity Object
ObjectType=9
SubNumber=5
[1018sub0]
ParameterName=Number of entries
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=4
[1018sub1]
ParameterName=Vendor Id
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
DefaultValue=0x59A
[1018sub2]
ParameterName=Product Code
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
[1018sub3]
ParameterName=Revision number
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
[1018sub4]
ParameterName=Serial number
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
[1029]
ParameterName=Error behaviour
ObjectType=8
SubNumber=3
[1029sub0]
ParameterName=Nr of Error Classes
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=2
[1029sub1]
ParameterName=Communication Error
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
DefaultValue=1
[1029sub2]
ParameterName=Specific Error Class
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
[1200]
ParameterName=Server SDO Parameter
ObjectType=9
SubNumber=3
[1200sub0]
ParameterName=Number of entries
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=2
[1200sub1]
ParameterName=COB ID Client to Server
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
DefaultValue=$NODEID+0x600
[1200sub2]
ParameterName=COB ID Server to Client
ObjectType=7
DataType=7
AccessType=ro
PDOMapping=0
DefaultValue=$NODEID+0x580
[1800]
ParameterName=Transmit PDO Communication Parameter
ObjectType=9
SubNumber=6
[1800sub0]
ParameterName=Number of entries
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=5
[1800sub1]
ParameterName=COB ID
ObjectType=7
DataType=7
AccessType=rw
PDOMapping=0
DefaultValue=$NODEID+0x180
[1800sub2]
ParameterName=Transmission Type
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
DefaultValue=254
[1800sub3]
ParameterName=Inhibit Time
ObjectType=7
DataType=6
AccessType=rw
PDOMapping=0
DefaultValue=0x0000
[1800sub4]
ParameterName=Compatibility Entry
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
[1800sub5]
ParameterName=Event Timer
ObjectType=7
DataType=6
AccessType=rw
PDOMapping=0
DefaultValue=500
[1a00]
ParameterName=Transmit PDO Mapping Parameter
ObjectType=9
SubNumber=3
[1a00sub0]
ParameterName=Number of entries
ObjectType=7
DataType=5
AccessType=const
PDOMapping=0
DefaultValue=2
[1a00sub1]
ParameterName=PDO Mapping Entry
ObjectType=7
DataType=7
AccessType=const
PDOMapping=0
DefaultValue=0x20040008
[1a00sub2]
ParameterName=Mapping Entry 2
ObjectType=7
DataType=7
AccessType=const
PDOMapping=0
DefaultValue=0x20050008
[1f51]
ParameterName=Program Control
ObjectType=8
SubNumber=2
[1f51sub0]
ParameterName=Number of entries
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=1
[1f51sub1]
ParameterName=Program Control
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
[2001]
ParameterName=Pressure Setpoint
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
[2002]
ParameterName=Position Setpoint
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
[2003]
ParameterName=Flowrate Setpoint
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
[2004]
ParameterName=Encoder Position
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=1
[2005]
ParameterName=Voltage Loss Flag
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=1
[2006]
ParameterName=Set Default Position
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
[2007]
ParameterName=Device ID Parameters
ObjectType=9
SubNumber=4
[2007sub0]
ParameterName=Highest sub-index supported
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=3
[2007sub1]
ParameterName=Product Code
ObjectType=7
DataType=7
AccessType=rw
PDOMapping=0
[2007sub2]
ParameterName=Revision Number
ObjectType=7
DataType=7
AccessType=rw
PDOMapping=0
[2007sub3]
ParameterName=Serial Number
ObjectType=7
DataType=7
AccessType=rw
PDOMapping=0
[2008]
ParameterName=Configuration Verification
ObjectType=9
SubNumber=5
[2008sub0]
ParameterName=Highest sub-index supported
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=4
[2008sub1]
ParameterName=Config Okay
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
DefaultValue=0
[2008sub2]
ParameterName=Test Valve Request
ObjectType=7
DataType=5
AccessType=rw
PDOMapping=0
DefaultValue=0
[2008sub3]
ParameterName=Test Valve Response
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
DefaultValue=0
[2008sub4]
ParameterName=Calibration Status
ObjectType=7
DataType=5
AccessType=ro
PDOMapping=0
[3000]
ParameterName=Persistent Data Delete
ObjectType=7
DataType=5
AccessType=wo
PDOMapping=0
DefaultValue=0

View File

@ -0,0 +1,99 @@
import os
import csv
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from datetime import datetime
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
LOGS_DIR = "logs"
class GraphViewer(tk.Toplevel):
def __init__(self, master=None):
super().__init__(master)
self.title("Valve Graph Viewer")
self.geometry("1000x600")
self._create_widgets()
self._populate_dates()
def _create_widgets(self):
self.date_label = ttk.Label(self, text="Select Date:")
self.date_label.pack()
self.date_cb = ttk.Combobox(self, state="readonly")
self.date_cb.pack()
self.node_label = ttk.Label(self, text="Select Node:")
self.node_label.pack()
self.node_cb = ttk.Combobox(self, state="readonly", values=[f"Node{nid:02}" for nid in range(5, 25)])
self.node_cb.pack()
self.plot_btn = ttk.Button(self, text="Plot Graph", command=self._plot_graph)
self.plot_btn.pack(pady=10)
self.canvas_frame = ttk.Frame(self)
self.canvas_frame.pack(fill="both", expand=True)
def _populate_dates(self):
if not os.path.exists(LOGS_DIR):
return
dates = [d for d in os.listdir(LOGS_DIR) if os.path.isdir(os.path.join(LOGS_DIR, d))]
self.date_cb['values'] = sorted(dates)
if dates:
self.date_cb.current(0)
self.node_cb.current(0)
def _plot_graph(self):
date = self.date_cb.get()
node = self.node_cb.get()
filepath = os.path.join(LOGS_DIR, date, f"{node}.csv")
if not os.path.exists(filepath):
messagebox.showerror("File Not Found", f"No data for {node} on {date}.")
return
timestamps = []
setpoints = []
feedbacks = []
flows = []
pressures = []
with open(filepath, newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
try:
timestamps.append(datetime.strptime(row["Timestamp"], "%Y-%m-%d %H:%M:%S"))
setpoints.append(float(row["Setpoint"]))
feedbacks.append(float(row["Feedback"]))
flows.append(float(row["Flow (L/h)"]))
pressures.append(float(row["Pressure (bar)"]))
except Exception as e:
print(f"[PARSE ERROR] {e}")
self._draw_plot(timestamps, setpoints, feedbacks, flows, pressures)
def _draw_plot(self, t, sp, fb, fl, pr):
for widget in self.canvas_frame.winfo_children():
widget.destroy()
fig, ax = plt.subplots(figsize=(10, 5))
ax.plot(t, sp, label="Setpoint")
ax.plot(t, fb, label="Feedback")
ax.plot(t, fl, label="Flow (L/h)")
ax.plot(t, pr, label="Pressure (bar)")
ax.set_title("Valve Performance")
ax.set_xlabel("Time")
ax.set_ylabel("Values")
ax.legend()
ax.grid(True)
canvas = FigureCanvasTkAgg(fig, master=self.canvas_frame)
canvas.draw()
canvas.get_tk_widget().pack(fill="both", expand=True)
# Usage:
# from graph_viewer import GraphViewer
# btn.config(command=lambda: GraphViewer(root))

View File

@ -0,0 +1,19 @@
from PIL import Image
import os
# Create output directory
os.makedirs("icons", exist_ok=True)
# Define colors
colors = {
"green.png": (0, 200, 0),
"yellow.png": (255, 200, 0),
"red.png": (200, 0, 0)
}
# Create solid 16x16 square images
for name, rgb in colors.items():
img = Image.new("RGB", (16, 16), rgb)
img.save(os.path.join("icons", name))
print("✅ Icons created in ./icons")

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 81 B

View File

@ -0,0 +1,47 @@
import csv
import os
import threading
from datetime import datetime
LOG_INTERVAL_SECONDS = 0.5
VALVE_IDS = range(5, 25)
BASE_LOG_DIR = "logs"
def start_per_valve_logger(data_mgr):
def log_data():
threading.Timer(LOG_INTERVAL_SECONDS, log_data).start()
try:
now = datetime.now()
timestamp_str = now.strftime("%Y-%m-%d %H:%M:%S")
date_folder = now.strftime("%Y-%m-%d")
valve_data = data_mgr.get_valve_data()
flow = data_mgr.get_flow_data()
pressure = data_mgr.get_pressure_data()
# Aggregate flow and pressure
total_flow = sum(flow.get(f"0x{i:02X}", 0) for i in range(1, 5)) / 100.0
total_pressure = sum(pressure.get(f"0x{i:02X}", 0) for i in range(1, 4)) / 100.0
# Create daily folder
log_dir = os.path.join(BASE_LOG_DIR, date_folder)
os.makedirs(log_dir, exist_ok=True)
for node_id in VALVE_IDS:
valve = valve_data.get(node_id, {})
setpoint = valve.get("setpoint", 0)
feedback = valve.get("feedback", 0)
filepath = os.path.join(log_dir, f"Node{node_id:02}.csv")
is_new_file = not os.path.exists(filepath)
with open(filepath, "a", newline="") as f:
writer = csv.writer(f)
if is_new_file:
writer.writerow(["Timestamp", "Setpoint", "Feedback", "Flow (L/h)", "Pressure (bar)"])
writer.writerow([timestamp_str, setpoint, feedback, total_flow, total_pressure])
except Exception as e:
print(f"[LOG ERROR] {e}")
log_data()

View File

@ -0,0 +1,91 @@
from template import create_gui
from data import EnduranceDataManager
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
import time
from tkinter import PhotoImage
from logger import start_per_valve_logger
from graphViewer import GraphViewer
# Instantiate GUI and data manager
root, connect_btn, disconnect_btn, graph_btn, valve_tree, pressure_labels, flow_labels, pump_rpm_label = create_gui()
data_mgr = EnduranceDataManager()
status_icons = {
"OPERATIONAL": PhotoImage(file="icons/green.png"),
"PRE-OPERATIONAL": PhotoImage(file="icons/yellow.png"),
"UNKNOWN": PhotoImage(file="icons/red.png"),
}
image_refs = [] # Needed to prevent garbage collection of images
# === Update the GUI based on data manager ===
def refresh_gui():
if not data_mgr.connected:
root.after(1000, refresh_gui)
return
# data_mgr.simulate_update() # Replace with live update later
valve_tree.delete(*valve_tree.get_children())
image_refs.clear() # Clear old references
valve_data = data_mgr.get_valve_data()
for node_id, data in valve_data.items():
status = data.get("status", "UNKNOWN")
icon = status_icons.get(status, status_icons["UNKNOWN"])
image_refs.append(icon) # prevent GC
valve_tree.insert("", "end", image=icon, values=(
data["node_id"],
data["serial"],
data["setpoint"],
data["feedback"],
data["drift"],
))
# Update pressure sensors
pressure_data = data_mgr.get_pressure_data()
for i, lbl in enumerate(pressure_labels):
raw = pressure_data.get(f'0x{i+1:02X}', 0)
value = float(raw) / 100.0 # assuming raw is in centibar
lbl.config(text=f"Pressure {i+1}: {value:.2f} bar")
# Update flowmeters (scaled to L/h)
flow_data = data_mgr.get_flow_data()
for i, lbl in enumerate(flow_labels):
raw = flow_data.get(f'0x{i+1:02X}', 0)
value = float(raw) / 100.0
lbl.config(text=f"Flowmeter {i+1}: {value:.1f} L/h")
# Update pump RPM
pump_rpm_label.config(text=str(data_mgr.get_pump_rpm()))
root.after(1000, refresh_gui)
# === Button Callbacks ===
def handle_connect():
data_mgr.connect_to_can()
connect_btn.config(state=DISABLED)
disconnect_btn.config(state=NORMAL)
def handle_disconnect():
data_mgr.disconnect()
connect_btn.config(state=NORMAL)
disconnect_btn.config(state=DISABLED)
valve_tree.delete(*valve_tree.get_children())
# Bind buttons
connect_btn.config(command=handle_connect)
disconnect_btn.config(command=handle_disconnect)
disconnect_btn.config(state=DISABLED)
def main():
refresh_gui()
root.mainloop()
if __name__ == "__main__":
start_per_valve_logger(data_mgr)
graph_btn.config(command=lambda: GraphViewer(root))
main()

View File

@ -0,0 +1,93 @@
# template.py
import ttkbootstrap as ttk
from ttkbootstrap.constants import *
from tkinter import ttk as tkttk
from datetime import datetime
import screeninfo
def create_gui():
screen = screeninfo.get_monitors()[0]
screen_width = int(screen.width * 0.75)
screen_height = int(screen.height * 0.75)
root = ttk.Window(title="Endurance Test Bench", themename="morph")
root.geometry(f"{screen_width}x{screen_height}")
root.resizable(True, True) # Allow resizing
# === Top control bar ===
top_frame = ttk.Frame(root, padding=10)
top_frame.pack(fill=X)
connect_btn = ttk.Button(top_frame, text="✅ Connect to CAN", bootstyle="success-outline")
connect_btn.pack(side=LEFT, padx=5)
disconnect_btn = ttk.Button(top_frame, text="❌ Disconnect", bootstyle="danger-outline")
disconnect_btn.pack(side=LEFT, padx=5)
graph_btn = ttk.Button(top_frame, text="🖥 Show Graphs", bootstyle="info-outline")
graph_btn.pack(side=RIGHT, padx=5)
# === Valve Overview Title ===
valve_title = ttk.Label(root, text="Valve Overview", font=("Helvetica", 16, "bold"), padding=(10, 5))
valve_title.pack(anchor=W)
# === Valve Tree Container ===
tree_container = ttk.Frame(root, padding=(10, 5))
tree_container.pack(fill=BOTH, expand=True)
# === Valve Treeview Widget ===
valve_columns = ("Node ID", "Serial No.", "Setpoint", "Feedback", "Drift")
valve_tree = tkttk.Treeview(tree_container, columns=valve_columns, show="tree headings", height=16)
# Style: Font and row size
style = ttk.Style()
style.configure("Treeview", font=("Segoe UI Emoji", 11), rowheight=28)
# Set column widths proportionally to screen size
# First column (tree column) for icons
valve_tree.heading("#0", text="Status")
valve_tree.column("#0", width=50, anchor="center", stretch=False)
# Other data columns
col_width = int(screen_width / (len(valve_columns) + 1)) # +1 because of the tree column
for col in valve_columns:
valve_tree.heading(col, text=col)
valve_tree.column(col, anchor='center', width=col_width, stretch=True)
valve_tree.pack(side=LEFT, fill=BOTH, expand=True)
# === Scrollbar ===
scrollbar = ttk.Scrollbar(tree_container, orient=VERTICAL, command=valve_tree.yview)
valve_tree.configure(yscrollcommand=scrollbar.set)
scrollbar.pack(side=RIGHT, fill=Y)
# === Feedback section ===
feedback_title = ttk.Label(root, text="System Feedback", font=("Helvetica", 12, "bold"), padding=(10, 10))
feedback_title.pack(anchor=W)
feedback_frame = ttk.Frame(root, padding=(10, 0))
feedback_frame.pack(fill=X, padx=10, pady=10)
pressure_frame = ttk.Labelframe(feedback_frame, text="Pressure Sensor", padding=10)
pressure_frame.pack(side=LEFT, fill=BOTH, expand=True, padx=5)
pressure_labels = []
for i in range(3):
lbl = ttk.Label(pressure_frame, text=f"Pressure {i+1}: 0 bar")
lbl.pack(anchor=W)
pressure_labels.append(lbl)
flow_frame = ttk.Labelframe(feedback_frame, text="Flowmeter", padding=10)
flow_frame.pack(side=LEFT, fill=BOTH, expand=True, padx=5)
flow_labels = []
for i in range(4):
lbl = ttk.Label(flow_frame, text=f"Flowmeter {i+1}: 0 L/h")
lbl.pack(anchor=W)
flow_labels.append(lbl)
pump_frame = ttk.Labelframe(feedback_frame, text="Pump RPM", padding=10)
pump_frame.pack(side=LEFT, fill=BOTH, expand=True, padx=5)
pump_rpm_label = ttk.Label(pump_frame, text="0", font=("Helvetica", 16))
pump_rpm_label.pack(anchor=W)
return root, connect_btn, disconnect_btn, graph_btn, valve_tree, pressure_labels, flow_labels, pump_rpm_label

View File

@ -25,6 +25,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1405112184" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.682025153" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.6 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32G474RETx || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Core/Inc | ../Drivers/STM32G4xx_HAL_Driver/Inc | ../Drivers/STM32G4xx_HAL_Driver/Inc/Legacy | ../Drivers/CMSIS/Device/ST/STM32G4xx/Include | ../Drivers/CMSIS/Include || || || USE_HAL_DRIVER | STM32G474xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32G474RETX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || || || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.debug.option.cpuclock.1257551364" name="Cpu clock frequence" superClass="com.st.stm32cube.ide.mcu.debug.option.cpuclock" useByScannerDiscovery="false" value="160" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.convertbinary.1999534235" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.convertbinary" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.732001332" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/ProcessBoardV1}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.740914774" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.506100853" name="MCU/MPU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
@ -71,6 +72,11 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/scheduler}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/log}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms-hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_can}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/common}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/stm32_mcan}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/colib_sl/inc}&quot;"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.1637079955" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool>
@ -126,6 +132,11 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/scheduler}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/log}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms-hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_can}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/common}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/stm32_mcan}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/colib_sl/inc}&quot;"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.197736294" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
@ -151,16 +162,17 @@
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec.1592992518" name="MCU Output Converter Motorola S-rec with symbols" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.objcopy.symbolsrec"/>
</toolChain>
</folderInfo>
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.456731299.1252556889" name="monitoring.h" rcbsApplicability="disable" resourcePath="nehemis/monitoring.h" toolsToInvoke=""/>
<fileInfo id="com.st.stm32cube.ide.mcu.gnu.managedbuild.config.exe.debug.456731299.1252556889" name="monitoring.h" rcbsApplicability="disable" resourcePath="nehemis/enduranceTestBench.h" toolsToInvoke=""/>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="NorthStar-Emotas-Stack"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="coappl"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="common"/>
<entry excluding="lss.c|lss.h|monitoring.h|monitoring.c" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nehemis"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nms-hal"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="scheduler"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nms_hal"/>
<entry excluding="lss.c|lss.h" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nehemis"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="common"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nms_can"/>
<entry excluding="colib_ml|codrv_ml" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="north-star_emotas-stack"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="coappl"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
</sourceEntries>
</configuration>
</storageModule>
@ -233,6 +245,11 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/scheduler}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/log}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms-hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_can}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/common}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/stm32_mcan}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/colib_sl/inc}&quot;"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.957070642" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
</tool>
@ -287,6 +304,11 @@
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/scheduler}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/log}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms-hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_hal}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/nms_can}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/common}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/codrv_sl/stm32_mcan}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/north-star_emotas-stack/colib_sl/inc}&quot;"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c.1211672677" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.input.c"/>
</tool>
@ -313,10 +335,10 @@
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nms_hal"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nehemis"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Core"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Drivers"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nehemis"/>
<entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="nms-hal"/>
</sourceEntries>
</configuration>
</storageModule>

File diff suppressed because one or more lines are too long

View File

@ -30,21 +30,25 @@
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
<linkedResources>
<link>
<name>NorthStar-Emotas-Stack</name>
<type>2</type>
<locationURI>copy_PARENT/NorthStar-Emotas-Stack</locationURI>
</link>
<link>
<name>common</name>
<type>2</type>
<locationURI>copy_PARENT/common</locationURI>
<locationURI>PARENT-1-PARENT_LOC/common</locationURI>
</link>
<link>
<name>nms_can</name>
<type>2</type>
<locationURI>PROJECT_LOC/nms_can</locationURI>
</link>
<link>
<name>nms_hal</name>
<type>2</type>
<locationURI>PROJECT_LOC/nms_hal</locationURI>
</link>
<link>
<name>north-star_emotas-stack</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/north-star_emotas-stack</locationURI>
</link>
</linkedResources>
<variableList>
<variable>
<name>copy_PARENT</name>
<value>$%7BPARENT-3-PROJECT_LOC%7D/Documents/NorthStar-Endurance-TestBench</value>
</variable>
</variableList>
</projectDescription>

View File

@ -0,0 +1,52 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file dma.h
* @brief This file contains all the function prototypes for
* the dma.c file
******************************************************************************
* @attention
*
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __DMA_H__
#define __DMA_H__
#ifdef __cplusplus
extern "C" {
#endif
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* DMA memory to memory transfer handles -------------------------------------*/
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_DMA_Init(void);
/* USER CODE BEGIN Prototypes */
/* USER CODE END Prototypes */
#ifdef __cplusplus
}
#endif
#endif /* __DMA_H__ */

View File

@ -55,7 +55,9 @@ void SVC_Handler(void);
void DebugMon_Handler(void);
void PendSV_Handler(void);
void SysTick_Handler(void);
void DMA1_Channel1_IRQHandler(void);
void TIM1_TRG_COM_TIM17_IRQHandler(void);
void TIM6_DAC_IRQHandler(void);
void I2C4_EV_IRQHandler(void);
void I2C4_ER_IRQHandler(void);
/* USER CODE BEGIN EFP */

View File

@ -32,12 +32,15 @@ extern "C" {
/* USER CODE END Includes */
extern TIM_HandleTypeDef htim6;
extern TIM_HandleTypeDef htim17;
/* USER CODE BEGIN Private defines */
/* USER CODE END Private defines */
void MX_TIM6_Init(void);
void MX_TIM17_Init(void);
/* USER CODE BEGIN Prototypes */

View File

@ -25,6 +25,7 @@
/* USER CODE END 0 */
ADC_HandleTypeDef hadc1;
DMA_HandleTypeDef hdma_adc1;
/* ADC1 init function */
void MX_ADC1_Init(void)
@ -48,16 +49,16 @@ void MX_ADC1_Init(void)
hadc1.Init.Resolution = ADC_RESOLUTION_12B;
hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
hadc1.Init.GainCompensation = 0;
hadc1.Init.ScanConvMode = ADC_SCAN_DISABLE;
hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
hadc1.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
hadc1.Init.LowPowerAutoWait = DISABLE;
hadc1.Init.ContinuousConvMode = DISABLE;
hadc1.Init.NbrOfConversion = 1;
hadc1.Init.ContinuousConvMode = ENABLE;
hadc1.Init.NbrOfConversion = 9;
hadc1.Init.DiscontinuousConvMode = DISABLE;
hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
hadc1.Init.DMAContinuousRequests = DISABLE;
hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED;
hadc1.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN;
hadc1.Init.OversamplingMode = DISABLE;
if (HAL_ADC_Init(&hadc1) != HAL_OK)
{
@ -84,6 +85,78 @@ void MX_ADC1_Init(void)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_2;
sConfig.Rank = ADC_REGULAR_RANK_2;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_3;
sConfig.Rank = ADC_REGULAR_RANK_3;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_4;
sConfig.Rank = ADC_REGULAR_RANK_4;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_5;
sConfig.Rank = ADC_REGULAR_RANK_5;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_6;
sConfig.Rank = ADC_REGULAR_RANK_6;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_7;
sConfig.Rank = ADC_REGULAR_RANK_7;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_8;
sConfig.Rank = ADC_REGULAR_RANK_8;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/** Configure Regular Channel
*/
sConfig.Channel = ADC_CHANNEL_9;
sConfig.Rank = ADC_REGULAR_RANK_9;
if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN ADC1_Init 2 */
/* USER CODE END ADC1_Init 2 */
@ -142,6 +215,24 @@ void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle)
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(PMP_FB_GPIO_Port, &GPIO_InitStruct);
/* ADC1 DMA Init */
/* ADC1 Init */
hdma_adc1.Instance = DMA1_Channel1;
hdma_adc1.Init.Request = DMA_REQUEST_ADC1;
hdma_adc1.Init.Direction = DMA_PERIPH_TO_MEMORY;
hdma_adc1.Init.PeriphInc = DMA_PINC_DISABLE;
hdma_adc1.Init.MemInc = DMA_MINC_ENABLE;
hdma_adc1.Init.PeriphDataAlignment = DMA_PDATAALIGN_HALFWORD;
hdma_adc1.Init.MemDataAlignment = DMA_MDATAALIGN_HALFWORD;
hdma_adc1.Init.Mode = DMA_CIRCULAR;
hdma_adc1.Init.Priority = DMA_PRIORITY_LOW;
if (HAL_DMA_Init(&hdma_adc1) != HAL_OK)
{
Error_Handler();
}
__HAL_LINKDMA(adcHandle,DMA_Handle,hdma_adc1);
/* USER CODE BEGIN ADC1_MspInit 1 */
/* USER CODE END ADC1_MspInit 1 */
@ -176,6 +267,8 @@ void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle)
HAL_GPIO_DeInit(PMP_FB_GPIO_Port, PMP_FB_Pin);
/* ADC1 DMA DeInit */
HAL_DMA_DeInit(adcHandle->DMA_Handle);
/* USER CODE BEGIN ADC1_MspDeInit 1 */
/* USER CODE END ADC1_MspDeInit 1 */

View File

@ -0,0 +1,56 @@
/* USER CODE BEGIN Header */
/**
******************************************************************************
* @file dma.c
* @brief This file provides code for the configuration
* of all the requested memory to memory DMA transfers.
******************************************************************************
* @attention
*
* Copyright (c) 2025 STMicroelectronics.
* All rights reserved.
*
* This software is licensed under terms that can be found in the LICENSE file
* in the root directory of this software component.
* If no LICENSE file comes with this software, it is provided AS-IS.
*
******************************************************************************
*/
/* USER CODE END Header */
/* Includes ------------------------------------------------------------------*/
#include "dma.h"
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/*----------------------------------------------------------------------------*/
/* Configure DMA */
/*----------------------------------------------------------------------------*/
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/**
* Enable DMA controller clock
*/
void MX_DMA_Init(void)
{
/* DMA controller clock enable */
__HAL_RCC_DMAMUX1_CLK_ENABLE();
__HAL_RCC_DMA1_CLK_ENABLE();
/* DMA interrupt init */
/* DMA1_Channel1_IRQn interrupt configuration */
HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
}
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */

View File

@ -19,6 +19,7 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "adc.h"
#include "dma.h"
#include "fdcan.h"
#include "i2c.h"
#include "tim.h"
@ -78,7 +79,7 @@ int main(void)
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
HAL_Init();
/* USER CODE BEGIN Init */
@ -93,11 +94,13 @@ int main(void)
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_DMA_Init();
MX_FDCAN1_Init();
MX_TIM17_Init();
MX_FDCAN2_Init();
MX_ADC1_Init();
MX_I2C4_Init();
MX_TIM6_Init();
/* USER CODE BEGIN 2 */
SdlInit();

View File

@ -55,7 +55,9 @@
/* USER CODE END 0 */
/* External variables --------------------------------------------------------*/
extern DMA_HandleTypeDef hdma_adc1;
extern I2C_HandleTypeDef hi2c4;
extern TIM_HandleTypeDef htim6;
extern TIM_HandleTypeDef htim17;
/* USER CODE BEGIN EV */
@ -199,6 +201,20 @@ void SysTick_Handler(void)
/* please refer to the startup file (startup_stm32g4xx.s). */
/******************************************************************************/
/**
* @brief This function handles DMA1 channel1 global interrupt.
*/
void DMA1_Channel1_IRQHandler(void)
{
/* USER CODE BEGIN DMA1_Channel1_IRQn 0 */
/* USER CODE END DMA1_Channel1_IRQn 0 */
HAL_DMA_IRQHandler(&hdma_adc1);
/* USER CODE BEGIN DMA1_Channel1_IRQn 1 */
/* USER CODE END DMA1_Channel1_IRQn 1 */
}
/**
* @brief This function handles TIM1 trigger and commutation interrupts and TIM17 global interrupt.
*/
@ -213,6 +229,20 @@ void TIM1_TRG_COM_TIM17_IRQHandler(void)
/* USER CODE END TIM1_TRG_COM_TIM17_IRQn 1 */
}
/**
* @brief This function handles TIM6 global interrupt, DAC1 and DAC3 channel underrun error interrupts.
*/
void TIM6_DAC_IRQHandler(void)
{
/* USER CODE BEGIN TIM6_DAC_IRQn 0 */
/* USER CODE END TIM6_DAC_IRQn 0 */
HAL_TIM_IRQHandler(&htim6);
/* USER CODE BEGIN TIM6_DAC_IRQn 1 */
/* USER CODE END TIM6_DAC_IRQn 1 */
}
/**
* @brief This function handles I2C4 event interrupt / I2C4 wake-up interrupt through EXTI line 42.
*/

View File

@ -24,8 +24,42 @@
/* USER CODE END 0 */
TIM_HandleTypeDef htim6;
TIM_HandleTypeDef htim17;
/* TIM6 init function */
void MX_TIM6_Init(void)
{
/* USER CODE BEGIN TIM6_Init 0 */
/* USER CODE END TIM6_Init 0 */
TIM_MasterConfigTypeDef sMasterConfig = {0};
/* USER CODE BEGIN TIM6_Init 1 */
/* USER CODE END TIM6_Init 1 */
htim6.Instance = TIM6;
htim6.Init.Prescaler = 3999;
htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
htim6.Init.Period = 9999;
htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_ENABLE;
if (HAL_TIM_Base_Init(&htim6) != HAL_OK)
{
Error_Handler();
}
sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN TIM6_Init 2 */
/* USER CODE END TIM6_Init 2 */
}
/* TIM17 init function */
void MX_TIM17_Init(void)
{
@ -57,7 +91,22 @@ void MX_TIM17_Init(void)
void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
{
if(tim_baseHandle->Instance==TIM17)
if(tim_baseHandle->Instance==TIM6)
{
/* USER CODE BEGIN TIM6_MspInit 0 */
/* USER CODE END TIM6_MspInit 0 */
/* TIM6 clock enable */
__HAL_RCC_TIM6_CLK_ENABLE();
/* TIM6 interrupt Init */
HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 0, 0);
HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
/* USER CODE BEGIN TIM6_MspInit 1 */
/* USER CODE END TIM6_MspInit 1 */
}
else if(tim_baseHandle->Instance==TIM17)
{
/* USER CODE BEGIN TIM17_MspInit 0 */
@ -77,7 +126,21 @@ void HAL_TIM_Base_MspInit(TIM_HandleTypeDef* tim_baseHandle)
void HAL_TIM_Base_MspDeInit(TIM_HandleTypeDef* tim_baseHandle)
{
if(tim_baseHandle->Instance==TIM17)
if(tim_baseHandle->Instance==TIM6)
{
/* USER CODE BEGIN TIM6_MspDeInit 0 */
/* USER CODE END TIM6_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_TIM6_CLK_DISABLE();
/* TIM6 interrupt Deinit */
HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn);
/* USER CODE BEGIN TIM6_MspDeInit 1 */
/* USER CODE END TIM6_MspDeInit 1 */
}
else if(tim_baseHandle->Instance==TIM17)
{
/* USER CODE BEGIN TIM17_MspDeInit 0 */

View File

@ -1,15 +1,69 @@
#MicroXplorer Configuration settings - do not modify
ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_1
ADC1.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_2
ADC1.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_3
ADC1.Channel-3\#ChannelRegularConversion=ADC_CHANNEL_4
ADC1.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_5
ADC1.Channel-5\#ChannelRegularConversion=ADC_CHANNEL_6
ADC1.Channel-6\#ChannelRegularConversion=ADC_CHANNEL_7
ADC1.Channel-7\#ChannelRegularConversion=ADC_CHANNEL_8
ADC1.Channel-8\#ChannelRegularConversion=ADC_CHANNEL_9
ADC1.CommonPathInternal=null|null|null|null
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,NbrOfConversionFlag,master,CommonPathInternal
ADC1.ContinuousConvMode=ENABLE
ADC1.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,NbrOfConversionFlag,master,Overrun,ContinuousConvMode,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,Rank-3\#ChannelRegularConversion,Channel-3\#ChannelRegularConversion,SamplingTime-3\#ChannelRegularConversion,OffsetNumber-3\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,OffsetNumber-4\#ChannelRegularConversion,Rank-5\#ChannelRegularConversion,Channel-5\#ChannelRegularConversion,SamplingTime-5\#ChannelRegularConversion,OffsetNumber-5\#ChannelRegularConversion,Rank-6\#ChannelRegularConversion,Channel-6\#ChannelRegularConversion,SamplingTime-6\#ChannelRegularConversion,OffsetNumber-6\#ChannelRegularConversion,Rank-7\#ChannelRegularConversion,Channel-7\#ChannelRegularConversion,SamplingTime-7\#ChannelRegularConversion,OffsetNumber-7\#ChannelRegularConversion,Rank-8\#ChannelRegularConversion,Channel-8\#ChannelRegularConversion,SamplingTime-8\#ChannelRegularConversion,OffsetNumber-8\#ChannelRegularConversion,NbrOfConversion,CommonPathInternal
ADC1.NbrOfConversion=9
ADC1.NbrOfConversionFlag=1
ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-2\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-3\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-4\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-5\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-6\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-7\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.OffsetNumber-8\#ChannelRegularConversion=ADC_OFFSET_NONE
ADC1.Overrun=ADC_OVR_DATA_OVERWRITTEN
ADC1.Rank-0\#ChannelRegularConversion=1
ADC1.Rank-1\#ChannelRegularConversion=2
ADC1.Rank-2\#ChannelRegularConversion=3
ADC1.Rank-3\#ChannelRegularConversion=4
ADC1.Rank-4\#ChannelRegularConversion=5
ADC1.Rank-5\#ChannelRegularConversion=6
ADC1.Rank-6\#ChannelRegularConversion=7
ADC1.Rank-7\#ChannelRegularConversion=8
ADC1.Rank-8\#ChannelRegularConversion=9
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-1\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-2\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-3\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-4\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-5\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-6\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-7\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.SamplingTime-8\#ChannelRegularConversion=ADC_SAMPLETIME_2CYCLES_5
ADC1.master=1
CAD.formats=
CAD.pinconfig=
CAD.provider=
Dma.ADC1.0.Direction=DMA_PERIPH_TO_MEMORY
Dma.ADC1.0.EventEnable=DISABLE
Dma.ADC1.0.Instance=DMA1_Channel1
Dma.ADC1.0.MemDataAlignment=DMA_MDATAALIGN_HALFWORD
Dma.ADC1.0.MemInc=DMA_MINC_ENABLE
Dma.ADC1.0.Mode=DMA_CIRCULAR
Dma.ADC1.0.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD
Dma.ADC1.0.PeriphInc=DMA_PINC_DISABLE
Dma.ADC1.0.Polarity=HAL_DMAMUX_REQ_GEN_RISING
Dma.ADC1.0.Priority=DMA_PRIORITY_LOW
Dma.ADC1.0.RequestNumber=1
Dma.ADC1.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,SignalID,Polarity,RequestNumber,SyncSignalID,SyncPolarity,SyncEnable,EventEnable,SyncRequestNumber
Dma.ADC1.0.SignalID=NONE
Dma.ADC1.0.SyncEnable=DISABLE
Dma.ADC1.0.SyncPolarity=HAL_DMAMUX_SYNC_NO_EVENT
Dma.ADC1.0.SyncRequestNumber=1
Dma.ADC1.0.SyncSignalID=NONE
Dma.Request0=ADC1
Dma.RequestsNb=1
FDCAN1.AutoRetransmission=ENABLE
FDCAN1.CalculateBaudRateNominal=250000
FDCAN1.CalculateTimeBitNominal=4000
@ -30,21 +84,23 @@ FDCAN2.IPParameters=CalculateTimeQuantumNominal,CalculateTimeBitNominal,Calculat
FDCAN2.NominalPrescaler=32
FDCAN2.NominalTimeSeg1=2
File.Version=6
GPIO.groupedBy=
GPIO.groupedBy=Group By Peripherals
I2C4.IPParameters=Timing
I2C4.Timing=0x00D09BE3
KeepUserPlacement=false
Mcu.CPN=STM32G474RET6
Mcu.Family=STM32G4
Mcu.IP0=ADC1
Mcu.IP1=FDCAN1
Mcu.IP2=FDCAN2
Mcu.IP3=I2C4
Mcu.IP4=NVIC
Mcu.IP5=RCC
Mcu.IP6=SYS
Mcu.IP7=TIM17
Mcu.IPNb=8
Mcu.IP1=DMA
Mcu.IP2=FDCAN1
Mcu.IP3=FDCAN2
Mcu.IP4=I2C4
Mcu.IP5=NVIC
Mcu.IP6=RCC
Mcu.IP7=SYS
Mcu.IP8=TIM6
Mcu.IP9=TIM17
Mcu.IPNb=10
Mcu.Name=STM32G474R(B-C-E)Tx
Mcu.Package=LQFP64
Mcu.Pin0=PF0-OSC_IN
@ -65,7 +121,8 @@ Mcu.Pin21=PB3
Mcu.Pin22=PB4
Mcu.Pin23=VP_SYS_VS_Systick
Mcu.Pin24=VP_SYS_VS_DBSignals
Mcu.Pin25=VP_TIM17_VS_ClockSourceINT
Mcu.Pin25=VP_TIM6_VS_ClockSourceINT
Mcu.Pin26=VP_TIM17_VS_ClockSourceINT
Mcu.Pin3=PC1
Mcu.Pin4=PC2
Mcu.Pin5=PC3
@ -73,13 +130,14 @@ Mcu.Pin6=PA0
Mcu.Pin7=PA1
Mcu.Pin8=PA2
Mcu.Pin9=PA3
Mcu.PinsNb=26
Mcu.PinsNb=27
Mcu.ThirdPartyNb=0
Mcu.UserConstants=
Mcu.UserName=STM32G474RETx
MxCube.Version=6.12.0
MxDb.Version=DB.6.0.120
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.DMA1_Channel1_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:true
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.ForceEnableDMAVector=true
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
@ -92,6 +150,7 @@ NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
NVIC.TIM1_TRG_COM_TIM17_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.TIM6_DAC_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
PA0.GPIOParameters=GPIO_Label
PA0.GPIO_Label=PS1
@ -206,8 +265,8 @@ ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=ProcessBoardV1.ioc
ProjectManager.ProjectName=ProcessBoardV1
ProjectManager.ProjectFileName=EnduranceTestBench.ioc
ProjectManager.ProjectName=EnduranceTestBench
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x400
@ -216,7 +275,7 @@ ProjectManager.ToolChainLocation=
ProjectManager.UAScriptAfterPath=
ProjectManager.UAScriptBeforePath=
ProjectManager.UnderRoot=true
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_FDCAN1_Init-FDCAN1-false-HAL-true,4-MX_TIM17_Init-TIM17-false-HAL-true,5-MX_FDCAN2_Init-FDCAN2-false-HAL-true,6-MX_ADC1_Init-ADC1-false-HAL-true,7-MX_I2C4_Init-I2C4-false-HAL-true
ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_DMA_Init-DMA-false-HAL-true,4-MX_FDCAN1_Init-FDCAN1-false-HAL-true,5-MX_TIM17_Init-TIM17-false-HAL-true,6-MX_FDCAN2_Init-FDCAN2-false-HAL-true,7-MX_ADC1_Init-ADC1-false-HAL-true,8-MX_I2C4_Init-I2C4-false-HAL-true
RCC.ADC12Freq_Value=160000000
RCC.ADC345Freq_Value=160000000
RCC.AHBFreq_Value=160000000
@ -270,11 +329,17 @@ TIM17.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM17.IPParameters=AutoReloadPreload,Prescaler,PeriodNoDither
TIM17.PeriodNoDither=999
TIM17.Prescaler=15
TIM6.AutoReloadPreload=TIM_AUTORELOAD_PRELOAD_ENABLE
TIM6.IPParameters=Prescaler,PeriodNoDither,AutoReloadPreload
TIM6.PeriodNoDither=9999
TIM6.Prescaler=3999
VP_SYS_VS_DBSignals.Mode=DisableDeadBatterySignals
VP_SYS_VS_DBSignals.Signal=SYS_VS_DBSignals
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
VP_TIM17_VS_ClockSourceINT.Mode=Enable_Timer
VP_TIM17_VS_ClockSourceINT.Signal=TIM17_VS_ClockSourceINT
VP_TIM6_VS_ClockSourceINT.Mode=Enable_Timer
VP_TIM6_VS_ClockSourceINT.Signal=TIM6_VS_ClockSourceINT
board=custom
isbadioc=false

View File

@ -6,11 +6,30 @@ Index,Sub,EDSname,Datatype,Access,Value,varname,LowLimit,UpLimit,hasDefault,hasL
0x1008,0x00,Manufacturer device name,VISIBLE_STRING,const,emotas Slave 1,NONE,0,0,yes,no,no,no,1,ManagedConst,14,,no
0x1014,0x00,COB ID EMCY,UNSIGNED32,ro,$NODEID+0x80,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1015,0x00,Inhibit Time Emergency,UNSIGNED16,rw,0,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x00,Consumer Heartbeat Time Number of entries,UNSIGNED8,ro,1,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x1016,0x01,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,0,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1017,0x00,Producer Heartbeat Time,UNSIGNED16,rw,1500,NONE,0,65535,no,no,no,no,0,ManagedVariable,0,,no
0x1016,0x00,Consumer Heartbeat Time Number of entries,UNSIGNED8,ro,20,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x1016,0x01,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x02,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x03,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x04,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x05,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x06,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x07,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x08,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x09,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x0a,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x0b,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x0c,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x0d,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x0e,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x0f,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x10,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x11,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x12,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x13,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x14,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,500,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1017,0x00,Producer Heartbeat Time,UNSIGNED16,rw,100,NONE,0,65535,no,no,no,no,0,ManagedVariable,0,,no
0x1018,0x00,Identity Object Number of entries,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1018,0x01,Identity Object Vendor Id,UNSIGNED32,ro,793,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1018,0x01,Identity Object Vendor Id,UNSIGNED32,ro,1434,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1018,0x02,Identity Object Product Code,UNSIGNED32,ro,1234,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1018,0x03,Identity Object Revision number,UNSIGNED32,ro,1,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1018,0x04,Identity Object Serial number,UNSIGNED32,ro,,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
@ -101,115 +120,112 @@ Index,Sub,EDSname,Datatype,Access,Value,varname,LowLimit,UpLimit,hasDefault,hasL
0x1293,0x01,SDO client parameter COB-ID client -> server,UNSIGNED32,rw,2147483648,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1293,0x02,SDO client parameter COB-ID server -> client,UNSIGNED32,rw,2147483648,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1293,0x03,SDO client parameter Node-ID of the SDO server,UNSIGNED8,rw,,NONE,1,127,no,no,no,no,0,ManagedVariable,0,,no
0x1400,0x00,Receive PDO Communication Parameter Highest sub-index supported,UNSIGNED8,ro,2,NONE,2,5,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1400,0x01,Receive PDO Communication Parameter COB ID,UNSIGNED32,rw,$NODEID+0x200,NONE,385,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1400,0x02,Receive PDO Communication Parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1401,0x00,Receive PDO Communication Parameter Highest sub-index supported,UNSIGNED8,ro,2,NONE,2,5,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1401,0x01,Receive PDO Communication Parameter COB ID,UNSIGNED32,rw,$NODEID+0x200,NONE,385,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1401,0x02,Receive PDO Communication Parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1402,0x00,Receive PDO Communication Parameter Highest sub-index supported,UNSIGNED8,ro,2,NONE,2,5,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1402,0x01,Receive PDO Communication Parameter COB ID,UNSIGNED32,rw,$NODEID+0x200,NONE,385,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1402,0x02,Receive PDO Communication Parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1600,0x00,Receive PDO Mapping Parameter Highest sub-index supported,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1600,0x01,Receive PDO Mapping Parameter Mapping Entry 1,UNSIGNED32,const,1610678560,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1600,0x02,Receive PDO Mapping Parameter Mapping Entry 2,UNSIGNED32,const,1610678816,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1601,0x00,Receive PDO Mapping Parameter Highest sub-index supported,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1601,0x01,Receive PDO Mapping Parameter Mapping Entry 1,UNSIGNED32,const,1610679072,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1601,0x02,Receive PDO Mapping Parameter Mapping Entry 2,UNSIGNED32,const,1610679328,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1602,0x00,Receive PDO Mapping Parameter Highest sub-index supported,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1602,0x01,Receive PDO Mapping Parameter Mapping Entry 1,UNSIGNED32,const,1610679584,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1602,0x02,Receive PDO Mapping Parameter Mapping Entry 2,UNSIGNED32,const,1610679840,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1800,0x00,TPDO communication parameter Number of entries,UNSIGNED8,ro,5,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1800,0x01,TPDO communication parameter COB ID,UNSIGNED32,rw,$NODEID+0x180,NONE,1,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x02,TPDO communication parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x03,TPDO communication parameter Inhibit Time,UNSIGNED16,rw,0,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x04,TPDO communication parameter Compatibility Entry,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1800,0x05,TPDO communication parameter Event Timer,UNSIGNED16,rw,500,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1801,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1801,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x280,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1801,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1802,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x380,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1802,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1803,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x480,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1803,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,both
0x1803,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,both
0x1804,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x180+1,NONE,128,4294967295,yes,no,no,no,2,ManagedVariable,0,,tpdo
0x1804,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1a00,0x00,Conductivity Data OUT1 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a00,0x01,Conductivity Data OUT1 Mapping Entry 1,UNSIGNED32,const,1610744096,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a00,0x02,Conductivity Data OUT1 Mapping Entry 2,UNSIGNED32,const,1610744352,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x00,Conductivity Data OUT2 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a01,0x01,Conductivity Data OUT2 Mapping Entry 1,UNSIGNED32,const,1610744608,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x02,Conductivity Data OUT2 Mapping Entry 2,UNSIGNED32,const,1610744864,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a02,0x00,Conductivity Data OUT3 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a02,0x01,Conductivity Data OUT3 Mapping Entry 1,UNSIGNED32,const,1610745120,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a02,0x02,Conductivity Data OUT3 Mapping Entry 2,UNSIGNED32,const,1610745376,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x00, Pressue and Flowmeter Data OUT1 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a03,0x01, Pressue and Flowmeter Data OUT1 Mapping Entry 1,UNSIGNED32,const,1610875168,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x02, Pressue and Flowmeter Data OUT1 Mapping Entry 2,UNSIGNED32,const,1610940704,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a04,0x00, Pressue and Flowmeter Data OUT2 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a04,0x01, Pressue and Flowmeter Data OUT2 Mapping Entry 1,UNSIGNED32,const,1610679072,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a04,0x02, Pressue and Flowmeter Data OUT2 Mapping Entry 2,UNSIGNED32,const,1610679328,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1800,0x00,Flowmeter communication parameter Number of entries,UNSIGNED8,ro,5,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1800,0x01,Flowmeter communication parameter COB ID,UNSIGNED32,rw,$NODEID+0x280,NONE,1,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x02,Flowmeter communication parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x03,Flowmeter communication parameter Inhibit Time,UNSIGNED16,rw,0,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x04,Flowmeter communication parameter Compatibility Entry,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1800,0x05,Flowmeter communication parameter Event Timer,UNSIGNED16,rw,100,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1801,0x00,Pressure communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1801,0x01,Pressure communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x280+1,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1801,0x02,Pressure communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,2,ManagedVariable,0,,no
0x1801,0x03,Pressure communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x04,Pressure communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x05,Pressure communication parameter Event timer,UNSIGNED16,rw,100,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x06,Pressure communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x00,Pump communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1802,0x01,Pump communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x280+2,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1802,0x02,Pump communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,2,ManagedVariable,0,,no
0x1802,0x03,Pump communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x04,Pump communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x05,Pump communication parameter Event timer,UNSIGNED16,rw,100,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x06,Pump communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x00,Motor setpoint 1 communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1803,0x01,Motor setpoint 1 communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x280+3,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1803,0x02,Motor setpoint 1 communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,2,ManagedVariable,0,,both
0x1803,0x03,Motor setpoint 1 communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x04,Motor setpoint 1 communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x05,Motor setpoint 1 communication parameter Event timer,UNSIGNED16,rw,100,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x06,Motor setpoint 1 communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x00,Motor setpoint 2 communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,both
0x1804,0x01,Motor setpoint 2 communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x280+4,NONE,128,4294967295,yes,no,no,no,2,ManagedVariable,0,,tpdo
0x1804,0x02,Motor setpoint 2 communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,2,ManagedVariable,0,,no
0x1804,0x03,Motor setpoint 2 communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x04,Motor setpoint 2 communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x05,Motor setpoint 2 communication parameter Event timer,UNSIGNED16,rw,100,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x06,Motor setpoint 2 communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1805,0x00,Motor setpoint 2 communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,both
0x1805,0x01,Motor setpoint 2 communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x280+5,NONE,128,4294967295,yes,no,no,no,2,ManagedVariable,0,,tpdo
0x1805,0x02,Motor setpoint 2 communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,2,ManagedVariable,0,,no
0x1805,0x03,Motor setpoint 2 communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1805,0x04,Motor setpoint 2 communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1805,0x05,Motor setpoint 2 communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1805,0x06,Motor setpoint 2 communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1a00,0x00,Flowmeter Data mapping parameter Number of entries,UNSIGNED8,const,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a00,0x01,Flowmeter Data mapping parameter Mapping Entry 1,UNSIGNED32,const,536871184,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a00,0x02,Flowmeter Data mapping parameter Mapping Entry 2,UNSIGNED32,const,536871440,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a00,0x03,Flowmeter Data mapping parameter Mapping Entry 3,UNSIGNED32,const,536871696,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a00,0x04,Flowmeter Data mapping parameter Mapping Entry 4,UNSIGNED32,const,536871952,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x00,Pressure Sensor mapping parameter Number of entries,UNSIGNED8,const,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a01,0x01,Pressure Sensor mapping parameter Mapping Entry 1,UNSIGNED32,const,536936720,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x02,Pressure Sensor mapping parameter Mapping Entry 2,UNSIGNED32,const,536936976,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x03,Pressure Sensor mapping parameter Mapping Entry 3,UNSIGNED32,const,536937232,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x04,Pressure Sensor mapping parameter Mapping Entry 4,UNSIGNED32,const,536937488,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a02,0x00,Pump mapping parameter Number of entries,UNSIGNED8,const,1,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a02,0x01,Pump mapping parameter Mapping Entry 1,UNSIGNED32,const,537067536,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x00,Motor setpoint 1 mapping parameter Number of entries,UNSIGNED8,const,8,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a03,0x01,Motor setpoint 1 mapping parameter Mapping Entry 1,UNSIGNED32,const,537133320,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x02,Motor setpoint 1 mapping parameter Mapping Entry 2,UNSIGNED32,const,537133576,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x03,Motor setpoint 1 mapping parameter Mapping Entry 3,UNSIGNED32,const,537133832,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x04,Motor setpoint 1 mapping parameter Mapping Entry 4,UNSIGNED32,const,537134088,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x05,Motor setpoint 1 mapping parameter Mapping Entry 5,UNSIGNED32,const,537134344,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x06,Motor setpoint 1 mapping parameter Mapping Entry 6,UNSIGNED32,const,537134600,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x07,Motor setpoint 1 mapping parameter Mapping Entry 7,UNSIGNED32,const,537134856,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x08,Motor setpoint 1 mapping parameter Mapping Entry 8,UNSIGNED32,const,537135112,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a04,0x00,Motor setpoint 2 mapping parameter Number of entries,UNSIGNED8,const,8,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a04,0x01,Motor setpoint 2 mapping parameter Mapping Entry 1,UNSIGNED32,const,537135368,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a04,0x02,Motor setpoint 2 mapping parameter Mapping Entry 2,UNSIGNED32,const,537135624,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a04,0x03,Motor setpoint 2 mapping parameter Mapping Entry 3,UNSIGNED32,const,537135880,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a04,0x04,Motor setpoint 2 mapping parameter Mapping Entry 4,UNSIGNED32,const,537136136,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a04,0x05,Motor setpoint 2 mapping parameter Mapping Entry 5,UNSIGNED32,const,537136392,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a04,0x06,Motor setpoint 2 mapping parameter Mapping Entry 6,UNSIGNED32,const,537136648,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a04,0x07,Motor setpoint 2 mapping parameter Mapping Entry 7,UNSIGNED32,const,537136904,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a04,0x08,Motor setpoint 2 mapping parameter Mapping Entry 8,UNSIGNED32,const,537137160,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a05,0x00,Motor setpoint 3 mapping parameter Number of entries,UNSIGNED8,const,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a05,0x01,Motor setpoint 3 mapping parameter Mapping Entry 1,UNSIGNED32,const,537137416,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a05,0x02,Motor setpoint 3 mapping parameter Mapping Entry 2,UNSIGNED32,const,537137672,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a05,0x03,Motor setpoint 3 mapping parameter Mapping Entry 3,UNSIGNED32,const,537137928,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1a05,0x04,Motor setpoint 3 mapping parameter Mapping Entry 4,UNSIGNED32,const,537138184,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x2001,0x00,Manufacturer Object,INTEGER32,rw,4,NONE,0,0,no,no,no,no,0,ManagedVariable,0,,both
0x3000,0x00,Managed Array NUmber of Entries,UNSIGNED8,ro,2,NONE,0,0,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x3000,0x01,Managed Array Sub 1,INTEGER16,ro,,NONE,0,0,no,no,no,no,0,ManagedVariable,0,,tpdo
0x3000,0x02,Managed Array sub 2,INTEGER16,rw,2,NONE,0,0,no,no,no,no,0,ManagedVariable,0,,both
0x6000,0x00,Motor Valve Control Highest sub-index supported,UNSIGNED8,ro,5,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6000,0x01,Motor Valve Control ID,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x02,Motor Valve Control Command,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x03,Motor Valve Control Position setpoint,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x04,Motor Valve Control Pressure setpoint,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x05,Motor Valve Control Flowrate setpoint,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6001,0x00,Conductivity Sensor Data IN Highest sub-index supported,UNSIGNED8,ro,6,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6001,0x01,Conductivity Sensor Data IN Conductivity Data IN1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x02,Conductivity Sensor Data IN Temperature Data IN1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x03,Conductivity Sensor Data IN Conductivity Data IN2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x04,Conductivity Sensor Data IN Temperature Data IN2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x05,Conductivity Sensor Data IN Conductivity Data IN3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x06,Conductivity Sensor Data IN Temperature Data IN3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x00,Conductivity Sensor Data OUT Highest sub-index supported,UNSIGNED8,ro,6,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6002,0x01,Conductivity Sensor Data OUT Conductivity Data OUT1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x02,Conductivity Sensor Data OUT Temperature Data OUT1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x03,Conductivity Sensor Data OUT Conductivity Data OUT2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x04,Conductivity Sensor Data OUT Temperature Data OUT2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x05,Conductivity Sensor Data OUT Conductivity Data OUT3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x06,Conductivity Sensor Data OUT Temperature Data OUT3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x00,Motor Valve Data OUT Highest sub-index supported,UNSIGNED8,ro,8,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6003,0x01,Motor Valve Data OUT MV 01 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x02,Motor Valve Data OUT MV 02 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x03,Motor Valve Data OUT MV 03 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x04,Motor Valve Data OUT MV 04 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x05,Motor Valve Data OUT MV 05 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x06,Motor Valve Data OUT MV 06 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x07,Motor Valve Data OUT MV 07 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x08,Motor Valve Data OUT MV 08 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x00,Flowmeter Data OUT Highest sub-index supported,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6004,0x01,Flowmeter Data OUT FM1 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x02,Flowmeter Data OUT FM2 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x03,Flowmeter Data OUT FM3 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x04,Flowmeter Data OUT FM4 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x00,Pressure Sensor Data OUT Highest sub-index supported,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6005,0x01,Pressure Sensor Data OUT PS1 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x02,Pressure Sensor Data OUT PS2 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x03,Pressure Sensor Data OUT PS3 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x04,Pressure Sensor Data OUT PS4 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x2000,0x00,Flowmeter Data OUT Highest sub-index supported,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x2000,0x01,Flowmeter Data OUT FM1 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2000,0x02,Flowmeter Data OUT FM2 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2000,0x03,Flowmeter Data OUT FM3 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2000,0x04,Flowmeter Data OUT FM4 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2001,0x00,Pressure Sensor Data OUT Highest sub-index supported,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x2001,0x01,Pressure Sensor Data OUT PS1 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2001,0x02,Pressure Sensor Data OUT PS2 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2001,0x03,Pressure Sensor Data OUT PS3 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2001,0x04,Pressure Sensor Data OUT PS4 OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2003,0x00,Pump Data OUT,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,1,ManagedVariable,0,,tpdo
0x2004,0x00,Motor Valve Data OUT Highest sub-index supported,UNSIGNED8,ro,20,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x2004,0x01,Motor Valve Data OUT MV 01 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x02,Motor Valve Data OUT MV 02 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x03,Motor Valve Data OUT MV 03 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x04,Motor Valve Data OUT MV 04 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x05,Motor Valve Data OUT MV 05 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x06,Motor Valve Data OUT MV 06 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x07,Motor Valve Data OUT MV 07 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x08,Motor Valve Data OUT MV 08 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x09,Motor Valve Data OUT MV 09 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x0a,Motor Valve Data OUT MV 10 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x0b,Motor Valve Data OUT MV 11 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x0c,Motor Valve Data OUT MV 12 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x0d,Motor Valve Data OUT MV 13 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x0e,Motor Valve Data OUT MV 14 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x0f,Motor Valve Data OUT MV 15 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x10,Motor Valve Data OUT MV 16 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x11,Motor Valve Data OUT MV 17 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x12,Motor Valve Data OUT MV 18 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x13,Motor Valve Data OUT MV 19 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both
0x2004,0x14,Motor Valve Data OUT MV 20 Setpoint,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,1,ManagedVariable,0,,both

Can't render this file because it has a wrong number of fields in line 199.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -17,14 +17,33 @@ index,sub,objectcode,datatype,edsname,varname,access,mapable,hasdefault,defaulti
0x1015,0x00,VARIABLE,UNSIGNED16,Inhibit Time Emergency,,rw,no,1,1,0,,0,ManagedVariable,no,0,65535,no
0x1016,,ARRAY,UNSIGNED32,Consumer Heartbeat Time,,,,,,,,,,,,,,
0x1016,0x00,,UNSIGNED32,Number of entries,,ro,no,1,1,1,,0,ManagedConst,no,0,255,no
0x1016,0x01,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,0,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x00,,UNSIGNED32,Number of entries,,ro,no,1,1,20,,0,ManagedConst,no,0,255,no
0x1016,0x01,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x02,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x03,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x04,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x05,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x06,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x07,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x08,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x09,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x0a,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x0b,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x0c,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x0d,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x0e,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x0f,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x10,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x11,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x12,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x13,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1016,0x14,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,500,,0,ManagedVariable,no,0,4294967295,no
0x1017,0x00,VARIABLE,UNSIGNED16,Producer Heartbeat Time,,rw,no,0,0,1500,,0,ManagedVariable,no,0,65535,no
0x1017,0x00,VARIABLE,UNSIGNED16,Producer Heartbeat Time,,rw,no,0,0,100,,0,ManagedVariable,no,0,65535,no
0x1018,,RECORD,UNSIGNED8,Identity Object,,,,,,,,,,,,,,
0x1018,0x00,,UNSIGNED8,Number of entries,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x1018,0x01,,UNSIGNED32,Vendor Id,,ro,no,1,1,793,,0,ManagedConst,no,0,4294967295,no
0x1018,0x01,,UNSIGNED32,Vendor Id,,ro,no,1,1,1434,,0,ManagedConst,no,0,4294967295,no
0x1018,0x02,,UNSIGNED32,Product Code,,ro,no,1,1,1234,,0,ManagedConst,no,0,4294967295,no
0x1018,0x03,,UNSIGNED32,Revision number,,ro,no,1,1,1,,0,ManagedConst,no,0,4294967295,no
0x1018,0x04,,UNSIGNED32,Serial number,,ro,no,1,1,,,0,ManagedVariable,no,0,4294967295,no
@ -161,162 +180,143 @@ index,sub,objectcode,datatype,edsname,varname,access,mapable,hasdefault,defaulti
0x1293,0x02,,UNSIGNED32,COB-ID server -> client,,rw,no,1,1,2147483648,,0,ManagedVariable,no,128,4294967295,no
0x1293,0x03,,UNSIGNED8,Node-ID of the SDO server,,rw,no,0,0,,,0,ManagedVariable,no,1,127,no
0x1400,,RECORD,UNSIGNED8,Receive PDO Communication Parameter,,,,,,,This object contains the communication parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1400,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,2,,0,ManagedConst,no,2,5,no
0x1400,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x200,,0,ManagedVariable,no,385,4294967295,no
0x1400,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,Sub-index 0x2 defines the reception character of the RPDO.,0,ManagedVariable,no,0,255,no
0x1401,,RECORD,UNSIGNED8,Receive PDO Communication Parameter,,,,,,,This object contains the communication parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1401,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,2,,0,ManagedConst,no,2,5,no
0x1401,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x200,,0,ManagedVariable,no,385,4294967295,no
0x1401,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,Sub-index 0x2 defines the reception character of the RPDO.,0,ManagedVariable,no,0,255,no
0x1402,,RECORD,UNSIGNED8,Receive PDO Communication Parameter,,,,,,,This object contains the communication parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1402,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,2,,0,ManagedConst,no,2,5,no
0x1402,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x200,,0,ManagedVariable,no,385,4294967295,no
0x1402,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,Sub-index 0x2 defines the reception character of the RPDO.,0,ManagedVariable,no,0,255,no
0x1600,,RECORD,UNSIGNED8,Receive PDO Mapping Parameter,,,,,,,This object contains the mapping parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1600,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1600,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,1610678560,,0,ManagedConst,no,0,0,no
0x1600,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,1610678816,,0,ManagedConst,no,0,0,no
0x1601,,RECORD,UNSIGNED8,Receive PDO Mapping Parameter,,,,,,,This object contains the mapping parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1601,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1601,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,1610679072,,0,ManagedConst,no,0,0,no
0x1601,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,1610679328,,0,ManagedConst,no,0,0,no
0x1602,,RECORD,UNSIGNED8,Receive PDO Mapping Parameter,,,,,,,This object contains the mapping parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1602,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1602,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,1610679584,,0,ManagedConst,no,0,0,no
0x1602,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,1610679840,,0,ManagedConst,no,0,0,no
0x1800,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1800,,RECORD,UNSIGNED8,Flowmeter communication parameter,,,,,,,,,,,,,,
0x1800,0x00,,UNSIGNED8,Number of entries,,ro,no,1,1,5,,0,ManagedConst,no,2,6,no
0x1800,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x180,,0,ManagedVariable,no,1,4294967295,no
0x1800,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x280,,0,ManagedVariable,no,1,4294967295,no
0x1800,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,,0,ManagedVariable,no,0,255,no
0x1800,0x03,,UNSIGNED16,Inhibit Time,,rw,no,1,1,0,,0,ManagedVariable,no,0,65535,no
0x1800,0x04,,UNSIGNED8,Compatibility Entry,,rw,no,1,0,,,0,ManagedVariable,no,0,255,no
0x1800,0x05,,UNSIGNED16,Event Timer,,rw,no,1,1,500,,0,ManagedVariable,no,0,65535,no
0x1800,0x05,,UNSIGNED16,Event Timer,,rw,no,1,1,100,,0,ManagedVariable,no,0,65535,no
0x1801,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1801,,RECORD,UNSIGNED8,Pressure communication parameter,,,,,,,,,,,,,,
0x1801,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,6,,0,ManagedConst,no,2,6,no
0x1801,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x280,,0,ManagedVariable,no,128,4294967295,no
0x1801,0x02,,UNSIGNED8,Transmission type,,rw,no,1,0,254,,0,ManagedVariable,no,0,255,no
0x1801,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x280+1,,0,ManagedVariable,no,128,4294967295,no
0x1801,0x02,,UNSIGNED8,Transmission type,,rw,no,1,2,254,,0,ManagedVariable,no,0,255,no
0x1801,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1801,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1801,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1801,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,100,,0,ManagedVariable,no,0,0xffff,no
0x1801,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1802,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1802,,RECORD,UNSIGNED8,Pump communication parameter,,,,,,,,,,,,,,
0x1802,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,6,,0,ManagedConst,no,2,6,no
0x1802,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x380,,0,ManagedVariable,no,128,4294967295,no
0x1802,0x02,,UNSIGNED8,Transmission type,,rw,no,1,0,254,,0,ManagedVariable,no,0,255,no
0x1802,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x280+2,,0,ManagedVariable,no,128,4294967295,no
0x1802,0x02,,UNSIGNED8,Transmission type,,rw,no,1,2,254,,0,ManagedVariable,no,0,255,no
0x1802,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1802,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1802,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1802,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,100,,0,ManagedVariable,no,0,0xffff,no
0x1802,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1803,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1803,,RECORD,UNSIGNED8,Motor setpoint 1 communication parameter,,,,,,,,,,,,,,
0x1803,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,6,,0,ManagedConst,no,2,6,no
0x1803,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x480,,0,ManagedVariable,no,128,4294967295,no
0x1803,0x02,,UNSIGNED8,Transmission type,,rw,both,1,0,254,,0,ManagedVariable,no,0,255,no
0x1803,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x280+3,,0,ManagedVariable,no,128,4294967295,no
0x1803,0x02,,UNSIGNED8,Transmission type,,rw,both,1,2,254,,0,ManagedVariable,no,0,255,no
0x1803,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1803,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1803,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1803,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,100,,0,ManagedVariable,no,0,0xffff,no
0x1803,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1804,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1804,,RECORD,UNSIGNED8,Motor setpoint 2 communication parameter,,,,,,,,,,,,,,
0x1804,0x00,,UNSIGNED8,Highest sub-index supported,,const,both,1,1,6,,0,ManagedConst,no,2,6,no
0x1804,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,tpdo,1,2,$NODEID+0x180+1,,0,ManagedVariable,no,128,4294967295,no
0x1804,0x02,,UNSIGNED8,Transmission type,,rw,no,1,0,254,,0,ManagedVariable,no,0,255,no
0x1804,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,tpdo,1,2,$NODEID+0x280+4,,0,ManagedVariable,no,128,4294967295,no
0x1804,0x02,,UNSIGNED8,Transmission type,,rw,no,1,2,254,,0,ManagedVariable,no,0,255,no
0x1804,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1804,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1804,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1804,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,100,,0,ManagedVariable,no,0,0xffff,no
0x1804,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1a00,,RECORD,UNSIGNED8,Conductivity Data OUT1,,,,,,,,,,,,,,
0x1a00,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a00,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610744096,,0,ManagedConst,no,0,0,no
0x1a00,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610744352,,0,ManagedConst,no,0,0,no
0x1805,,RECORD,UNSIGNED8,Motor setpoint 2 communication parameter,,,,,,,,,,,,,,
0x1805,0x00,,UNSIGNED8,Highest sub-index supported,,const,both,1,1,6,,0,ManagedConst,no,2,6,no
0x1805,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,tpdo,1,2,$NODEID+0x280+5,,0,ManagedVariable,no,128,4294967295,no
0x1805,0x02,,UNSIGNED8,Transmission type,,rw,no,1,2,254,,0,ManagedVariable,no,0,255,no
0x1805,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1805,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1805,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1805,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1a01,,RECORD,UNSIGNED8,Conductivity Data OUT2,,,,,,,,,,,,,,
0x1a01,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a01,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610744608,,0,ManagedConst,no,0,0,no
0x1a01,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610744864,,0,ManagedConst,no,0,0,no
0x1a00,,RECORD,UNSIGNED8,Flowmeter Data mapping parameter,,,,,,,,,,,,,,
0x1a00,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,4,,0,ManagedConst,no,0,255,no
0x1a00,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,536871184,,0,ManagedConst,no,0,0,no
0x1a00,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,536871440,,0,ManagedConst,no,0,0,no
0x1a00,0x03,,UNSIGNED32,Mapping Entry 3,,const,tpdo,1,1,536871696,,0,ManagedConst,no,0,0,no
0x1a00,0x04,,UNSIGNED32,Mapping Entry 4,,const,tpdo,1,1,536871952,,0,ManagedConst,no,0,0,no
0x1a02,,RECORD,UNSIGNED8,Conductivity Data OUT3,,,,,,,,,,,,,,
0x1a02,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a02,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610745120,,0,ManagedConst,no,0,0,no
0x1a02,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610745376,,0,ManagedConst,no,0,0,no
0x1a01,,RECORD,UNSIGNED8,Pressure Sensor mapping parameter,,,,,,,,,,,,,,
0x1a01,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,4,,0,ManagedConst,no,0,255,no
0x1a01,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,536936720,,0,ManagedConst,no,0,0,no
0x1a01,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,536936976,,0,ManagedConst,no,0,0,no
0x1a01,0x03,,UNSIGNED32,Mapping Entry 3,,const,tpdo,1,1,536937232,,0,ManagedConst,no,0,0,no
0x1a01,0x04,,UNSIGNED32,Mapping Entry 4,,const,tpdo,1,1,536937488,,0,ManagedConst,no,0,0,no
0x1a03,,RECORD,UNSIGNED8, Pressue and Flowmeter Data OUT1,,,,,,,,,,,,,,
0x1a03,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a03,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610875168,,0,ManagedConst,no,0,0,no
0x1a03,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610940704,,0,ManagedConst,no,0,0,no
0x1a02,,RECORD,UNSIGNED8,Pump mapping parameter,,,,,,,,,,,,,,
0x1a02,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,1,,0,ManagedConst,no,0,255,no
0x1a02,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,537067536,,0,ManagedConst,no,0,0,no
0x1a04,,RECORD,UNSIGNED8, Pressue and Flowmeter Data OUT2,,,,,,,,,,,,,,
0x1a04,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a04,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610679072,,0,ManagedConst,no,0,0,no
0x1a04,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610679328,,0,ManagedConst,no,0,0,no
0x1a03,,RECORD,UNSIGNED8,Motor setpoint 1 mapping parameter,,,,,,,,,,,,,,
0x1a03,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,8,,0,ManagedConst,no,0,255,no
0x1a03,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,537133320,,0,ManagedConst,no,0,0,no
0x1a03,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,537133576,,0,ManagedConst,no,0,0,no
0x1a03,0x03,,UNSIGNED32,Mapping Entry 3,,const,tpdo,1,1,537133832,,0,ManagedConst,no,0,0,no
0x1a03,0x04,,UNSIGNED32,Mapping Entry 4,,const,tpdo,1,1,537134088,,0,ManagedConst,no,0,0,no
0x1a03,0x05,,UNSIGNED32,Mapping Entry 5,,const,tpdo,1,1,537134344,,0,ManagedConst,no,0,0,no
0x1a03,0x06,,UNSIGNED32,Mapping Entry 6,,const,tpdo,1,1,537134600,,0,ManagedConst,no,0,0,no
0x1a03,0x07,,UNSIGNED32,Mapping Entry 7,,const,tpdo,1,1,537134856,,0,ManagedConst,no,0,0,no
0x1a03,0x08,,UNSIGNED32,Mapping Entry 8,,const,tpdo,1,1,537135112,,0,ManagedConst,no,0,0,no
0x1a04,,RECORD,UNSIGNED8,Motor setpoint 2 mapping parameter,,,,,,,,,,,,,,
0x1a04,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,8,,0,ManagedConst,no,0,255,no
0x1a04,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,537135368,,0,ManagedConst,no,0,0,no
0x1a04,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,537135624,,0,ManagedConst,no,0,0,no
0x1a04,0x03,,UNSIGNED32,Mapping Entry 3,,const,no,1,1,537135880,,0,ManagedConst,no,0,0,no
0x1a04,0x04,,UNSIGNED32,Mapping Entry 4,,const,no,1,1,537136136,,0,ManagedConst,no,0,0,no
0x1a04,0x05,,UNSIGNED32,Mapping Entry 5,,const,no,1,1,537136392,,0,ManagedConst,no,0,0,no
0x1a04,0x06,,UNSIGNED32,Mapping Entry 6,,const,no,1,1,537136648,,0,ManagedConst,no,0,0,no
0x1a04,0x07,,UNSIGNED32,Mapping Entry 7,,const,no,1,1,537136904,,0,ManagedConst,no,0,0,no
0x1a04,0x08,,UNSIGNED32,Mapping Entry 8,,const,no,1,1,537137160,,0,ManagedConst,no,0,0,no
0x1a05,,RECORD,UNSIGNED8,Motor setpoint 3 mapping parameter,,,,,,,,,,,,,,
0x1a05,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,4,,0,ManagedConst,no,0,255,no
0x1a05,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,537137416,,0,ManagedConst,no,0,0,no
0x1a05,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,537137672,,0,ManagedConst,no,0,0,no
0x1a05,0x03,,UNSIGNED32,Mapping Entry 3,,const,no,1,1,537137928,,0,ManagedConst,no,0,0,no
0x1a05,0x04,,UNSIGNED32,Mapping Entry 4,,const,no,1,1,537138184,,0,ManagedConst,no,0,0,no
0x2001,0x00,VARIABLE,INTEGER32,Manufacturer Object,,rw,both,0,0,4,,0,ManagedVariable,no,0,0,no
0x2000,,ARRAY,UNSIGNED16,Flowmeter Data OUT,,,,,,,,,,,,,,
0x2000,0x00,,UNSIGNED16,Highest sub-index supported,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x2000,0x01,,UNSIGNED16,FM1 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x2000,0x02,,UNSIGNED16,FM2 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x2000,0x03,,UNSIGNED16,FM3 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x2000,0x04,,UNSIGNED16,FM4 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x3000,,ARRAY,INTEGER16,Managed Array,,,,,,,,,,,,,,
0x3000,0x00,,INTEGER16,NUmber of Entries,,ro,no,1,1,2,,0,ManagedConst,no,0,0,no
0x3000,0x01,,INTEGER16,Sub 1,,ro,tpdo,0,0,,,0,ManagedVariable,no,0,0,no
0x3000,0x02,,INTEGER16,sub 2,,rw,both,0,0,2,,0,ManagedVariable,no,0,0,no
0x2001,,ARRAY,UNSIGNED16,Pressure Sensor Data OUT,,,,,,,,,,,,,,
0x2001,0x00,,UNSIGNED16,Highest sub-index supported,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x2001,0x01,,UNSIGNED16,PS1 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x2001,0x02,,UNSIGNED16,PS2 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x2001,0x03,,UNSIGNED16,PS3 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x2001,0x04,,UNSIGNED16,PS4 OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x2003,0x00,VARIABLE,UNSIGNED16,Pump Data OUT,,rw,tpdo,1,1,,,0,ManagedVariable,no,0,0xffff,no
0x6000,,ARRAY,UNSIGNED8,Motor Valve Control,,,,,,,,,,,,,,
0x6000,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,5,,0,ManagedConst,no,0,255,no
0x6000,0x01,,UNSIGNED8,ID,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x02,,UNSIGNED8,Command,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x03,,UNSIGNED8,Position setpoint,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x04,,UNSIGNED8,Pressure setpoint,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x05,,UNSIGNED8,Flowrate setpoint,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6001,,ARRAY,UNSIGNED32,Conductivity Sensor Data IN,,,,,,,,,,,,,,
0x6001,0x00,,UNSIGNED32,Highest sub-index supported,,ro,no,1,1,6,,0,ManagedConst,no,0,255,no
0x6001,0x01,,UNSIGNED32,Conductivity Data IN1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x02,,UNSIGNED32,Temperature Data IN1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x03,,UNSIGNED32,Conductivity Data IN2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x04,,UNSIGNED32,Temperature Data IN2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x05,,UNSIGNED32,Conductivity Data IN3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x06,,UNSIGNED32,Temperature Data IN3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,,ARRAY,UNSIGNED32,Conductivity Sensor Data OUT,,,,,,,,,,,,,,
0x6002,0x00,,UNSIGNED32,Highest sub-index supported,,ro,no,1,1,6,,0,ManagedConst,no,0,255,no
0x6002,0x01,,UNSIGNED32,Conductivity Data OUT1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x02,,UNSIGNED32,Temperature Data OUT1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x03,,UNSIGNED32,Conductivity Data OUT2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x04,,UNSIGNED32,Temperature Data OUT2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x05,,UNSIGNED32,Conductivity Data OUT3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x06,,UNSIGNED32,Temperature Data OUT3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,,ARRAY,UNSIGNED32,Motor Valve Data OUT,,,,,,,,,,,,,,
0x6003,0x00,,UNSIGNED32,Highest sub-index supported,,ro,no,1,1,8,,0,ManagedConst,no,0,255,no
0x6003,0x01,,UNSIGNED32,MV 01 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x02,,UNSIGNED32,MV 02 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x03,,UNSIGNED32,MV 03 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x04,,UNSIGNED32,MV 04 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x05,,UNSIGNED32,MV 05 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x06,,UNSIGNED32,MV 06 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x07,,UNSIGNED32,MV 07 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x08,,UNSIGNED32,MV 08 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6004,,ARRAY,REAL32,Flowmeter Data OUT,,,,,,,,,,,,,,
0x6004,0x00,,REAL32,Highest sub-index supported,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x6004,0x01,,REAL32,FM1 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6004,0x02,,REAL32,FM2 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6004,0x03,,REAL32,FM3 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6004,0x04,,REAL32,FM4 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,,ARRAY,REAL32,Pressure Sensor Data OUT,,,,,,,,,,,,,,
0x6005,0x00,,REAL32,Highest sub-index supported,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x6005,0x01,,REAL32,PS1 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,0x02,,REAL32,PS2 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,0x03,,REAL32,PS3 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,0x04,,REAL32,PS4 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x2004,,ARRAY,UNSIGNED8,Motor Valve Data OUT,,,,,,,,,,,,,,
0x2004,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,20,,0,ManagedConst,no,0,255,no
0x2004,0x01,,UNSIGNED8,MV 01 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x02,,UNSIGNED8,MV 02 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x03,,UNSIGNED8,MV 03 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x04,,UNSIGNED8,MV 04 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x05,,UNSIGNED8,MV 05 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x06,,UNSIGNED8,MV 06 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x07,,UNSIGNED8,MV 07 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x08,,UNSIGNED8,MV 08 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x09,,UNSIGNED8,MV 09 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x0a,,UNSIGNED8,MV 10 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x0b,,UNSIGNED8,MV 11 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x0c,,UNSIGNED8,MV 12 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x0d,,UNSIGNED8,MV 13 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x0e,,UNSIGNED8,MV 14 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x0f,,UNSIGNED8,MV 15 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x10,,UNSIGNED8,MV 16 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x11,,UNSIGNED8,MV 17 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x12,,UNSIGNED8,MV 18 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x13,,UNSIGNED8,MV 19 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no
0x2004,0x14,,UNSIGNED8,MV 20 Setpoint,,rw,both,1,1,,,0,ManagedVariable,no,0,0xff,no

View File

@ -64,12 +64,107 @@ DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 1
DefaultValue: 20
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x0000
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x03 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x04 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x05 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x06 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x07 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x08 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x09 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x0a - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x0b - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x0c - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x0d - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x0e - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x0f - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x10 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x11 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x12 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x13 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
Sub: 0x14 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x01f4
AccessType: rw
PDOMapping: 0
@ -78,7 +173,7 @@ DataType: UNSIGNED16
ObjectCode: Variable
Sub: 0x00 - Producer Heartbeat Time
DataType: UNSIGNED16
DefaultValue: 1500
DefaultValue: 100
AccessType: rw
PDOMapping: 0
@ -92,7 +187,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x01 - Vendor Id
DataType: UNSIGNED32
DefaultValue: 0x319
DefaultValue: 0x59A
AccessType: ro
PDOMapping: 0
Sub: 0x02 - Product Code
@ -640,136 +735,7 @@ Description: This objects contains the parameters for the SDO for which the CANo
AccessType: rw
PDOMapping: 0
Index: 0x1400 - Receive PDO Communication Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the communication parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x200
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Description: Sub-index 0x2 defines the reception character of the RPDO.
Index: 0x1401 - Receive PDO Communication Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the communication parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x200
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Description: Sub-index 0x2 defines the reception character of the RPDO.
Index: 0x1402 - Receive PDO Communication Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the communication parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x200
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Description: Sub-index 0x2 defines the reception character of the RPDO.
Index: 0x1600 - Receive PDO Mapping Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the mapping parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010120
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010220
AccessType: const
PDOMapping: 0
Index: 0x1601 - Receive PDO Mapping Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the mapping parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010320
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010420
AccessType: const
PDOMapping: 0
Index: 0x1602 - Receive PDO Mapping Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the mapping parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010520
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010620
AccessType: const
PDOMapping: 0
Index: 0x1800 - TPDO communication parameter
Index: 0x1800 - Flowmeter communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
@ -779,7 +745,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x180
DefaultValue: $NODEID+0x280
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
@ -798,11 +764,11 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x05 - Event Timer
DataType: UNSIGNED16
DefaultValue: 500
DefaultValue: 100
AccessType: rw
PDOMapping: 0
Index: 0x1801 - TPDO communication parameter
Index: 0x1801 - Pressure communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
@ -812,7 +778,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x280
DefaultValue: $NODEID+0x280+1
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission type
@ -830,7 +796,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 500
DefaultValue: 100
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
@ -838,7 +804,7 @@ ObjectCode: Record
AccessType: rw
PDOMapping: 0
Index: 0x1802 - TPDO communication parameter
Index: 0x1802 - Pump communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
@ -848,7 +814,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x380
DefaultValue: $NODEID+0x280+2
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission type
@ -866,7 +832,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 500
DefaultValue: 100
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
@ -874,7 +840,7 @@ ObjectCode: Record
AccessType: rw
PDOMapping: 0
Index: 0x1803 - TPDO communication parameter
Index: 0x1803 - Motor setpoint 1 communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
@ -884,7 +850,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x480
DefaultValue: $NODEID+0x280+3
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission type
@ -902,7 +868,7 @@ ObjectCode: Record
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 500
DefaultValue: 100
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
@ -910,7 +876,7 @@ ObjectCode: Record
AccessType: rw
PDOMapping: 0
Index: 0x1804 - TPDO communication parameter
Index: 0x1804 - Motor setpoint 2 communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
@ -920,7 +886,43 @@ ObjectCode: Record
PDOMapping: 1
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x180+1
DefaultValue: $NODEID+0x280+4
AccessType: rw
PDOMapping: 4
Sub: 0x02 - Transmission type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Sub: 0x03 - Inhibit time
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 0
Sub: 0x04 - Inhibit time
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 100
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Index: 0x1805 - Motor setpoint 2 communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: const
PDOMapping: 1
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x280+5
AccessType: rw
PDOMapping: 4
Sub: 0x02 - Transmission type
@ -946,266 +948,207 @@ ObjectCode: Record
AccessType: rw
PDOMapping: 0
Index: 0x1a00 - Conductivity Data OUT1
Index: 0x1a00 - Flowmeter Data mapping parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60020120
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60020220
AccessType: const
PDOMapping: 4
Index: 0x1a01 - Conductivity Data OUT2
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60020320
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60020420
AccessType: const
PDOMapping: 4
Index: 0x1a02 - Conductivity Data OUT3
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60020520
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60020620
AccessType: const
PDOMapping: 4
Index: 0x1a03 - Pressue and Flowmeter Data OUT1
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60040120
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60050120
AccessType: const
PDOMapping: 4
Index: 0x1a04 - Pressue and Flowmeter Data OUT2
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010320
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010420
AccessType: const
PDOMapping: 4
Index: 0x2001 - Manufacturer Object
DataType: INTEGER32
ObjectCode: Variable
Sub: 0x00 - Manufacturer Object
DataType: INTEGER32
DefaultValue: 4
AccessType: rw
PDOMapping: 1
Index: 0x3000 - Managed Array
DataType: INTEGER16
ObjectCode: Array
Sub: 0x00 - NUmber of Entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
AccessType: const
PDOMapping: 0
Sub: 0x01 - Sub 1
DataType: INTEGER16
AccessType: ro
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x20000110
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x20000210
AccessType: const
PDOMapping: 4
Sub: 0x03 - Mapping Entry 3
DataType: UNSIGNED32
DefaultValue: 0x20000310
AccessType: const
PDOMapping: 4
Sub: 0x04 - Mapping Entry 4
DataType: UNSIGNED32
DefaultValue: 0x20000410
AccessType: const
PDOMapping: 4
Sub: 0x02 - sub 2
DataType: INTEGER16
DefaultValue: 2
AccessType: rw
PDOMapping: 1
Index: 0x6000 - Motor Valve Control
Index: 0x1a01 - Pressure Sensor mapping parameter
DataType: UNSIGNED8
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 5
AccessType: ro
DefaultValue: 4
AccessType: const
PDOMapping: 0
Sub: 0x01 - ID
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x02 - Command
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x03 - Position setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x04 - Pressure setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x05 - Flowrate setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x20010110
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x20010210
AccessType: const
PDOMapping: 4
Sub: 0x03 - Mapping Entry 3
DataType: UNSIGNED32
DefaultValue: 0x20010310
AccessType: const
PDOMapping: 4
Sub: 0x04 - Mapping Entry 4
DataType: UNSIGNED32
DefaultValue: 0x20010410
AccessType: const
PDOMapping: 4
Index: 0x6001 - Conductivity Sensor Data IN
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
Index: 0x1a02 - Pump mapping parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 6
AccessType: ro
DefaultValue: 1
AccessType: const
PDOMapping: 0
Sub: 0x01 - Conductivity Data IN1
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - Temperature Data IN1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - Conductivity Data IN2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - Temperature Data IN2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x05 - Conductivity Data IN3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x06 - Temperature Data IN3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
DefaultValue: 0x20030010
AccessType: const
PDOMapping: 4
Index: 0x6002 - Conductivity Sensor Data OUT
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Conductivity Data OUT1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - Temperature Data OUT1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - Conductivity Data OUT2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - Temperature Data OUT2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x05 - Conductivity Data OUT3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x06 - Temperature Data OUT3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Index: 0x6003 - Motor Valve Data OUT
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
Index: 0x1a03 - Motor setpoint 1 mapping parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 8
AccessType: ro
AccessType: const
PDOMapping: 0
Sub: 0x01 - MV 01 OUT
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - MV 02 OUT
DefaultValue: 0x20040108
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - MV 03 OUT
DefaultValue: 0x20040208
AccessType: const
PDOMapping: 4
Sub: 0x03 - Mapping Entry 3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - MV 04 OUT
DefaultValue: 0x20040308
AccessType: const
PDOMapping: 4
Sub: 0x04 - Mapping Entry 4
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x05 - MV 05 OUT
DefaultValue: 0x20040408
AccessType: const
PDOMapping: 4
Sub: 0x05 - Mapping Entry 5
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x06 - MV 06 OUT
DefaultValue: 0x20040508
AccessType: const
PDOMapping: 4
Sub: 0x06 - Mapping Entry 6
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x07 - MV 07 OUT
DefaultValue: 0x20040608
AccessType: const
PDOMapping: 4
Sub: 0x07 - Mapping Entry 7
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x08 - MV 08 OUT
DefaultValue: 0x20040708
AccessType: const
PDOMapping: 4
Sub: 0x08 - Mapping Entry 8
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
DefaultValue: 0x20040808
AccessType: const
PDOMapping: 4
Index: 0x6004 - Flowmeter Data OUT
DataType: REAL32
Index: 0x1a04 - Motor setpoint 2 mapping parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 8
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x20040908
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x20040a08
AccessType: const
PDOMapping: 0
Sub: 0x03 - Mapping Entry 3
DataType: UNSIGNED32
DefaultValue: 0x20040b08
AccessType: const
PDOMapping: 0
Sub: 0x04 - Mapping Entry 4
DataType: UNSIGNED32
DefaultValue: 0x20040c08
AccessType: const
PDOMapping: 0
Sub: 0x05 - Mapping Entry 5
DataType: UNSIGNED32
DefaultValue: 0x20040d08
AccessType: const
PDOMapping: 0
Sub: 0x06 - Mapping Entry 6
DataType: UNSIGNED32
DefaultValue: 0x20040e08
AccessType: const
PDOMapping: 0
Sub: 0x07 - Mapping Entry 7
DataType: UNSIGNED32
DefaultValue: 0x20040f08
AccessType: const
PDOMapping: 0
Sub: 0x08 - Mapping Entry 8
DataType: UNSIGNED32
DefaultValue: 0x20041008
AccessType: const
PDOMapping: 0
Index: 0x1a05 - Motor setpoint 3 mapping parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 4
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x20041108
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x20041208
AccessType: const
PDOMapping: 0
Sub: 0x03 - Mapping Entry 3
DataType: UNSIGNED32
DefaultValue: 0x20041308
AccessType: const
PDOMapping: 0
Sub: 0x04 - Mapping Entry 4
DataType: UNSIGNED32
DefaultValue: 0x20041408
AccessType: const
PDOMapping: 0
Index: 0x2000 - Flowmeter Data OUT
DataType: UNSIGNED16
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
@ -1213,24 +1156,24 @@ ObjectCode: Array
AccessType: ro
PDOMapping: 0
Sub: 0x01 - FM1 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 1
PDOMapping: 4
Sub: 0x02 - FM2 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 1
PDOMapping: 4
Sub: 0x03 - FM3 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 1
PDOMapping: 4
Sub: 0x04 - FM4 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 1
PDOMapping: 4
Index: 0x6005 - Pressure Sensor Data OUT
DataType: REAL32
Index: 0x2001 - Pressure Sensor Data OUT
DataType: UNSIGNED16
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
@ -1238,18 +1181,115 @@ ObjectCode: Array
AccessType: ro
PDOMapping: 0
Sub: 0x01 - PS1 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 1
PDOMapping: 4
Sub: 0x02 - PS2 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 1
PDOMapping: 4
Sub: 0x03 - PS3 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 1
PDOMapping: 4
Sub: 0x04 - PS4 OUT
DataType: REAL32
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 4
Index: 0x2003 - Pump Data OUT
DataType: UNSIGNED16
ObjectCode: Variable
Sub: 0x00 - Pump Data OUT
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 4
Index: 0x2004 - Motor Valve Data OUT
DataType: UNSIGNED8
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 20
AccessType: ro
PDOMapping: 0
Sub: 0x01 - MV 01 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x02 - MV 02 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x03 - MV 03 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x04 - MV 04 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x05 - MV 05 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x06 - MV 06 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x07 - MV 07 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x08 - MV 08 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x09 - MV 09 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x0a - MV 10 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x0b - MV 11 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x0c - MV 12 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x0d - MV 13 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x0e - MV 14 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x0f - MV 15 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x10 - MV 16 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x11 - MV 17 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x12 - MV 18 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x13 - MV 19 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1
Sub: 0x14 - MV 20 Setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 1

View File

@ -1,6 +1,6 @@
/*
* Stack definitions for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2
* */
* 14 08 2025 12:06:07 */
/* protect against multiple inclusion of the file */
#ifndef GEN_DEFINE_H
@ -19,17 +19,17 @@
#define CO_REC_BUFFER_COUNTS 10u
#define CO_TR_BUFFER_COUNTS 20u
/* Number of objects per line */
#define CO_OBJECTS_LINE_0_CNT 38u
#define CO_OBJECT_COUNTS 38u
#define CO_COB_COUNTS 21u
#define CO_TXPDO_COUNTS 5u
#define CO_RXPDO_COUNTS 3u
#define CO_OBJECTS_LINE_0_CNT 48u
#define CO_OBJECT_COUNTS 48u
#define CO_COB_COUNTS 73u
#define CO_TXPDO_COUNTS 6u
#define CO_RXPDO_COUNTS 0u
#define CO_SSDO_COUNTS 1u
#define CO_CSDO_COUNTS 2u
#define CO_CSDO_COUNTS 20u
#define CO_ASSIGN_COUNTS 0u
#define CO_MAX_ASSIGN_COUNTS 0u
#define CO_GUARDING_COUNTS CO_MAX_ASSIGN_COUNTS
#define CO_ERR_CTRL_COUNTS 2u
#define CO_ERR_CTRL_COUNTS 20u
#define CO_ERR_HIST_COUNTS 1u
#define CO_ACT_ERR_HIST_COUNTS 0u
#define CO_EMCY_CONS_COUNTS 0u
@ -39,12 +39,12 @@
/* Definition of numbers of CANopen services */
#define CO_NMT_MASTER 1u
#define CO_LSS_MASTER_SUPPORTED 1u
#define CO_LSS_INQUIRY_SERVICES 1u
#define CO_SDO_SERVER_CNT 1u
#define CO_SDO_CLIENT_CNT 2u
#define CO_PDO_TRANSMIT_CNT 5u
#define CO_PDO_RECEIVE_CNT 3u
#define CO_MAX_MAP_ENTRIES 2u
#define CO_HB_CONSUMER_CNT 2u
#define CO_SDO_CLIENT_CNT 20u
#define CO_PDO_TRANSMIT_CNT 6u
#define CO_MAX_MAP_ENTRIES 8u
#define CO_HB_CONSUMER_CNT 20u
#define CO_EMCY_PRODUCER 1u
#define CO_EMCY_ERROR_HISTORY 1u
#define CO_SDO_BLOCK 1u
@ -54,10 +54,13 @@
#define CO_SDO_QUEUE_LEN 0u
#define CO_INHIBIT_SUPPORTED 1u
/* number of used COB objects */
#define CO_COB_CNT 21u
#define CO_COB_CNT 73u
/* Definition of number of call-back functions for each service*/
#define CO_EVENT_DYNAMIC_SDO_SERVER_READ 1u
#define CO_EVENT_DYNAMIC_SDO_SERVER_WRITE 1u
#define CO_EVENT_DYNAMIC_SDO_SERVER_CHECK_WRITE 1u
#define CO_EVENT_DYNAMIC_PDO 1u
#define CO_EVENT_DYNAMIC_PDO_UPDATE 1u
#define CO_EVENT_DYNAMIC_NMT 1u
@ -92,8 +95,8 @@
/* application-specific defines as defined in DeviceDesigner */
#define CODRV_BIT_TABLE_EXTERN 1
#define CODRV_CANCLOCK_40MHZ 1
#define CO_LSS_INQUIRY_SERVICES 1
#define C4L_DEVICE
#define CODRV_MCAN_STM32_G4
#define CONFIG_MCAN1
#define CUBE_MX_GENERATION

View File

@ -1,6 +1,6 @@
/*
* static indication definitions for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2
* Fri Feb 14 15:45:52 2025
* Thu Aug 14 12:06:07 2025
*/
/* protect against multiple inclusion of the file */

View File

@ -1,6 +1,6 @@
/*
* CO index/J1939 PGN/raw CAN-ID defines for enduranceTestBench - generated by CANopen DeviceDesigner 3.14.2
* Fri Feb 14 15:45:51 2025
* Thu Aug 14 12:06:07 2025
*/
/* protect against multiple inclusion of the file */
@ -34,74 +34,83 @@
#define S_COB_ID_SERVER_CLIENT 0x2u
#define S_NODE_ID_OF_THE_SDO_SERVER 0x3u
#define I_SDO_CLIENT_PARAMETER1 0x1281u
#define I_RECEIVE_PDO_COMMUNICATION_PARAMETER 0x1400u
#define I_SDO_CLIENT_PARAMETER2 0x1282u
#define I_SDO_CLIENT_PARAMETER3 0x1283u
#define I_SDO_CLIENT_PARAMETER4 0x1284u
#define I_SDO_CLIENT_PARAMETER5 0x1285u
#define I_SDO_CLIENT_PARAMETER6 0x1286u
#define I_SDO_CLIENT_PARAMETER7 0x1287u
#define I_SDO_CLIENT_PARAMETER8 0x1288u
#define I_SDO_CLIENT_PARAMETER9 0x1289u
#define I_SDO_CLIENT_PARAMETER10 0x128au
#define I_SDO_CLIENT_PARAMETER11 0x128bu
#define I_SDO_CLIENT_PARAMETER12 0x128cu
#define I_SDO_CLIENT_PARAMETER13 0x128du
#define I_SDO_CLIENT_PARAMETER14 0x128eu
#define I_SDO_CLIENT_PARAMETER15 0x128fu
#define I_SDO_CLIENT_PARAMETER16 0x1290u
#define I_SDO_CLIENT_PARAMETER17 0x1291u
#define I_SDO_CLIENT_PARAMETER18 0x1292u
#define I_SDO_CLIENT_PARAMETER19 0x1293u
#define I_FLOWMETER_COMMUNICATION_PARAMETER 0x1800u
#define S_COB_ID 0x1u
#define S_TRANSMISSION_TYPE 0x2u
#define I_RECEIVE_PDO_COMMUNICATION_PARAMETER1 0x1401u
#define I_RECEIVE_PDO_COMMUNICATION_PARAMETER2 0x1402u
#define I_RECEIVE_PDO_MAPPING_PARAMETER 0x1600u
#define S_MAPPING_ENTRY_1 0x1u
#define S_MAPPING_ENTRY_2 0x2u
#define I_RECEIVE_PDO_MAPPING_PARAMETER1 0x1601u
#define I_RECEIVE_PDO_MAPPING_PARAMETER2 0x1602u
#define I_TPDO_COMMUNICATION_PARAMETER 0x1800u
#define S_INHIBIT_TIME 0x3u
#define S_COMPATIBILITY_ENTRY 0x4u
#define S_EVENT_TIMER 0x5u
#define I_TPDO_COMMUNICATION_PARAMETER1 0x1801u
#define I_PRESSURE_COMMUNICATION_PARAMETER 0x1801u
#define S_COB_ID_USED_BY_TPDO 0x1u
#define S_SYNC_START_VALUE 0x6u
#define I_TPDO_COMMUNICATION_PARAMETER2 0x1802u
#define I_TPDO_COMMUNICATION_PARAMETER3 0x1803u
#define I_TPDO_COMMUNICATION_PARAMETER4 0x1804u
#define I_CONDUCTIVITY_DATA_OUT1 0x1a00u
#define I_CONDUCTIVITY_DATA_OUT2 0x1a01u
#define I_CONDUCTIVITY_DATA_OUT3 0x1a02u
#define I_PRESSUE_AND_FLOWMETER_DATA_OUT1 0x1a03u
#define I_PRESSUE_AND_FLOWMETER_DATA_OUT2 0x1a04u
#define I_MANUFACTURER_OBJECT 0x2001u
#define I_MANAGED_ARRAY 0x3000u
#define S_SUB_1 0x1u
#define S_SUB_2 0x2u
#define I_MOTOR_VALVE_CONTROL 0x6000u
#define S_ID 0x1u
#define S_COMMAND 0x2u
#define S_POSITION_SETPOINT 0x3u
#define S_PRESSURE_SETPOINT 0x4u
#define S_FLOWRATE_SETPOINT 0x5u
#define I_CONDUCTIVITY_SENSOR_DATA_IN 0x6001u
#define S_CONDUCTIVITY_DATA_IN1 0x1u
#define S_TEMPERATURE_DATA_IN1 0x2u
#define S_CONDUCTIVITY_DATA_IN2 0x3u
#define S_TEMPERATURE_DATA_IN2 0x4u
#define S_CONDUCTIVITY_DATA_IN3 0x5u
#define S_TEMPERATURE_DATA_IN3 0x6u
#define I_CONDUCTIVITY_SENSOR_DATA_OUT 0x6002u
#define S_CONDUCTIVITY_DATA_OUT1 0x1u
#define S_TEMPERATURE_DATA_OUT1 0x2u
#define S_CONDUCTIVITY_DATA_OUT2 0x3u
#define S_TEMPERATURE_DATA_OUT2 0x4u
#define S_CONDUCTIVITY_DATA_OUT3 0x5u
#define S_TEMPERATURE_DATA_OUT3 0x6u
#define I_MOTOR_VALVE_DATA_OUT 0x6003u
#define S_MV_01_OUT 0x1u
#define S_MV_02_OUT 0x2u
#define S_MV_03_OUT 0x3u
#define S_MV_04_OUT 0x4u
#define S_MV_05_OUT 0x5u
#define S_MV_06_OUT 0x6u
#define S_MV_07_OUT 0x7u
#define S_MV_08_OUT 0x8u
#define I_FLOWMETER_DATA_OUT 0x6004u
#define I_PUMP_COMMUNICATION_PARAMETER 0x1802u
#define I_MOTOR_SETPOINT_1_COMMUNICATION_PARAMETER 0x1803u
#define I_MOTOR_SETPOINT_2_COMMUNICATION_PARAMETER 0x1804u
#define I_MOTOR_SETPOINT_2_COMMUNICATION_PARAMETER1 0x1805u
#define I_FLOWMETER_DATA_MAPPING_PARAMETER 0x1a00u
#define S_MAPPING_ENTRY_1 0x1u
#define S_MAPPING_ENTRY_2 0x2u
#define S_MAPPING_ENTRY_3 0x3u
#define S_MAPPING_ENTRY_4 0x4u
#define I_PRESSURE_SENSOR_MAPPING_PARAMETER 0x1a01u
#define I_PUMP_MAPPING_PARAMETER 0x1a02u
#define I_MOTOR_SETPOINT_1_MAPPING_PARAMETER 0x1a03u
#define S_MAPPING_ENTRY_5 0x5u
#define S_MAPPING_ENTRY_6 0x6u
#define S_MAPPING_ENTRY_7 0x7u
#define S_MAPPING_ENTRY_8 0x8u
#define I_MOTOR_SETPOINT_2_MAPPING_PARAMETER 0x1a04u
#define I_MOTOR_SETPOINT_3_MAPPING_PARAMETER 0x1a05u
#define I_FLOWMETER_DATA_OUT 0x2000u
#define S_FM1_OUT 0x1u
#define S_FM2_OUT 0x2u
#define S_FM3_OUT 0x3u
#define S_FM4_OUT 0x4u
#define I_PRESSURE_SENSOR_DATA_OUT 0x6005u
#define I_PRESSURE_SENSOR_DATA_OUT 0x2001u
#define S_PS1_OUT 0x1u
#define S_PS2_OUT 0x2u
#define S_PS3_OUT 0x3u
#define S_PS4_OUT 0x4u
#define I_PUMP_DATA_OUT 0x2003u
#define I_MOTOR_VALVE_DATA_OUT 0x2004u
#define S_MV_01_SETPOINT 0x1u
#define S_MV_02_SETPOINT 0x2u
#define S_MV_03_SETPOINT 0x3u
#define S_MV_04_SETPOINT 0x4u
#define S_MV_05_SETPOINT 0x5u
#define S_MV_06_SETPOINT 0x6u
#define S_MV_07_SETPOINT 0x7u
#define S_MV_08_SETPOINT 0x8u
#define S_MV_09_SETPOINT 0x9u
#define S_MV_10_SETPOINT 0xau
#define S_MV_11_SETPOINT 0xbu
#define S_MV_12_SETPOINT 0xcu
#define S_MV_13_SETPOINT 0xdu
#define S_MV_14_SETPOINT 0xeu
#define S_MV_15_SETPOINT 0xfu
#define S_MV_16_SETPOINT 0x10u
#define S_MV_17_SETPOINT 0x11u
#define S_MV_18_SETPOINT 0x12u
#define S_MV_19_SETPOINT 0x13u
#define S_MV_20_SETPOINT 0x14u
#define S_NUMBER_OF_ENTRIES 0x0u
#endif /* GEN_INDICES_H */

File diff suppressed because it is too large Load Diff

View File

@ -1,139 +0,0 @@
Index,Sub,EDSname,Datatype,Access,Value,varname,LowLimit,UpLimit,hasDefault,hasLimit,refuseRead,refuseWrite,defaultInEDS,implementation,Size,ObjectCode,mapable
0x1000,0x00,Device Type,UNSIGNED32,ro,0,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1001,0x00,Error Register,UNSIGNED8,ro,,NONE,0,255,no,no,no,no,0,ManagedVariable,0,,no
0x1003,0x00,Predefined Error Field Number of Errors,UNSIGNED8,rw,0,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,ARRAY,no
0x1003,0x01,Predefined Error Field Standard Error Field,UNSIGNED32,ro,0,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1008,0x00,Manufacturer device name,VISIBLE_STRING,const,emotas Slave 1,NONE,0,0,yes,no,no,no,1,ManagedConst,14,,no
0x1014,0x00,COB ID EMCY,UNSIGNED32,ro,$NODEID+0x80,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1015,0x00,Inhibit Time Emergency,UNSIGNED16,rw,0,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1016,0x00,Consumer Heartbeat Time Number of entries,UNSIGNED8,ro,1,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x1016,0x01,Consumer Heartbeat Time Consumer Heartbeat Time,UNSIGNED32,rw,0,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1017,0x00,Producer Heartbeat Time,UNSIGNED16,rw,1500,NONE,0,65535,no,no,no,no,0,ManagedVariable,0,,no
0x1018,0x00,Identity Object Number of entries,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1018,0x01,Identity Object Vendor Id,UNSIGNED32,ro,793,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1018,0x02,Identity Object Product Code,UNSIGNED32,ro,1234,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1018,0x03,Identity Object Revision number,UNSIGNED32,ro,1,NONE,0,4294967295,yes,no,no,no,1,ManagedConst,0,,no
0x1018,0x04,Identity Object Serial number,UNSIGNED32,ro,,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1029,0x00,Error behaviour Nr of Error Classes,UNSIGNED8,ro,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x1029,0x01,Error behaviour Communication Error,UNSIGNED8,rw,1,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1029,0x02,Error behaviour Specific Error Class ,UNSIGNED8,rw,,NONE,0,255,no,no,no,no,1,ManagedVariable,0,,no
0x102a,0x00,NMT inhibit time,UNSIGNED16,rw,10,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1200,0x00,Server SDO Parameter Number of entries,UNSIGNED8,ro,2,NONE,2,2,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1200,0x01,Server SDO Parameter COB ID Client to Server,UNSIGNED32,ro,$NODEID+0x600,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1200,0x02,Server SDO Parameter COB ID Server to Client,UNSIGNED32,ro,$NODEID+0x580,NONE,0,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1283,0x00,SDO client parameter Highest sub-index supported,UNSIGNED8,const,3,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1283,0x01,SDO client parameter COB-ID client -> server,UNSIGNED32,rw,2147483648,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1283,0x02,SDO client parameter COB-ID server -> client,UNSIGNED32,rw,2147483648,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1283,0x03,SDO client parameter Node-ID of the SDO server,UNSIGNED8,rw,,NONE,1,127,no,no,no,no,0,ManagedVariable,0,,no
0x1400,0x00,Receive PDO Communication Parameter Highest sub-index supported,UNSIGNED8,ro,2,NONE,2,5,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1400,0x01,Receive PDO Communication Parameter COB ID,UNSIGNED32,rw,$NODEID+0x200,NONE,385,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1400,0x02,Receive PDO Communication Parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1401,0x00,Receive PDO Communication Parameter Highest sub-index supported,UNSIGNED8,ro,2,NONE,2,5,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1401,0x01,Receive PDO Communication Parameter COB ID,UNSIGNED32,rw,$NODEID+0x200,NONE,385,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1401,0x02,Receive PDO Communication Parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1402,0x00,Receive PDO Communication Parameter Highest sub-index supported,UNSIGNED8,ro,2,NONE,2,5,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1402,0x01,Receive PDO Communication Parameter COB ID,UNSIGNED32,rw,$NODEID+0x200,NONE,385,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1402,0x02,Receive PDO Communication Parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1600,0x00,Receive PDO Mapping Parameter Highest sub-index supported,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1600,0x01,Receive PDO Mapping Parameter Mapping Entry 1,UNSIGNED32,const,1610678560,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1600,0x02,Receive PDO Mapping Parameter Mapping Entry 2,UNSIGNED32,const,1610678816,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1601,0x00,Receive PDO Mapping Parameter Highest sub-index supported,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1601,0x01,Receive PDO Mapping Parameter Mapping Entry 1,UNSIGNED32,const,1610679072,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1601,0x02,Receive PDO Mapping Parameter Mapping Entry 2,UNSIGNED32,const,1610679328,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1602,0x00,Receive PDO Mapping Parameter Highest sub-index supported,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1602,0x01,Receive PDO Mapping Parameter Mapping Entry 1,UNSIGNED32,const,1610679584,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1602,0x02,Receive PDO Mapping Parameter Mapping Entry 2,UNSIGNED32,const,1610679840,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,no
0x1800,0x00,TPDO communication parameter Number of entries,UNSIGNED8,ro,5,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1800,0x01,TPDO communication parameter COB ID,UNSIGNED32,rw,$NODEID+0x180,NONE,1,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x02,TPDO communication parameter Transmission Type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x03,TPDO communication parameter Inhibit Time,UNSIGNED16,rw,0,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1800,0x04,TPDO communication parameter Compatibility Entry,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1800,0x05,TPDO communication parameter Event Timer,UNSIGNED16,rw,500,NONE,0,65535,yes,no,no,no,1,ManagedVariable,0,,no
0x1801,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1801,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x280,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1801,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1801,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1802,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x380,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1802,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1802,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1803,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x480,NONE,128,4294967295,yes,no,no,no,1,ManagedVariable,0,,no
0x1803,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,both
0x1803,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1803,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x00,TPDO communication parameter Highest sub-index supported,UNSIGNED8,const,6,NONE,2,6,yes,no,no,no,1,ManagedConst,0,RECORD,both
0x1804,0x01,TPDO communication parameter COB-ID used by TPDO,UNSIGNED32,rw,$NODEID+0x180+1,NONE,128,4294967295,yes,no,no,no,2,ManagedVariable,0,,tpdo
0x1804,0x02,TPDO communication parameter Transmission type,UNSIGNED8,rw,254,NONE,0,255,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x03,TPDO communication parameter Inhibit time,UNSIGNED16,rw,,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x04,TPDO communication parameter Inhibit time,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x05,TPDO communication parameter Event timer,UNSIGNED16,rw,500,NONE,0,0xffff,yes,no,no,no,0,ManagedVariable,0,,no
0x1804,0x06,TPDO communication parameter SYNC start value,UNSIGNED8,rw,,NONE,0,0xff,yes,no,no,no,0,ManagedVariable,0,,no
0x1a00,0x00,Conductivity Data OUT1 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a00,0x01,Conductivity Data OUT1 Mapping Entry 1,UNSIGNED32,const,1610744096,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a00,0x02,Conductivity Data OUT1 Mapping Entry 2,UNSIGNED32,const,1610744352,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x00,Conductivity Data OUT2 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a01,0x01,Conductivity Data OUT2 Mapping Entry 1,UNSIGNED32,const,1610744608,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a01,0x02,Conductivity Data OUT2 Mapping Entry 2,UNSIGNED32,const,1610744864,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a02,0x00,Conductivity Data OUT3 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a02,0x01,Conductivity Data OUT3 Mapping Entry 1,UNSIGNED32,const,1610745120,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a02,0x02,Conductivity Data OUT3 Mapping Entry 2,UNSIGNED32,const,1610745376,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x00, Pressue and Flowmeter Data OUT1 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a03,0x01, Pressue and Flowmeter Data OUT1 Mapping Entry 1,UNSIGNED32,const,1610875168,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a03,0x02, Pressue and Flowmeter Data OUT1 Mapping Entry 2,UNSIGNED32,const,1610940704,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a04,0x00, Pressue and Flowmeter Data OUT2 Number of entries,UNSIGNED8,const,2,NONE,0,255,yes,no,no,no,1,ManagedConst,0,RECORD,no
0x1a04,0x01, Pressue and Flowmeter Data OUT2 Mapping Entry 1,UNSIGNED32,const,1610679072,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x1a04,0x02, Pressue and Flowmeter Data OUT2 Mapping Entry 2,UNSIGNED32,const,1610679328,NONE,0,0,yes,no,no,no,1,ManagedConst,0,,tpdo
0x2001,0x00,Manufacturer Object,INTEGER32,rw,4,NONE,0,0,no,no,no,no,0,ManagedVariable,0,,both
0x3000,0x00,Managed Array NUmber of Entries,UNSIGNED8,ro,2,NONE,0,0,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x3000,0x01,Managed Array Sub 1,INTEGER16,ro,,NONE,0,0,no,no,no,no,0,ManagedVariable,0,,tpdo
0x3000,0x02,Managed Array sub 2,INTEGER16,rw,2,NONE,0,0,no,no,no,no,0,ManagedVariable,0,,both
0x6000,0x00,Motor Valve Control Highest sub-index supported,UNSIGNED8,ro,5,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6000,0x01,Motor Valve Control ID,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x02,Motor Valve Control Command,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x03,Motor Valve Control Position setpoint,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x04,Motor Valve Control Pressure setpoint,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6000,0x05,Motor Valve Control Flowrate setpoint,UNSIGNED8,rw,,NONE,0,255,yes,no,no,no,1,ManagedVariable,0,,no
0x6001,0x00,Conductivity Sensor Data IN Highest sub-index supported,UNSIGNED8,ro,6,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6001,0x01,Conductivity Sensor Data IN Conductivity Data IN1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x02,Conductivity Sensor Data IN Temperature Data IN1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x03,Conductivity Sensor Data IN Conductivity Data IN2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x04,Conductivity Sensor Data IN Temperature Data IN2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x05,Conductivity Sensor Data IN Conductivity Data IN3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6001,0x06,Conductivity Sensor Data IN Temperature Data IN3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x00,Conductivity Sensor Data OUT Highest sub-index supported,UNSIGNED8,ro,6,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6002,0x01,Conductivity Sensor Data OUT Conductivity Data OUT1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x02,Conductivity Sensor Data OUT Temperature Data OUT1,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x03,Conductivity Sensor Data OUT Conductivity Data OUT2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x04,Conductivity Sensor Data OUT Temperature Data OUT2,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x05,Conductivity Sensor Data OUT Conductivity Data OUT3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6002,0x06,Conductivity Sensor Data OUT Temperature Data OUT3,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x00,Motor Valve Data OUT Highest sub-index supported,UNSIGNED8,ro,8,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6003,0x01,Motor Valve Data OUT MV 01 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x02,Motor Valve Data OUT MV 02 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x03,Motor Valve Data OUT MV 03 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x04,Motor Valve Data OUT MV 04 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x05,Motor Valve Data OUT MV 05 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x06,Motor Valve Data OUT MV 06 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x07,Motor Valve Data OUT MV 07 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6003,0x08,Motor Valve Data OUT MV 08 OUT,UNSIGNED32,rw,,NONE,0,0xffffffff,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x00,Flowmeter Data OUT Highest sub-index supported,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6004,0x01,Flowmeter Data OUT FM1 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x02,Flowmeter Data OUT FM2 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x03,Flowmeter Data OUT FM3 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6004,0x04,Flowmeter Data OUT FM4 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x00,Pressure Sensor Data OUT Highest sub-index supported,UNSIGNED8,ro,4,NONE,0,255,yes,no,no,no,1,ManagedConst,0,ARRAY,no
0x6005,0x01,Pressure Sensor Data OUT PS1 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x02,Pressure Sensor Data OUT PS2 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x03,Pressure Sensor Data OUT PS3 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
0x6005,0x04,Pressure Sensor Data OUT PS4 OUT,REAL32,rw,,NONE,,,yes,no,no,no,1,ManagedVariable,0,,both
Can't render this file because it has a wrong number of fields in line 95.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,208 +0,0 @@
#
# This is an importable ICSV file for the processBoard project.
#
index,sub,objectcode,datatype,edsname,varname,access,mapable,hasdefault,defaultineds,value,description,size,implementation,haslimit,lowlimit,uplimit,nvstorage
0x1000,0x00,VARIABLE,UNSIGNED32,Device Type,,ro,no,1,1,0,,0,ManagedConst,no,0,4294967295,no
0x1001,0x00,VARIABLE,UNSIGNED8,Error Register,,ro,no,0,0,,,0,ManagedVariable,no,0,255,no
0x1003,,ARRAY,UNSIGNED32,Predefined Error Field,,,,,,,,,,,,,,
0x1003,0x00,,UNSIGNED32,Number of Errors,,rw,no,1,1,0,,0,ManagedVariable,no,0,255,no
0x1003,0x01,,UNSIGNED32,Standard Error Field,,ro,no,1,1,0,,0,ManagedVariable,no,0,4294967295,no
0x1008,0x00,VARIABLE,VISIBLE_STRING,Manufacturer device name,,const,no,1,1,emotas Slave 1,,14,ManagedConst,no,0,0,no
0x1014,0x00,VARIABLE,UNSIGNED32,COB ID EMCY,,ro,no,1,1,$NODEID+0x80,,0,ManagedVariable,no,0,4294967295,no
0x1015,0x00,VARIABLE,UNSIGNED16,Inhibit Time Emergency,,rw,no,1,1,0,,0,ManagedVariable,no,0,65535,no
0x1016,,ARRAY,UNSIGNED32,Consumer Heartbeat Time,,,,,,,,,,,,,,
0x1016,0x00,,UNSIGNED32,Number of entries,,ro,no,1,1,1,,0,ManagedConst,no,0,255,no
0x1016,0x01,,UNSIGNED32,Consumer Heartbeat Time,,rw,no,1,1,0,,0,ManagedVariable,no,0,4294967295,no
0x1017,0x00,VARIABLE,UNSIGNED16,Producer Heartbeat Time,,rw,no,0,0,1500,,0,ManagedVariable,no,0,65535,no
0x1018,,RECORD,UNSIGNED8,Identity Object,,,,,,,,,,,,,,
0x1018,0x00,,UNSIGNED8,Number of entries,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x1018,0x01,,UNSIGNED32,Vendor Id,,ro,no,1,1,793,,0,ManagedConst,no,0,4294967295,no
0x1018,0x02,,UNSIGNED32,Product Code,,ro,no,1,1,1234,,0,ManagedConst,no,0,4294967295,no
0x1018,0x03,,UNSIGNED32,Revision number,,ro,no,1,1,1,,0,ManagedConst,no,0,4294967295,no
0x1018,0x04,,UNSIGNED32,Serial number,,ro,no,1,1,,,0,ManagedVariable,no,0,4294967295,no
0x1029,,ARRAY,UNSIGNED8,Error behaviour,,,,,,,,,,,,,,
0x1029,0x00,,UNSIGNED8,Nr of Error Classes,,ro,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1029,0x01,,UNSIGNED8,Communication Error,,rw,no,1,1,1,,0,ManagedVariable,no,0,255,no
0x1029,0x02,,UNSIGNED8,Specific Error Class ,,rw,no,0,1,,,0,ManagedVariable,no,0,255,no
0x102a,0x00,VARIABLE,UNSIGNED16,NMT inhibit time,,rw,no,1,1,10,This object shall indicate the configured inhibit time between two subsequent NMT messages. The outstanding NMT services shall be queued and shall be issued in order of their occurrence respecting the configured inhibit time. <br/><br/>The value shall be given in multiples of 100 µs. The value 0 shall disable the inhibit time.<br/>,0,ManagedVariable,no,0,65535,no
0x1200,,RECORD,UNSIGNED8,Server SDO Parameter,,,,,,,,,,,,,,
0x1200,0x00,,UNSIGNED8,Number of entries,,ro,no,1,1,2,,0,ManagedConst,no,2,2,no
0x1200,0x01,,UNSIGNED32,COB ID Client to Server,,ro,no,1,1,$NODEID+0x600,,0,ManagedVariable,no,0,4294967295,no
0x1200,0x02,,UNSIGNED32,COB ID Server to Client,,ro,no,1,1,$NODEID+0x580,,0,ManagedVariable,no,0,4294967295,no
0x1283,,RECORD,UNSIGNED8,SDO client parameter,,,,,,,This objects contains the parameters for the SDO for which the CANopen device is the SDO client.,,,,,,,
0x1283,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,3,,0,ManagedConst,no,0,255,no
0x1283,0x01,,UNSIGNED32,COB-ID client -> server,,rw,no,1,1,2147483648,,0,ManagedVariable,no,128,4294967295,no
0x1283,0x02,,UNSIGNED32,COB-ID server -> client,,rw,no,1,1,2147483648,,0,ManagedVariable,no,128,4294967295,no
0x1283,0x03,,UNSIGNED8,Node-ID of the SDO server,,rw,no,0,0,,,0,ManagedVariable,no,1,127,no
0x1400,,RECORD,UNSIGNED8,Receive PDO Communication Parameter,,,,,,,This object contains the communication parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1400,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,2,,0,ManagedConst,no,2,5,no
0x1400,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x200,,0,ManagedVariable,no,385,4294967295,no
0x1400,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,Sub-index 0x2 defines the reception character of the RPDO.,0,ManagedVariable,no,0,255,no
0x1401,,RECORD,UNSIGNED8,Receive PDO Communication Parameter,,,,,,,This object contains the communication parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1401,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,2,,0,ManagedConst,no,2,5,no
0x1401,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x200,,0,ManagedVariable,no,385,4294967295,no
0x1401,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,Sub-index 0x2 defines the reception character of the RPDO.,0,ManagedVariable,no,0,255,no
0x1402,,RECORD,UNSIGNED8,Receive PDO Communication Parameter,,,,,,,This object contains the communication parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1402,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,2,,0,ManagedConst,no,2,5,no
0x1402,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x200,,0,ManagedVariable,no,385,4294967295,no
0x1402,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,Sub-index 0x2 defines the reception character of the RPDO.,0,ManagedVariable,no,0,255,no
0x1600,,RECORD,UNSIGNED8,Receive PDO Mapping Parameter,,,,,,,This object contains the mapping parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1600,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1600,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,1610678560,,0,ManagedConst,no,0,0,no
0x1600,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,1610678816,,0,ManagedConst,no,0,0,no
0x1601,,RECORD,UNSIGNED8,Receive PDO Mapping Parameter,,,,,,,This object contains the mapping parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1601,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1601,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,1610679072,,0,ManagedConst,no,0,0,no
0x1601,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,1610679328,,0,ManagedConst,no,0,0,no
0x1602,,RECORD,UNSIGNED8,Receive PDO Mapping Parameter,,,,,,,This object contains the mapping parameters for the PDO the CANopen device is able to receive.<br/>,,,,,,,
0x1602,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1602,0x01,,UNSIGNED32,Mapping Entry 1,,const,no,1,1,1610679584,,0,ManagedConst,no,0,0,no
0x1602,0x02,,UNSIGNED32,Mapping Entry 2,,const,no,1,1,1610679840,,0,ManagedConst,no,0,0,no
0x1800,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1800,0x00,,UNSIGNED8,Number of entries,,ro,no,1,1,5,,0,ManagedConst,no,2,6,no
0x1800,0x01,,UNSIGNED32,COB ID,,rw,no,1,1,$NODEID+0x180,,0,ManagedVariable,no,1,4294967295,no
0x1800,0x02,,UNSIGNED8,Transmission Type,,rw,no,1,1,254,,0,ManagedVariable,no,0,255,no
0x1800,0x03,,UNSIGNED16,Inhibit Time,,rw,no,1,1,0,,0,ManagedVariable,no,0,65535,no
0x1800,0x04,,UNSIGNED8,Compatibility Entry,,rw,no,1,0,,,0,ManagedVariable,no,0,255,no
0x1800,0x05,,UNSIGNED16,Event Timer,,rw,no,1,1,500,,0,ManagedVariable,no,0,65535,no
0x1801,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1801,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,6,,0,ManagedConst,no,2,6,no
0x1801,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x280,,0,ManagedVariable,no,128,4294967295,no
0x1801,0x02,,UNSIGNED8,Transmission type,,rw,no,1,0,254,,0,ManagedVariable,no,0,255,no
0x1801,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1801,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1801,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1801,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1802,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1802,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,6,,0,ManagedConst,no,2,6,no
0x1802,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x380,,0,ManagedVariable,no,128,4294967295,no
0x1802,0x02,,UNSIGNED8,Transmission type,,rw,no,1,0,254,,0,ManagedVariable,no,0,255,no
0x1802,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1802,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1802,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1802,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1803,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1803,0x00,,UNSIGNED8,Highest sub-index supported,,const,no,1,1,6,,0,ManagedConst,no,2,6,no
0x1803,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,no,1,1,$NODEID+0x480,,0,ManagedVariable,no,128,4294967295,no
0x1803,0x02,,UNSIGNED8,Transmission type,,rw,both,1,0,254,,0,ManagedVariable,no,0,255,no
0x1803,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1803,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1803,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1803,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1804,,RECORD,UNSIGNED8,TPDO communication parameter,,,,,,,,,,,,,,
0x1804,0x00,,UNSIGNED8,Highest sub-index supported,,const,both,1,1,6,,0,ManagedConst,no,2,6,no
0x1804,0x01,,UNSIGNED32,COB-ID used by TPDO,,rw,tpdo,1,2,$NODEID+0x180+1,,0,ManagedVariable,no,128,4294967295,no
0x1804,0x02,,UNSIGNED8,Transmission type,,rw,no,1,0,254,,0,ManagedVariable,no,0,255,no
0x1804,0x03,,UNSIGNED16,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xffff,no
0x1804,0x04,,UNSIGNED8,Inhibit time,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1804,0x05,,UNSIGNED16,Event timer,,rw,no,1,0,500,,0,ManagedVariable,no,0,0xffff,no
0x1804,0x06,,UNSIGNED8,SYNC start value,,rw,no,1,0,,,0,ManagedVariable,no,0,0xff,no
0x1a00,,RECORD,UNSIGNED8,Conductivity Data OUT1,,,,,,,,,,,,,,
0x1a00,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a00,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610744096,,0,ManagedConst,no,0,0,no
0x1a00,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610744352,,0,ManagedConst,no,0,0,no
0x1a01,,RECORD,UNSIGNED8,Conductivity Data OUT2,,,,,,,,,,,,,,
0x1a01,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a01,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610744608,,0,ManagedConst,no,0,0,no
0x1a01,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610744864,,0,ManagedConst,no,0,0,no
0x1a02,,RECORD,UNSIGNED8,Conductivity Data OUT3,,,,,,,,,,,,,,
0x1a02,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a02,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610745120,,0,ManagedConst,no,0,0,no
0x1a02,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610745376,,0,ManagedConst,no,0,0,no
0x1a03,,RECORD,UNSIGNED8, Pressue and Flowmeter Data OUT1,,,,,,,,,,,,,,
0x1a03,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a03,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610875168,,0,ManagedConst,no,0,0,no
0x1a03,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610940704,,0,ManagedConst,no,0,0,no
0x1a04,,RECORD,UNSIGNED8, Pressue and Flowmeter Data OUT2,,,,,,,,,,,,,,
0x1a04,0x00,,UNSIGNED8,Number of entries,,const,no,1,1,2,,0,ManagedConst,no,0,255,no
0x1a04,0x01,,UNSIGNED32,Mapping Entry 1,,const,tpdo,1,1,1610679072,,0,ManagedConst,no,0,0,no
0x1a04,0x02,,UNSIGNED32,Mapping Entry 2,,const,tpdo,1,1,1610679328,,0,ManagedConst,no,0,0,no
0x2001,0x00,VARIABLE,INTEGER32,Manufacturer Object,,rw,both,0,0,4,,0,ManagedVariable,no,0,0,no
0x3000,,ARRAY,INTEGER16,Managed Array,,,,,,,,,,,,,,
0x3000,0x00,,INTEGER16,NUmber of Entries,,ro,no,1,1,2,,0,ManagedConst,no,0,0,no
0x3000,0x01,,INTEGER16,Sub 1,,ro,tpdo,0,0,,,0,ManagedVariable,no,0,0,no
0x3000,0x02,,INTEGER16,sub 2,,rw,both,0,0,2,,0,ManagedVariable,no,0,0,no
0x6000,,ARRAY,UNSIGNED8,Motor Valve Control,,,,,,,,,,,,,,
0x6000,0x00,,UNSIGNED8,Highest sub-index supported,,ro,no,1,1,5,,0,ManagedConst,no,0,255,no
0x6000,0x01,,UNSIGNED8,ID,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x02,,UNSIGNED8,Command,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x03,,UNSIGNED8,Position setpoint,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x04,,UNSIGNED8,Pressure setpoint,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6000,0x05,,UNSIGNED8,Flowrate setpoint,,rw,no,1,1,,,0,ManagedVariable,no,0,255,no
0x6001,,ARRAY,UNSIGNED32,Conductivity Sensor Data IN,,,,,,,,,,,,,,
0x6001,0x00,,UNSIGNED32,Highest sub-index supported,,ro,no,1,1,6,,0,ManagedConst,no,0,255,no
0x6001,0x01,,UNSIGNED32,Conductivity Data IN1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x02,,UNSIGNED32,Temperature Data IN1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x03,,UNSIGNED32,Conductivity Data IN2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x04,,UNSIGNED32,Temperature Data IN2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x05,,UNSIGNED32,Conductivity Data IN3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6001,0x06,,UNSIGNED32,Temperature Data IN3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,,ARRAY,UNSIGNED32,Conductivity Sensor Data OUT,,,,,,,,,,,,,,
0x6002,0x00,,UNSIGNED32,Highest sub-index supported,,ro,no,1,1,6,,0,ManagedConst,no,0,255,no
0x6002,0x01,,UNSIGNED32,Conductivity Data OUT1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x02,,UNSIGNED32,Temperature Data OUT1,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x03,,UNSIGNED32,Conductivity Data OUT2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x04,,UNSIGNED32,Temperature Data OUT2,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x05,,UNSIGNED32,Conductivity Data OUT3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6002,0x06,,UNSIGNED32,Temperature Data OUT3,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,,ARRAY,UNSIGNED32,Motor Valve Data OUT,,,,,,,,,,,,,,
0x6003,0x00,,UNSIGNED32,Highest sub-index supported,,ro,no,1,1,8,,0,ManagedConst,no,0,255,no
0x6003,0x01,,UNSIGNED32,MV 01 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x02,,UNSIGNED32,MV 02 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x03,,UNSIGNED32,MV 03 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x04,,UNSIGNED32,MV 04 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x05,,UNSIGNED32,MV 05 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x06,,UNSIGNED32,MV 06 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x07,,UNSIGNED32,MV 07 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6003,0x08,,UNSIGNED32,MV 08 OUT,,rw,both,1,1,,,0,ManagedVariable,no,0,0xffffffff,no
0x6004,,ARRAY,REAL32,Flowmeter Data OUT,,,,,,,,,,,,,,
0x6004,0x00,,REAL32,Highest sub-index supported,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x6004,0x01,,REAL32,FM1 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6004,0x02,,REAL32,FM2 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6004,0x03,,REAL32,FM3 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6004,0x04,,REAL32,FM4 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,,ARRAY,REAL32,Pressure Sensor Data OUT,,,,,,,,,,,,,,
0x6005,0x00,,REAL32,Highest sub-index supported,,ro,no,1,1,4,,0,ManagedConst,no,0,255,no
0x6005,0x01,,REAL32,PS1 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,0x02,,REAL32,PS2 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,0x03,,REAL32,PS3 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no
0x6005,0x04,,REAL32,PS4 OUT,,rw,both,1,1,,,0,ManagedVariable,no,,,no

View File

@ -1,799 +0,0 @@
CANopen Object Dictionary Documenation for processBoard
Index: 0x1000 - Device Type
DataType: UNSIGNED32
ObjectCode: Variable
Sub: 0x00 - Device Type
DataType: UNSIGNED32
DefaultValue: 0
AccessType: ro
PDOMapping: 0
Index: 0x1001 - Error Register
DataType: UNSIGNED8
ObjectCode: Variable
Sub: 0x00 - Error Register
DataType: UNSIGNED8
AccessType: ro
PDOMapping: 0
Index: 0x1003 - Predefined Error Field
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Number of Errors
DataType: UNSIGNED8
DefaultValue: 0
AccessType: rw
PDOMapping: 0
Sub: 0x01 - Standard Error Field
DataType: UNSIGNED32
DefaultValue: 0
AccessType: ro
PDOMapping: 0
Index: 0x1008 - Manufacturer device name
DataType: VISIBLE_STRING
ObjectCode: Variable
Sub: 0x00 - Manufacturer device name
DataType: VISIBLE_STRING
DefaultValue: emotas Slave 1
AccessType: const
PDOMapping: 0
Index: 0x1014 - COB ID EMCY
DataType: UNSIGNED32
ObjectCode: Variable
Sub: 0x00 - COB ID EMCY
DataType: UNSIGNED32
DefaultValue: $NODEID+0x80
AccessType: ro
PDOMapping: 0
Index: 0x1015 - Inhibit Time Emergency
DataType: UNSIGNED16
ObjectCode: Variable
Sub: 0x00 - Inhibit Time Emergency
DataType: UNSIGNED16
DefaultValue: 0x0
AccessType: rw
PDOMapping: 0
Index: 0x1016 - Consumer Heartbeat Time
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 1
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Consumer Heartbeat Time
DataType: UNSIGNED32
DefaultValue: 0x0000
AccessType: rw
PDOMapping: 0
Index: 0x1017 - Producer Heartbeat Time
DataType: UNSIGNED16
ObjectCode: Variable
Sub: 0x00 - Producer Heartbeat Time
DataType: UNSIGNED16
DefaultValue: 1500
AccessType: rw
PDOMapping: 0
Index: 0x1018 - Identity Object
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 4
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Vendor Id
DataType: UNSIGNED32
DefaultValue: 0x319
AccessType: ro
PDOMapping: 0
Sub: 0x02 - Product Code
DataType: UNSIGNED32
DefaultValue: 1234
AccessType: ro
PDOMapping: 0
Sub: 0x03 - Revision number
DataType: UNSIGNED32
DefaultValue: 0x1
AccessType: ro
PDOMapping: 0
Sub: 0x04 - Serial number
DataType: UNSIGNED32
AccessType: ro
PDOMapping: 0
Index: 0x1029 - Error behaviour
DataType: UNSIGNED8
ObjectCode: Array
Sub: 0x00 - Nr of Error Classes
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Communication Error
DataType: UNSIGNED8
DefaultValue: 1
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Specific Error Class
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Index: 0x102a - NMT inhibit time
DataType: UNSIGNED16
ObjectCode: Variable
Description: This object shall indicate the configured inhibit time between two subsequent NMT messages. The outstanding NMT services shall be queued and shall be issued in order of their occurrence respecting the configured inhibit time.
The value shall be given in multiples of 100 µs. The value 0 shall disable the inhibit time.
Sub: 0x00 - NMT inhibit time
DataType: UNSIGNED16
DefaultValue: 10
AccessType: rw
PDOMapping: 0
Index: 0x1200 - Server SDO Parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID Client to Server
DataType: UNSIGNED32
DefaultValue: $NODEID+0x600
AccessType: ro
PDOMapping: 0
Sub: 0x02 - COB ID Server to Client
DataType: UNSIGNED32
DefaultValue: $NODEID+0x580
AccessType: ro
PDOMapping: 0
Index: 0x1283 - SDO client parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This objects contains the parameters for the SDO for which the CANopen device is the SDO client.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 3
AccessType: const
PDOMapping: 0
Sub: 0x01 - COB-ID client -> server
DataType: UNSIGNED32
DefaultValue: 0x80000000
AccessType: rw
PDOMapping: 0
Sub: 0x02 - COB-ID server -> client
DataType: UNSIGNED32
DefaultValue: 0x80000000
AccessType: rw
PDOMapping: 0
Sub: 0x03 - Node-ID of the SDO server
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Index: 0x1400 - Receive PDO Communication Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the communication parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x200
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Description: Sub-index 0x2 defines the reception character of the RPDO.
Index: 0x1401 - Receive PDO Communication Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the communication parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x200
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Description: Sub-index 0x2 defines the reception character of the RPDO.
Index: 0x1402 - Receive PDO Communication Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the communication parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x200
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Description: Sub-index 0x2 defines the reception character of the RPDO.
Index: 0x1600 - Receive PDO Mapping Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the mapping parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010120
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010220
AccessType: const
PDOMapping: 0
Index: 0x1601 - Receive PDO Mapping Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the mapping parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010320
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010420
AccessType: const
PDOMapping: 0
Index: 0x1602 - Receive PDO Mapping Parameter
DataType: UNSIGNED8
ObjectCode: Record
Description: This object contains the mapping parameters for the PDO the CANopen device is able to receive.
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010520
AccessType: const
PDOMapping: 0
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010620
AccessType: const
PDOMapping: 0
Index: 0x1800 - TPDO communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 5
AccessType: ro
PDOMapping: 0
Sub: 0x01 - COB ID
DataType: UNSIGNED32
DefaultValue: $NODEID+0x180
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission Type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Sub: 0x03 - Inhibit Time
DataType: UNSIGNED16
DefaultValue: 0x0000
AccessType: rw
PDOMapping: 0
Sub: 0x04 - Compatibility Entry
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Sub: 0x05 - Event Timer
DataType: UNSIGNED16
DefaultValue: 500
AccessType: rw
PDOMapping: 0
Index: 0x1801 - TPDO communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: const
PDOMapping: 0
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x280
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Sub: 0x03 - Inhibit time
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 0
Sub: 0x04 - Inhibit time
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 500
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Index: 0x1802 - TPDO communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: const
PDOMapping: 0
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x380
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Sub: 0x03 - Inhibit time
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 0
Sub: 0x04 - Inhibit time
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 500
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Index: 0x1803 - TPDO communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: const
PDOMapping: 0
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x480
AccessType: rw
PDOMapping: 0
Sub: 0x02 - Transmission type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 1
Sub: 0x03 - Inhibit time
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 0
Sub: 0x04 - Inhibit time
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 500
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Index: 0x1804 - TPDO communication parameter
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: const
PDOMapping: 1
Sub: 0x01 - COB-ID used by TPDO
DataType: UNSIGNED32
DefaultValue: $NODEID+0x180+1
AccessType: rw
PDOMapping: 4
Sub: 0x02 - Transmission type
DataType: UNSIGNED8
DefaultValue: 254
AccessType: rw
PDOMapping: 0
Sub: 0x03 - Inhibit time
DataType: UNSIGNED16
AccessType: rw
PDOMapping: 0
Sub: 0x04 - Inhibit time
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Sub: 0x05 - Event timer
DataType: UNSIGNED16
DefaultValue: 500
AccessType: rw
PDOMapping: 0
Sub: 0x06 - SYNC start value
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 0
Index: 0x1a00 - Conductivity Data OUT1
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60020120
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60020220
AccessType: const
PDOMapping: 4
Index: 0x1a01 - Conductivity Data OUT2
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60020320
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60020420
AccessType: const
PDOMapping: 4
Index: 0x1a02 - Conductivity Data OUT3
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60020520
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60020620
AccessType: const
PDOMapping: 4
Index: 0x1a03 - Pressue and Flowmeter Data OUT1
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60040120
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60050120
AccessType: const
PDOMapping: 4
Index: 0x1a04 - Pressue and Flowmeter Data OUT2
DataType: UNSIGNED8
ObjectCode: Record
Sub: 0x00 - Number of entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: const
PDOMapping: 0
Sub: 0x01 - Mapping Entry 1
DataType: UNSIGNED32
DefaultValue: 0x60010320
AccessType: const
PDOMapping: 4
Sub: 0x02 - Mapping Entry 2
DataType: UNSIGNED32
DefaultValue: 0x60010420
AccessType: const
PDOMapping: 4
Index: 0x2001 - Manufacturer Object
DataType: INTEGER32
ObjectCode: Variable
Sub: 0x00 - Manufacturer Object
DataType: INTEGER32
DefaultValue: 4
AccessType: rw
PDOMapping: 1
Index: 0x3000 - Managed Array
DataType: INTEGER16
ObjectCode: Array
Sub: 0x00 - NUmber of Entries
DataType: UNSIGNED8
DefaultValue: 2
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Sub 1
DataType: INTEGER16
AccessType: ro
PDOMapping: 4
Sub: 0x02 - sub 2
DataType: INTEGER16
DefaultValue: 2
AccessType: rw
PDOMapping: 1
Index: 0x6000 - Motor Valve Control
DataType: UNSIGNED8
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 5
AccessType: ro
PDOMapping: 0
Sub: 0x01 - ID
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x02 - Command
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x03 - Position setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x04 - Pressure setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Sub: 0x05 - Flowrate setpoint
DataType: UNSIGNED8
AccessType: rw
PDOMapping: 2
Index: 0x6001 - Conductivity Sensor Data IN
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Conductivity Data IN1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - Temperature Data IN1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - Conductivity Data IN2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - Temperature Data IN2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x05 - Conductivity Data IN3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x06 - Temperature Data IN3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Index: 0x6002 - Conductivity Sensor Data OUT
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 6
AccessType: ro
PDOMapping: 0
Sub: 0x01 - Conductivity Data OUT1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - Temperature Data OUT1
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - Conductivity Data OUT2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - Temperature Data OUT2
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x05 - Conductivity Data OUT3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x06 - Temperature Data OUT3
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Index: 0x6003 - Motor Valve Data OUT
DataType: UNSIGNED32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 8
AccessType: ro
PDOMapping: 0
Sub: 0x01 - MV 01 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - MV 02 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - MV 03 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - MV 04 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x05 - MV 05 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x06 - MV 06 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x07 - MV 07 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Sub: 0x08 - MV 08 OUT
DataType: UNSIGNED32
AccessType: rw
PDOMapping: 1
Index: 0x6004 - Flowmeter Data OUT
DataType: REAL32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 4
AccessType: ro
PDOMapping: 0
Sub: 0x01 - FM1 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - FM2 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - FM3 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - FM4 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1
Index: 0x6005 - Pressure Sensor Data OUT
DataType: REAL32
ObjectCode: Array
Sub: 0x00 - Highest sub-index supported
DataType: UNSIGNED8
DefaultValue: 4
AccessType: ro
PDOMapping: 0
Sub: 0x01 - PS1 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1
Sub: 0x02 - PS2 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1
Sub: 0x03 - PS3 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1
Sub: 0x04 - PS4 OUT
DataType: REAL32
AccessType: rw
PDOMapping: 1

View File

@ -0,0 +1,85 @@
/**
* @file
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief Defines helper typedef on the standard types, that are shorter
* to write because programmers are lazy. This file should be always
* included (don't include stdbool or stdint separately in other files,
* it would break the benefit for portability!)
*
*/
#ifndef NMS_TYPES_H_INCLUDED
#define NMS_TYPES_H_INCLUDED
/******************************************************************************
* Include-Files
******************************************************************************/
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
/******************************************************************************
* Constants and Macros
******************************************************************************/
/* Maximum size of integer variables */
#define NMS_INT8_MAX INT8_MAX
#define NMS_UINT8_MAX UINT8_MAX
#define NMS_INT16_MAX INT16_MAX
#define NMS_UINT16_MAX UINT16_MAX
#define NMS_INT32_MAX INT32_MAX
#define NMS_UINT32_MAX UINT32_MAX
#define NMS_INT64_MAX INT64_MAX
#define NMS_UINT64_MAX UINT64_MAX
/******************************************************************************
* Types definitions
******************************************************************************/
/* Standard types redefinition */
typedef int8_t sint8;
typedef uint8_t uint8;
typedef int16_t sint16;
typedef uint16_t uint16;
typedef int32_t sint32;
typedef uint32_t uint32;
typedef int64_t sint64;
typedef uint64_t uint64;
typedef float float32; /* Check the doc of the compiler for size of floats, 32 bits on CubeIDE */
typedef double float64; /* Check the doc of the compiler for size of doubles, 64 bits on CubeIDE */
/* Typedef for the errors
*/
typedef enum
{
NMS_ERR_NONE = 0u,
NMS_ERR_DEFAULT,
NMS_ERR_UNKNOWN, /* Error detected but unknown source */
NMS_ERR_UNEXPECTED, /* Unexpected behaviour happened */
NMS_ERR_INVALID_ARGUMENT, /* Invalid argument transmitted to a function (e.g. try to configured a GPIO port not present on the target) */
NMS_ERR_INVALID_ADDRESS, /* Invalid address (e.g. address out of valid range) */
NMS_ERR_INVALID_CONFIG, /* Module is trying to set an invalid configuration. */
NMS_ERR_INVALID_SIZE, /* Invalid size */
NMS_ERR_INVALID_INDEX, /* Invalid index (e.g. module index out of range) */
NMS_ERR_NULL_FUNCTION, /* Invalid function pointer (NULL) */
NMS_ERR_INVALID_CRC, /* Invalid CRC has been detected (e.g. after a flash read operation) */
NMS_ERR_TIMEOUT, /* Timeout detected (e.g. waited too long for a response from a SPI device) */
NMS_ERR_INTERNAL, /* Internal error detected by a low level driver */
NMS_ERR_OVERRUN, /* Overrun error detected by a low level driver (e.g. UART overrun) */
NMS_ERR_DMA, /* DMA error detected by a low level driver (e.g. issue with ADC) */
NMS_ERR_BUSY, /* Module is already busy / configured (e.g. trying to configure something when the HAL is already running) */
NMS_ERR_NOISE, /* Noise detected on a received frame */
NMS_ERR_FRAME, /* De-synchronization detected on a received frame */
NMS_ERR_PARITY, /* Parity error detected on a received frame */
NMS_ERR_NOT_SUPPORTED, /* Request not yet supported */
NMS_ERR_NOT_INITIALIZED, /* The initialization was unsuccessful */
NMS_ERR_NOT_RUNNING, /* Module has not been started */
NMS_ERR_BUS_ERROR, /* Memory cannot be physically addressed (e.g. invalid bus address) */
NMS_ERR_NULL_POINTER,
NMS_ERR_INVALID_MODULE,
NMS_ERR_INVALID_POINTER,
NMS_LSS_NODE_CONFIG_ERROR,
} NMSErrorEn;
#endif /* NMS_TYPES_H_INCLUDED */

View File

@ -0,0 +1,177 @@
/**
* @file
* @copyright InSolem SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @version $Revision: #1 $
* @change $Change: 17569 $
* @date $Date: 2022/06/08 $
* @authors $Author: qbourdon $
*
* @brief Utility functions for Insolem's projects.
*/
#ifndef INCLUDED_INS_UTILS_H
#define INCLUDED_INS_UTILS_H
/******************************************************************************
* Include-Files
******************************************************************************/
#include "nms_types.h"
/******************************************************************************
* Constants and Macros
******************************************************************************/
#define NMS_MIN(a,b) ((a >= b) ? b : a)
#define NMS_MAX(a,b) ((a >= b) ? a : b)
/******************************************************************************
* Type Declarations
******************************************************************************/
/******************************************************************************
* Global Variable Declarations
******************************************************************************/
/******************************************************************************
* Function Declarations
******************************************************************************/
/**
* @brief This function sets data bytes to memory block.
*
* @param[out] dest_pv Pointer to the block of memory to fill.
* @param val_u8 Byte to be set for initialization.
* @param len_u32 Length (in bytes !).
*
* @note This function fulfills the same task as the library function
* memset(). This function should be used because at some libraries and
* compilers the behavior is partly unpredictable.
*/
void NmsMemSet(void * dest_pv, uint8 val_u8, uint32 len_u32);
/**
* @brief This function copies data bytes from memory block to another.
*
* @param[out] dest_pv Pointer to the block of memory to fill.
* @param[in] src_pv Pointer to the source of data to be copied.
* @param len_u32 Length (in bytes !).
*
* @note This function fulfills the same task as the library function
* memcpy(). This function should be used because at some libraries and
* compilers the behavior is partly unpredictable.
*/
void NmsMemCpy(void * dest_pv, const void * src_pv, uint32 len_u32);
/**
* @brief This function compares data bytes from memory blocks.
*
* @param[in] src1_pv Pointer to first memory block to compare.
* @param[in] src2_pv Pointer to second memory block to compare.
* @param len_u32 Length (in bytes !).
*
* @return True if the buffers are identical. False if not.
*
* @note This function fulfills the same task as the library function
* memcmp(). This function should be used because at some libraries and
* compilers the behavior is partly unpredictable.
*/
bool NmsMemCmp(const void * src1_pv, const void * src2_pv, uint32 len_u32);
/**
* @brief This function reverses data bytes from memory block to another.
*
* @param[out] dest_pv Pointer to the block of memory to fill.
* @param[in] src_pv Pointer to the source of data to be reversed.
* @param len_u32 Length in bytes .
*/
void NmsMemRvs(void * dest_pv, const void * src_pv, uint32 len_u32);
/**
* @brief This function returns the bit at the position "pos_u8" from the
* value "value_u64".
*
* @param value_u64 Value where bits are stored.
* @param pos_u8 Position of the bit to return (0 to 63 --> first bit = index 0).
*
* @return True: bit set (1), False: bit reset (0).
*
* @note uint64 is used to make this function work with all integer types
* (from uint8 to uint64). A void* could have been used but that
* requires to transmit the variable type as argument.
*
* @note If called to read a bit out of range (e.g. 10th bit of an uint8,
* or 65th bit of an uint64), the function will return "false".
*/
bool NmsMemGetBit(uint64 value_u64, uint8 pos_u8);
/**
* @brief This function sets or resets the bit at the position "pos_u8" in
* the value "value_u64".
*
* @param value_u64 Value where bits are stored.
* @param bit_b Value of the bit to set. 1 or 0.
* @param pos_u8 Position of the bit to write (0 to 63 --> first bit = index 0).
*
* @return Updated value.
*
* @note uint64 is used to make this function work with all integer types
* (from uint8 to uint64). A void* could have been used but that
* requires to transmit the variable type as argument.
*
* @note If called to set or reset a bit out of range (e.g. 10th bit of an uint8,
* or 65th bit of an uint64), the function will return a copy of value_u64.
*/
uint64 NmsMemSetBit(uint64 value_u64, bool bit_b, uint8 pos_u8);
/**
* @brief Helper function to convert an array of bytes to a unsigned int value.
* Byte at index in the array [0] is the most significant byte (big-endian).
* This function is independant from the target's memory endianness.
*
* @param bytes_tu8 Array of bytes.
* @param nb_u8 Nb of bytes to consider or length of the array, max 8 bytes.
*
* @return The unsigned integer represented by the bytes array.
*/
uint64 NmsBytesToUint(const uint8 bytes_tu8[], uint8 nb_u8);
/**
* @brief Helper function to convert an integer value into an array of bytes representing it.
* Byte at index [0] in the array is the most significant byte (big-endian).
* This function is independant from the target's memory endianness.
*
* @param value_u64 Integer value for which to get the byte representation.
* @param bytes_tu8 Array of bytes, must be long enougth to store the number of bytes specified.
* @param nb_u8 Nb of bytes in the number, max 8 bytes.
*/
void NmsUintToBytes(uint64 value_u64, uint8 bytes_tu8[], uint8 nb_u8);
/**
* @brief This function converts integer to ascii string.
*
* @param num_i64 Number to be converted to a string.
* str_tc Array in memory where to store the resulting
* null-terminated string. Pointer full of null-terminated
* string in case of overflow.
* base_u8 Numerical base used to represent the value as a string,
* between 2 and 36, where 10 means decimal base,
* 16 hexadecimal, 8 octal, and 2 binary.
* len_u32 Size of the destination string to prevent overflow.
*
* @return Size of the final converted string, including the null-terminated
* string, limited by the length. Value is 0 in case of overflow.
*
* @note itoa() is a non-standard function. Negative value are only handled
* for base 10.
*/
uint32 NmsItoa(sint64 num_i64, char str_tc[], uint8 base_u8, uint32 len_u32);
#endif /* INCLUDED_INS_UTILS_H */

View File

@ -0,0 +1,56 @@
/**
* @file
*
* @brief This file references all the modules used through the project.
* It is intended to be jointly used with the log module to trace
* the source of an activity.
*
*/
#ifndef _PRJ_MODULES_H_
#define _PRJ_MODULES_H_
/******************************************************************************
* Templates
******************************************************************************/
/******************************************************************************
* Includes
******************************************************************************/
/******************************************************************************
* Macros (parameters)
******************************************************************************/
/******************************************************************************
* Macros (constants)
******************************************************************************/
/******************************************************************************
* Type declarations
******************************************************************************/
typedef enum
{
MODULE_NONE = 0u, /* Reserved for forbidden code 0. */
MODULE_LOG = 1u,
MODULE_MAIN = 2u,
/**< Developer may add new modules here (not between existing fields!). */
MODULE_HAL_GPIO = 3u,
MODULE_HAL_ADC = 4u,
MODULE_HAL_SYSTEM = 6u,
MODULE_MAP_HARDWARE = 7u,
MODULE_PU_BOARD = 8u,
MODULE_VALVE_CONTROLLER = 9u,
MODULE_NUMBER /* Amount of modules referenced in the CCU manager. */
} PrjModuleUid_en;
/******************************************************************************
* Global variables
******************************************************************************/
/******************************************************************************
* Functions declarations
******************************************************************************/
#endif /* END _PRJ_MODULE_H_ */

View File

@ -0,0 +1,90 @@
/**
* @file analogMeasurement.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief Source code for ADC data reading module.
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "analogMeasurement.h"
#include "hal_adc.h"
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define ADC_BUFFER_SIZE 9u
/******************************************************************************
* Module Global Variable Declarations
******************************************************************************/
static uint16 adcBuffer_u32[ADC_BUFFER_SIZE];
/******************************************************************************
* Private Function Declarations
******************************************************************************/
static void AnalogMeasurementInitBuffer(void);
/******************************************************************************
* Function Definitions
******************************************************************************/
void AnalogMeasurementInit(void)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
AnalogMeasurementInitBuffer();
HalAdcCalibrate(MAP_HAL_ADC_1);
error_u32 = HalAdcStartDMA(MAP_HAL_ADC_1, (uint32 *)adcBuffer_u32, ADC_BUFFER_SIZE);
if (error_u32 != NMS_ERR_NONE)
{
/* Handle the error (DMA start failed) */
}
}
void AnalogMesaurementRun(void)
{
HalAdcStartDMA(MAP_HAL_ADC_1, (uint32 *)adcBuffer_u32, sizeof(adcBuffer_u32));
}
void AnalogMeasurementReadData(uint32 channel_u32, uint32 *adcValue_pu32)
{
if (adcValue_pu32 == NULL)
{
return; /* Prevent dereferencing NULL pointer */
}
switch (channel_u32)
{
case PS1_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[0]; break;
case PS2_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[1]; break;
case PS3_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[2]; break;
case PS4_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[3]; break;
case PMP_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[4]; break;
case FM1_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[5]; break;
case FM2_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[6]; break;
case FM3_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[7]; break;
case FM4_ADC_CHANNEL: *adcValue_pu32 = adcBuffer_u32[8]; break;
default: *adcValue_pu32 = 0uL; break;
}
}
/******************************************************************************
* Private Function Definitions
******************************************************************************/
/* @brief Initialize buffer with default values*/
static void AnalogMeasurementInitBuffer(void)
{
for (uint8 i_u8 = 0u; i_u8 < ADC_BUFFER_SIZE; i_u8++)
{
adcBuffer_u32[i_u8] = 0uL;
}
}

View File

@ -0,0 +1,53 @@
/**
* @file analogMeasurement.h
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief ADC measurement module interface.
* This file provides function declarations and necessary definitions
* for reading analog sensor values using ADC with DMA. It defines
* ADC channel mappings, reference voltage, and resolution to ensure
* consistent data acquisition across multiple modules.
*
*/
#ifndef ANALOGMEASUREMENT_H_
#define ANALOGMEASUREMENT_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
/******************************************************************************
* Type declarations
******************************************************************************/
#define PS1_ADC_CHANNEL 1u
#define PS2_ADC_CHANNEL 2u
#define PS3_ADC_CHANNEL 3u
#define PS4_ADC_CHANNEL 4u
#define PMP_ADC_CHANNEL 5u
#define FM1_ADC_CHANNEL 6u
#define FM2_ADC_CHANNEL 7u
#define FM3_ADC_CHANNEL 8u
#define FM4_ADC_CHANNEL 9u
#define ANALOG_MEAS_ADC_REF_VOLTAGE 3.3f
#define ANALOG_MEAS_ADC_RESOLUTION 4095.0f /* 12-bit ADC */
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
/* @brief initialize the ADC, calibrate and Start the ADC in DMA mode */
void AnalogMeasurementInit(void);
void AnalogMesaurementRun(void);
/**
* @brief Reads the latest ADC value for the specified channel.
*
* @param channel_u32 The ADC channel to read from.
* adcValue Pointer to store the retrieved ADC value.
*/
void AnalogMeasurementReadData(uint32 channel_u32, uint32 * adcValue_pu32);
#endif /* ANALOGMEASUREMENT_H_ */

View File

@ -0,0 +1,42 @@
#include "nms_types.h"
extern char string1[];
extern char string2[];
extern OCTET_STRING octet1[];
extern OCTET_STRING octet2[];
extern CO_DOMAIN_PTR pDomain1;
extern CO_DOMAIN_PTR pDomain2;
#ifdef xxx
RET_T sdoServInd(CO_LINE_TYPE, BOOL_T, UNSIGNED8, UNSIGNED16, UNSIGNED8);
RET_T sdoServWrInd(CO_LINE_TYPE, BOOL_T, UNSIGNED8, UNSIGNED16, UNSIGNED8);
RET_T sdoServChkInd(CO_LINE_TYPE, BOOL_T, UNSIGNED8, UNSIGNED16, UNSIGNED8, const UNSIGNED8 *);
void errCtrl(CO_LINE_DECL, UNSIGNED8, CO_ERRCTRL_T, CO_NMT_STATE_T);
RET_T nmtInd(CO_LINE_DECL, BOOL_T, CO_NMT_STATE_T);
void pdoInd(CO_LINE_TYPE, UNSIGNED16);
void pdoRecInd(CO_LINE_TYPE, UNSIGNED16);
void pdoSyncInd(CO_LINE_TYPE, UNSIGNED16);
void syncInd(CO_LINE_TYPE);
void syncFinishedInd(CO_LINE_TYPE);
void ledRedInd(CO_LINE_TYPE, BOOL_T);
void ledGreenInd(CO_LINE_TYPE, BOOL_T);
void canInd(CO_LINE_TYPE, CO_CAN_STATE_T);
void commInd(CO_LINE_TYPE, CO_COMM_STATE_EVENT_T);
void sdoClRd(CO_LINE_TYPE, UNSIGNED8, UNSIGNED16, UNSIGNED8, UNSIGNED32, UNSIGNED32);
void sdoClWr(CO_LINE_TYPE, UNSIGNED8, UNSIGNED16, UNSIGNED8, UNSIGNED32);
void sdoQuInd(CO_LINE_TYPE, void *pData, UNSIGNED32 result);
RET_T emcyInd(CO_LINE_TYPE, UNSIGNED16 errCode, const UNSIGNED8 *addErrorCode);
void emcyConsInd(CO_LINE_TYPE, UNSIGNED8 node, UNSIGNED16 errCode, UNSIGNED8 errorRegister, UNSIGNED8 const *addErrorCode);
void timeInd(CO_LINE_TYPE, CO_TIME_T *pTime);
RET_T storeInd(CO_LINE_DECL, UNSIGNED8 subIndex);
#endif
void sdoClientReadInd(UNSIGNED8 canLine, UNSIGNED8 sdoNr, UNSIGNED16 index,
UNSIGNED8 subIndex, UNSIGNED32 size, UNSIGNED32 result);
void sdoClientWriteInd(UNSIGNED8 canLine, UNSIGNED8 sdoNr,
UNSIGNED16 index, UNSIGNED8 subIndex, UNSIGNED32 result);
uint8 getMyNodeId(CO_LINE_DECL);

View File

@ -0,0 +1,275 @@
/**
* @file monitoring.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "enduranceTestBench.h"
#include "stdlib.h"
/* CANopen includes */
#include <gen_define.h>
#include <co_canopen.h>
#include "hal_system.h"
#include "nms_can.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
#define ENDURANCE_TEST_BENCH_MAX_RETRY_CNT 3u
#define ENDURANCE_TEST_BENCH_TIMEOUT 1000u
#define ENDURANCE_TEST_BENCH_LSS_NODE_COUNT 20u
#define ENDURANCE_TEST_BENCH_POSITION_SETPOINT_INDEX 0x2002
#define ENDURANCE_TEST_BENCH_POSITION_SETPOINT_SUB_INDEX 0x0
#define ENDURANCE_TEST_BENCH_POSITION_FEEDBACK_INDEX 0x2004
#define ENDURANCE_TEST_BENCH_POSITION_FEEDBACK_SUB_INDEX 0x0
#define TEST_PATTERN_COUNT 3
#define VALVE_COUNT 20
static const uint8 testPatterns[TEST_PATTERN_COUNT][VALVE_COUNT] = {
/* Pattern 0: Columns alternately closed or open */
{
0, 0, 0, 0, 255, // Row 0
255, 252, 252, 252, 252, // Row 1
0, 0, 0, 0, 252, // Row 2
252, 252, 252, 252, 252 // Row 3
},
/* Pattern 1: Random placeholder (to be filled dynamically at runtime) */
{
0, 0, 0, 0, 0, // Row 0
0, 0, 0, 0, 0, // Row 1
0, 0, 0, 0, 0, // Row 2
0, 0, 0, 0, 0 // Row 3
},
/* Pattern 2: Inverted version of Pattern 0 */
{
252, 252, 252, 252, 252, // Row 0
0, 0, 0, 0, 252, // Row 1
252, 252, 252, 252, 252, // Row 2
0, 0, 0, 0, 252 // Row 3
}
};
/******************************************************************************
* Type Declarations
******************************************************************************/
typedef enum
{
TEST_BENCH_STARTUP,
TEST_BENCH_IDLE,
TEST_BENCH_WRITE,
TEST_BENCH_WRITE_WAIT,
TEST_BENCH_CYCLE_COMPLETE
} SdlTestBenchState_en;
typedef enum
{
TEST_BENCH_DATA_VERIF_DEFAULT,
TEST_BENCH_DATA_NODE_SKIPPED,
TEST_BENCH_DATA_VERIF_SUCCESS,
TEST_BENCH_DATA_VERIF_FAILURE,
} TestBenchStatus_en;
typedef struct
{
uint8 targetPositions_gau8[ENDURANCE_TEST_BENCH_LSS_NODE_COUNT];
uint8 readPosition_gau8[ENDURANCE_TEST_BENCH_LSS_NODE_COUNT];
TestBenchStatus_en status_en[ENDURANCE_TEST_BENCH_LSS_NODE_COUNT];
} TestBenchData_en;
/******************************************************************************
* Global variable declarations
******************************************************************************/
static uint8 currentNode_gu8 = 0u;
static TestBenchData_en testBenchData_en;
static SdlTestBenchState_en testBenchState_en = TEST_BENCH_IDLE;
static uint64 readExecutedTime_u64;
static uint64 writeTime_u64;
/******************************************************************************
* Public Function Definitions
******************************************************************************/
void EnduranceTestBenchRun(bool *testBenchStarted_pb)
{
static uint64 startTime_u64 = 0uLL;
static uint8 alternate_u8 = 0u;
static uint8 retries_u8 = 0u;
uint64 currentTime_u64;
HalSystemGetRunTimeMs(&currentTime_u64);
if (startTime_u64 == 0uLL)
{
HalSystemGetRunTimeMs(&startTime_u64);
testBenchState_en = TEST_BENCH_STARTUP;
}
switch (testBenchState_en)
{
case TEST_BENCH_STARTUP:
{
uint8 max_u8 = NMS_UINT8_MAX; /* Fully open (255) */
uint8 min_u8 = 0u; /* Fully closed (0) */
if ((currentTime_u64 - startTime_u64) < 5000uLL)
{
/* First 5 seconds: First 10 open, rest closed */
for (uint8 i_u8 = 0u; i_u8 < ENDURANCE_TEST_BENCH_LSS_NODE_COUNT; i_u8++)
{
testBenchData_en.targetPositions_gau8[i_u8] = (i_u8 < 10u) ? max_u8 : min_u8;
}
}
else if ((currentTime_u64 - startTime_u64) < 10000uLL)
{
/* Next 5 seconds: First 10 closed, rest open */
for (uint8 i_u8 = 0u; i_u8 < ENDURANCE_TEST_BENCH_LSS_NODE_COUNT; i_u8++)
{
testBenchData_en.targetPositions_gau8[i_u8] = (i_u8 < 10) ? min_u8 : max_u8;
}
}
else
{
/* After 10 seconds, move to endurance test */
testBenchState_en = TEST_BENCH_IDLE;
}
currentNode_gu8 = 0u;
testBenchState_en = TEST_BENCH_WRITE;
}
break;
case TEST_BENCH_IDLE:
{
*testBenchStarted_pb = true;
uint8 patternIndex_u8 = alternate_u8 % TEST_PATTERN_COUNT;
if (patternIndex_u8 == 1u)
{
/* Fill with random values */
for (uint8 i_u8 = 0u; i_u8 < VALVE_COUNT; i_u8++)
{
testBenchData_en.targetPositions_gau8[i_u8] = (uint8)(rand() % 256);
}
}
else
{
/* Copy from predefined pattern */
for (uint8 i_u8 = 0u; i_u8 < VALVE_COUNT; i_u8++)
{
testBenchData_en.targetPositions_gau8[i_u8] = testPatterns[patternIndex_u8][i_u8];
}
}
alternate_u8++;
currentNode_gu8 = 0u;
testBenchState_en = TEST_BENCH_WRITE;
}
break;
/* -------------------- Write -------------------- */
case TEST_BENCH_WRITE:
{
if (currentNode_gu8 < ENDURANCE_TEST_BENCH_LSS_NODE_COUNT)
{
RET_T retVal_en = coSdoWrite(
(currentNode_gu8 + 1),
ENDURANCE_TEST_BENCH_POSITION_SETPOINT_INDEX,
ENDURANCE_TEST_BENCH_POSITION_SETPOINT_SUB_INDEX,
&testBenchData_en.targetPositions_gau8[currentNode_gu8],
sizeof(uint8),
CO_FALSE,
ENDURANCE_TEST_BENCH_TIMEOUT
);
if (retVal_en == RET_OK)
{
NmsCanPutObj_u8(0x2004, currentNode_gu8 + 1, testBenchData_en.targetPositions_gau8[currentNode_gu8]);
HalSystemGetRunTimeMs(&writeTime_u64);
retries_u8 = 0u;
testBenchState_en = TEST_BENCH_WRITE_WAIT;
}
else
{
retries_u8++;
if (retries_u8 >= ENDURANCE_TEST_BENCH_MAX_RETRY_CNT)
{
testBenchData_en.status_en[currentNode_gu8] = TEST_BENCH_DATA_NODE_SKIPPED;
/* Mark node as skipped and move on */
currentNode_gu8++;
retries_u8 = 0u;
testBenchState_en = TEST_BENCH_WRITE;
}
}
}
else
{
/* Finished writing to all nodes */
currentNode_gu8 = 0u; /* Reset index for read phase */
testBenchState_en = TEST_BENCH_CYCLE_COMPLETE;
}
break;
}
case TEST_BENCH_WRITE_WAIT:
{
/* Wait 100ms between writes */
if ((currentTime_u64 - writeTime_u64) >= 200)
{
/* Move to next node write */
currentNode_gu8++;
testBenchState_en = TEST_BENCH_WRITE;
}
break;
}
/* -------------------- Cycle Complete -------------------- */
case TEST_BENCH_CYCLE_COMPLETE:
{
/* Optionally, can log or process the batch results here */
/* Reset all node data for the next cycle */
for (uint8 i_u8 = 0u; i_u8 < ENDURANCE_TEST_BENCH_LSS_NODE_COUNT; i_u8++)
{
testBenchData_en.targetPositions_gau8[i_u8] = 0u;
testBenchData_en.readPosition_gau8[i_u8] = 0u;
testBenchData_en.status_en[i_u8] = TEST_BENCH_DATA_VERIF_DEFAULT;
}
/* Reset everything and Start next cycle */
currentNode_gu8 = 0u;
retries_u8 = 0u;
testBenchState_en = TEST_BENCH_IDLE;
break;
}
default:
break;
}
}
/******************************************************************************
* Callback Functions
******************************************************************************/
void EnduranceTestBenchWriteInd(uint8 sdoNr_u8, uint16 index_u16, uint8 subIndex_u8, uint32 errorVal_u32)
{
HalSystemGetRunTimeMs(&writeTime_u64);
}
void EnduranceTestBenchReadInd(uint8 sdoNr_u8, uint16 index_u16, uint8 subIndex_u8, uint32 size, uint32 errorVal_u32)
{
HalSystemGetRunTimeMs(&readExecutedTime_u64);
}

View File

@ -0,0 +1,34 @@
/**
* @file monitoring.h
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
#ifndef ENDURANCETESTBENCH_H_
#define ENDURANCETESTBENCH_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
/**
* @brief This is the main function that runs the endurance
* test bench.
*
* @return void
*
*/
void EnduranceTestBenchRun(bool *testBenchStarted_b);
void EnduranceTestBenchWriteInd(uint8 sdoNr_u8, uint16 index_u16, uint8 subIndex_u8, uint32 errorVal_u32);
void EnduranceTestBenchReadInd(uint8 sdoNr_u8, uint16 index_u16, uint8 subIndex_u8, uint32 size, uint32 errorVal_u32);
#endif /* ENDURANCETESTBENCH_H_ */

View File

@ -0,0 +1,100 @@
/**
* @file puFilters.h
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
#ifndef PUFILTERS_H_
#define PUFILTERS_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
#include "map_hal.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
/******************************************************************************
* Type declarations
******************************************************************************/
/**
* @brief Input structure for 2nd order filter used with the sensors.
*/
typedef struct
{
float32 b1_f32;
float32 b2_f32;
float32 a2_f32;
float32 xPrev_f32;
float32 yPrev_f32;
} PuFilter_st;
typedef struct
{
float32 pressureRoPs2_f32;
float32 pmpPressureMeasFilt_f32;
} PuFiltersSensorData_st;
typedef struct
{
float32 prevInput_f32;
float32 prevOutput_f32;
float32 sampleTime_f32; // sampling time in seconds
} QDrainSpFilter_st;
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
/**
* @brief Initializes the filter module and associated sensor structures.
* @note This function sets up all second-order filters for flowmeters,
* pressure sensors, and other analog channels. It also initializes
* sensor calibration parameters such as Ku and voltage scaling.
* @retval None
*/
void PuFiltersInit(void);
/**
* @brief Executes one filtering and conversion cycle for all analog inputs.
* @note This function:
* - Reads raw ADC values from the analog buffer
* - Applies filters to each channel
* - Converts filtered voltages to physical units (flow, pressure, etc.)
* - Sends the processed data via queue to consumer tasks (e.g., CAN, PID)
* @retval None
*/
PuFiltersSensorData_st PuFiltersRun(void);
/**
* @brief Initializes the filter for the Qdrain setpoint.
*
* @param filter_pst Filter structure.
* Ts_f32 Sample time.
*
* @retval None
*/
void PuQDrainSpFilterInit(QDrainSpFilter_st* filter_pst, float32 Ts_f32);
/**
* @brief Initializes the filter for the Qdrain setpoint.
*
* @param filter_pst Filter structure.
* currentInput_f32 Input value, Qconso setpoint coming from CAN.
*
* @retval Filtered value to be used as setpoint.
*/
float32 PuQDrainSpFilterUpdate(QDrainSpFilter_st* filter_pst, float32 currentInput_f32);
#endif /* PUFILTERS_H_ */

View File

@ -0,0 +1,211 @@
/**
* @file puFilters.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "filter.h"
#include "analogMeasurement.h"
#include "flowmeter.h"
#include "pressureSensor.h"
#include "pressureController.h"
#include "grundfos.h"
#include "nms_can.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
#define PU_FILTERS_PS1_COEFF_B1 0.136728735997319f
#define PU_FILTERS_PS1_COEFF_B2 0.136728735997319f
#define PU_FILTERS_PS1_COEFF_A2 -0.726542528005361f
#define PU_FILTERS_PS2_COEFF_B1 0.099424464720624f
#define PU_FILTERS_PS2_COEFF_B2 0.099424464720624f
#define PU_FILTERS_PS2_COEFF_A2 -0.801151070558751f
#define PU_FILTERS_PS3_COEFF_B1 0.099424464720624f
#define PU_FILTERS_PS3_COEFF_B2 0.099424464720624f
#define PU_FILTERS_PS3_COEFF_A2 -0.801151070558751f
#define PU_FILTERS_FIRST_ORDER_TS 0.01f
#define PU_FILTERS_FIRST_ORDER_TAU 0.015f
#define PU_FILTERS_FIRST_ORDER_TAU_PMP 1.0f
/******************************************************************************
* Type declarations
******************************************************************************/
/******************************************************************************
* Module Global Variable Declarations
******************************************************************************/
static PuFilter_st ps2RoFilter_gst;
static PressureSensorMain_st ps1_gst;
static PuFilter_st pmpFirstOrderFilter_gst;
static float32 pmpPressureMeasFilt_gf32 = 0.0f;
/******************************************************************************
* Private Function Declarations
******************************************************************************/
static void PuFiltersFirstOrderFilterInit(PuFilter_st *filter_pst, float32 b1_f32,
float32 b2_f32, float32 a2_f32);
static void PuFiltersButterWorthFilterInit(PuFilter_st *filter_pst, float32 b1_f32,
float32 b2_f32, float32 a2_f32);
static float32 PuFiltersApply(PuFilter_st *filter_pst, float32 inputSample_f32);
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
void PuFiltersInit(void)
{
/* Compute first-order filter coefficients for MV07 filter */
float32 firstOrderAlpha_f32 = 2 * (PU_FILTERS_FIRST_ORDER_TAU / PU_FILTERS_FIRST_ORDER_TS);
float32 firstOrderCoeffA2_f32 = (1 - firstOrderAlpha_f32) / (1 + firstOrderAlpha_f32);
float32 firstOrderCoeffB1_f32 = 1 / (1 + firstOrderAlpha_f32);
float32 firstOrderCoeffB2_f32 = firstOrderCoeffB1_f32;
firstOrderAlpha_f32 = 2 * (PU_FILTERS_FIRST_ORDER_TAU_PMP / PU_FILTERS_FIRST_ORDER_TS);
firstOrderCoeffA2_f32 = (1 - firstOrderAlpha_f32) / (1 + firstOrderAlpha_f32);
firstOrderCoeffB1_f32 = 1 / (1 + firstOrderAlpha_f32);
firstOrderCoeffB2_f32 = firstOrderCoeffB1_f32;
PuFiltersFirstOrderFilterInit(&pmpFirstOrderFilter_gst, firstOrderCoeffB1_f32, firstOrderCoeffB2_f32, firstOrderCoeffA2_f32);
PuFiltersButterWorthFilterInit(&ps2RoFilter_gst, PU_FILTERS_PS2_COEFF_B1, PU_FILTERS_PS2_COEFF_B2, PU_FILTERS_PS2_COEFF_A2);
}
PuFiltersSensorData_st PuFiltersRun(void)
{
ps1_gst.channel_u32 = PS3_ADC_CHANNEL;
PressureSensorGetVal(&ps1_gst);
PuFiltersSensorData_st msg_st = {
.pressureRoPs2_f32 = ps1_gst.rawT_f32,
.pmpPressureMeasFilt_f32 = pmpPressureMeasFilt_gf32
};
ps1_gst.voltage_f32 = PuFiltersApply(&ps2RoFilter_gst, ps1_gst.voltage_f32);
pmpPressureMeasFilt_gf32= PuFiltersApply(&pmpFirstOrderFilter_gst, ps1_gst.rawT_f32);
return msg_st;
}
void PuQDrainSpFilterInit(QDrainSpFilter_st* filter_pst, float32 Ts_f32)
{
filter_pst->prevInput_f32 = 0.0f;
filter_pst->prevOutput_f32 = 1200.0f; // as per start_index = 1000
filter_pst->sampleTime_f32 = Ts_f32;
}
float32 PuQDrainSpFilterUpdate(QDrainSpFilter_st* filter_pst, float32 currentInput_f32)
{
float32 A_f32, B_32;
static float32 xN1_f32 = 0.0f;
static float32 yN1_f32 = 0.0f;
float32 Ts_f32 = filter_pst->sampleTime_f32;
float32 xN_f32 = currentInput_f32;
xN1_f32 = filter_pst->prevInput_f32;
yN1_f32 = filter_pst->prevOutput_f32;
static float32 yN_f32 = 0.0f;
if (xN_f32 > xN1_f32)
{
A_f32 = 1.0f / 200.0f;
B_32 = 1.0f / 200.0f;
}
else
{
A_f32 = 1.0f / 400.0f;
B_32 = 1.0f / 400.0f;
}
float32 alpha_f32 = -A_f32 * Ts_f32 * 0.5f;
float32 beta_f32 = B_32 * Ts_f32 * 0.5f;
yN_f32 = ((1.0f + alpha_f32) * yN1_f32 + beta_f32 * (xN_f32 + xN1_f32)) / (1.0f - alpha_f32);
NmsCanPutObj_u16(0x2013, 0x03, (uint16)yN_f32);
// update state
filter_pst->prevInput_f32 = xN_f32;
filter_pst->prevOutput_f32 = yN_f32;
return yN_f32;
}
/******************************************************************************
* Private Function Definitions
******************************************************************************/
/**
* @brief Initialize the butterworth filter structure.
*
* @param[in,out] filter_pst Pointer to the filter object.
* @param[in] b1_f32 Coefficient for current input.
* @param[in] b2_f32 Coefficient for previous input.
* @param[in] a2_f32 Coefficient for previous output (negative sign already applied).
*/
static void PuFiltersButterWorthFilterInit(PuFilter_st *filter_pst, float32 b1_f32,
float32 b2_f32, float32 a2_f32)
{
filter_pst->b1_f32 = b1_f32;
filter_pst->b2_f32 = b2_f32;
filter_pst->a2_f32 = a2_f32;
filter_pst->xPrev_f32 = 0.0f;
filter_pst->yPrev_f32 = 0.0f;
}
/**
* @brief Initialize the first order filter.
*
* @param[in,out] filter_pst Pointer to the filter object.
* @param[in] b1_f32 Coefficient for current input.
* @param[in] b2_f32 Coefficient for previous input.
* @param[in] a2_f32 Coefficient for previous output (negative sign already applied).
*/
static void PuFiltersFirstOrderFilterInit(PuFilter_st *filter_pst, float32 b1_f32,
float32 b2_f32, float32 a2_f32)
{
filter_pst->b1_f32 = b1_f32;
filter_pst->b2_f32 = b2_f32;
filter_pst->a2_f32 = a2_f32;
filter_pst->xPrev_f32 = 0.0f;
filter_pst->yPrev_f32 = 0.0f;
}
/**
* @brief Apply the butterworth filter to a new input sample.
*
* @param[in,out] filter_pst Pointer to the filter state.
* @param[in] inputSample_f32 Current input sample.
*
* @return Filtered output value.
*/
static float32 PuFiltersApply(PuFilter_st *filter_pst, float32 inputSample_f32)
{
float32 output_f32 = filter_pst->b1_f32 * inputSample_f32 + filter_pst->b2_f32 * filter_pst->xPrev_f32 - filter_pst->a2_f32 * filter_pst->yPrev_f32;
filter_pst->xPrev_f32 = inputSample_f32;
filter_pst->yPrev_f32 = output_f32;
return output_f32;
}
/******************************************************************************
* Callback Function Definitions
******************************************************************************/

View File

@ -14,46 +14,43 @@
******************************************************************************/
#include "nms_types.h"
#include "flowmeter.h"
#include "analogMeasurement.h"
/******************************************************************************
* Type declarations
******************************************************************************/
#define FLOWMETER_GAIN 3.12f
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define FLOWMETER_ADC_REF_VOLTAGE 3.3f
#define FLOWMETER_ADC_RESOLUTION 4095.0f /* 12-bit ADC */
/******************************************************************************
* Private function Declarations
******************************************************************************/
static float32 FlowmeterReadVoltage(FlowmeterMain_st *flowmeter_pst);
static void FlowmeterReadVoltage(FlowmeterMain_st * flowmeter_pst);
FlowmeterMain_st *flowmeter_gpst;
/******************************************************************************
* Extern Function Definitions
******************************************************************************/
void FlowmeterInit(FlowmeterMain_st *flowmeter_pst, ADC_HandleTypeDef *adcHandle_pst, uint32 channel_u32)
void FlowmeterInit(FlowmeterMain_st *flowmeter_pst)
{
if (flowmeter_pst == NULL || adcHandle_pst == NULL)
if (flowmeter_pst == NULL)
{
/* ERROR */
}
flowmeter_pst->adcHandle_pst = adcHandle_pst;
flowmeter_pst->channel_u32 = channel_u32;
flowmeter_pst->mKu_f32 = 5.0f; // Default value
}
void FlowmeterGetFlow(FlowmeterMain_st *flowmeter_pst)
{
if (flowmeter_pst == NULL)
{
/* ERROR */
}
flowmeter_pst->rawQ_f32 = flowmeter_pst->mKu_f32 * FlowmeterReadVoltage(flowmeter_pst);
FlowmeterReadVoltage(flowmeter_pst);
flowmeter_pst->rawQ_f32 = flowmeter_pst->mKu_f32 * flowmeter_pst->voltage_f32;
}
@ -88,40 +85,11 @@ void FlowmeterSetKu(FlowmeterMain_st *flowmeter_pst, float32 ku_f32)
* @return ADC output voltage based on sensor reading.
*
*/
static float32 FlowmeterReadVoltage(FlowmeterMain_st *flowmeter_pst)
static void FlowmeterReadVoltage(FlowmeterMain_st *flowmeter_pst)
{
uint32 adcVal_u32 = 0uL;
if (flowmeter_pst == NULL || flowmeter_pst->adcHandle_pst == NULL)
{
return 0.0f; /* Error Case */
}
ADC_ChannelConfTypeDef sConfig = {0};
sConfig.Channel = flowmeter_pst->channel_u32; /* Set the channel specific to this flowmeter */
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_12CYCLES_5;
if (HAL_ADC_ConfigChannel(flowmeter_pst->adcHandle_pst, &sConfig) != HAL_OK)
{
return 0.0f; /* ERROR */
}
/* Start ADC conversion and poll for completion */
if (HAL_ADC_Start(flowmeter_pst->adcHandle_pst) == HAL_OK)
{
if (HAL_ADC_PollForConversion(flowmeter_pst->adcHandle_pst, HAL_MAX_DELAY) == HAL_OK)
{
adcVal_u32 = HAL_ADC_GetValue(flowmeter_pst->adcHandle_pst);
}
HAL_ADC_Stop(flowmeter_pst->adcHandle_pst);
}
else
{
/* ERROR */
}
/* Convert ADC value to voltage (assuming 12-bit resolution and 3.3V reference) */
float32 voltage_f32 = (float)adcVal_u32 * (FLOWMETER_ADC_REF_VOLTAGE / FLOWMETER_ADC_RESOLUTION);
uint32 adcVal_u32 = 0uL;
AnalogMeasurementReadData(flowmeter_pst->channel_u32, &adcVal_u32);
return voltage_f32;
flowmeter_pst->voltage_f32 = (float32)adcVal_u32 * (ANALOG_MEAS_ADC_REF_VOLTAGE / ANALOG_MEAS_ADC_RESOLUTION) * FLOWMETER_GAIN;
}

View File

@ -22,19 +22,16 @@
******************************************************************************/
typedef struct
{
ADC_HandleTypeDef *adcHandle_pst;
float32 mKu_f32;
uint32 channel_u32;
float32 rawQ_f32;
float32 voltage_f32;
} FlowmeterMain_st; /* HubaFlowmeter structure definition */
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define FLOWMETER_FM1_ADC_CHANNEL 6u
#define FLOWMETER_FM2_ADC_CHANNEL 7u
#define FLOWMETER_FM3_ADC_CHANNEL 8u
#define FLOWMETER_FM4_ADC_CHANNEL 9u
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
@ -42,13 +39,11 @@ typedef struct
* @brief Init function of the Flowmeter module.
*
* @param flowmeter_pst : Pointer to main strucutre of the module.
* adcHandle_pst : ADC handler f the flowmeter.
* channel_u32 : ADC channel of the connected sensor to use.
*
* @return Flow rate value.
*
*/
void FlowmeterInit(FlowmeterMain_st *flowmeter_pst, ADC_HandleTypeDef *adcHandle_pst, uint32 channel_u32);
void FlowmeterInit(FlowmeterMain_st *flowmeter_pst);
/**
* @brief Function to get flow value

View File

@ -13,8 +13,9 @@
* Include Header Files
******************************************************************************/
#include "grundfos.h"
#include "gpio.h"
#include "i2c.h"
#include "analogMeasurement.h"
#include "hal_gpio.h"
#include "hal_i2c.h"
/******************************************************************************
* Type declarations
******************************************************************************/
@ -22,71 +23,74 @@
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define GRUNDFOS_PMP_ADC_CHANNEL 5u
#define GRUNDFOS_PMP_ADC_REF_VOLTAGE 3.3f
#define GRUNDFOS_PMP_ADC_RESOLUTION 4095.0f /* 12-bit ADC */
#define GRUNDFOS_PMP_ADC_MODULE &hadc1
#define GRUNDFOS_PMP_ENABLE_GPIO_PORT GPIOB
#define GRUNDFOS_PMP_ENABLE_GPIO_PIN GPIO_PIN_15
#define GRUNDFOS_PMP_I2C_HANDLE &hi2c4
#define GRUNDFOS_PMP_INTERNAL_DAC_ADDR 0x61
#define GRUNDFOS_PMP_INTERNAL_DAC_ADDR (0x61 << 1)
#define GRUNFOS_GAIN 0.32f
/******************************************************************************
* Private function Declarations
******************************************************************************/
static uint32 GrundfosPmpReadVoltage(void);
static float32 GrundfosPmpReadVoltage(uint8 channel_u8);
/******************************************************************************
* Extern Function Definitions
******************************************************************************/
void GrundfosPmpInit(GrundfosMain_st *grundfos_pst)
{
grundfos_pst->rawQ_f32 = 0.0f;
}
void GrundfosPmpEnable(uint8 state_u8)
{
if(state_u8 == 1u)
if(state_u8 == 0u)
{
HAL_GPIO_WritePin(GRUNDFOS_PMP_ENABLE_GPIO_PORT, GRUNDFOS_PMP_ENABLE_GPIO_PIN, GPIO_PIN_SET);
HalGpioWrite(MAP_HAL_PMP_ENABLE, HAL_GPIO_STATE_HIGH); /* Pulling the line high stops the pump */
}
else
{
HAL_GPIO_WritePin(GRUNDFOS_PMP_ENABLE_GPIO_PORT, GRUNDFOS_PMP_ENABLE_GPIO_PIN, GPIO_PIN_RESET);
HalGpioWrite(MAP_HAL_PMP_ENABLE, HAL_GPIO_STATE_LOW);
}
}
uint32 GrundfosPmpFeedbackSpeed(void)
void GrundfosPmpFeedback(GrundfosMain_st *grundfos_pst)
{
uint32 feedbackSpeed_u32 = (GrundfosPmpReadVoltage()) * 360uL;
return feedbackSpeed_u32;
if (grundfos_pst == NULL)
{
/* Error */
}
float32 feedbackVoltage_f32 = GrundfosPmpReadVoltage(grundfos_pst->channel_u32);
grundfos_pst->rawQ_f32 = feedbackVoltage_f32 * 3600.0f;
}
bool GrundfosPmpSetSpeed(float32 setSpeed_f32)
{
uint8 data_au8[2];
uint16 dacVal_u16;
static volatile uint16 dacVal_u16 = 0u;
/* Limit the input range to 0V - 10V */
if (setSpeed_f32 < 0.0f)
{
setSpeed_f32 = 0.0f;
setSpeed_f32 = 0.0f;
}
else if (setSpeed_f32 > 10.0f)
{
setSpeed_f32 = 10.0f;
}
else
{
/* Do nothing. */
setSpeed_f32 = 10.0f;
}
dacVal_u16 = (uint16)(setSpeed_f32 * (GRUNDFOS_PMP_ADC_RESOLUTION / 10.0f));
/* Convert pump speed (0-10V) to DAC value (0-5V output) */
dacVal_u16 = (uint16)((setSpeed_f32 * 4095.0f) / 10.0f);
data_au8[0] = (uint8)(dacVal_u16 >> 4); /* Upper 8 bits */
data_au8[1] = (uint8)((dacVal_u16 & 0x0F) << 4); /* Lower 4 bits shifted to the upper nibble */
/* Format the 12-bit DAC value into the correct byte format */
data_au8[0] = (uint8)(dacVal_u16 >> 8); /* Upper 8 bits */
data_au8[1] = (uint8)(dacVal_u16 & 0xFF); /* Lower 8 bits */
return HAL_I2C_Master_Transmit(GRUNDFOS_PMP_I2C_HANDLE, GRUNDFOS_PMP_INTERNAL_DAC_ADDR, data_au8, 2u, HAL_MAX_DELAY) == HAL_OK;
// return HalI2CMasterTransmit(MAP_HAL_GRUNDFOS_PMP_I2C_HANDLE,
// GRUNDFOS_PMP_INTERNAL_DAC_ADDR,
// data_au8, 2u) == NMS_ERR_NONE;
}
/******************************************************************************
* Private function Definitions
******************************************************************************/
@ -96,33 +100,14 @@ bool GrundfosPmpSetSpeed(float32 setSpeed_f32)
* @return ADC output voltage based on sensor reading.
*
*/
static uint32 GrundfosPmpReadVoltage(void)
static float32 GrundfosPmpReadVoltage(uint8 channel_u8)
{
uint32_t adcVal_u32 = 0uL;
ADC_ChannelConfTypeDef sConfig = {0};
sConfig.Channel = GRUNDFOS_PMP_ADC_CHANNEL; /* Set the channel specific to this flowmeter */
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_12CYCLES_5;
/* Convert ADC value to voltage (assuming 12-bit resolution and 3.3V reference) */
float32 voltage_f32 = 0.0f;
uint32 adcVal_u32 = 0uL;
AnalogMeasurementReadData(channel_u8, &adcVal_u32);
voltage_f32 = (float32)(adcVal_u32 * (ANALOG_MEAS_ADC_REF_VOLTAGE / ANALOG_MEAS_ADC_RESOLUTION)) * GRUNFOS_GAIN;
if (HAL_ADC_ConfigChannel(GRUNDFOS_PMP_ADC_MODULE, &sConfig) != HAL_OK)
{
return 0.0f; /* ERROR */
}
if (HAL_ADC_Start(GRUNDFOS_PMP_ADC_MODULE) == HAL_OK)
{
if (HAL_ADC_PollForConversion(GRUNDFOS_PMP_ADC_MODULE, HAL_MAX_DELAY) == HAL_OK)
{
adcVal_u32 = HAL_ADC_GetValue(GRUNDFOS_PMP_ADC_MODULE);
}
HAL_ADC_Stop(GRUNDFOS_PMP_ADC_MODULE);
}
else
{
/* ERROR */
}
uint32 voltage_u32 = adcVal_u32 * (GRUNDFOS_PMP_ADC_REF_VOLTAGE / GRUNDFOS_PMP_ADC_RESOLUTION);
return voltage_u32;
return voltage_f32;
}

View File

@ -21,6 +21,11 @@
/******************************************************************************
* Type declarations
******************************************************************************/
typedef struct
{
uint32 channel_u32;
float32 rawQ_f32;
} GrundfosMain_st; /* Grundfos structure definition */
/******************************************************************************
* Macro Constant Declarations
@ -29,7 +34,8 @@
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
extern uint32_t GrundfosPmpFeedbackSpeed(void);
extern void GrundfosPmpEnable(uint8_t state_u8);
extern bool GrundfosPmpSetSpeed(float setSpeed_f);
void GrundfosPmpInit(GrundfosMain_st *grundfos_pst);
void GrundfosPmpFeedback(GrundfosMain_st *grundfos_pst);
void GrundfosPmpEnable(uint8_t state_u8);
bool GrundfosPmpSetSpeed(float setSpeed_f);
#endif /* GRUNDFOS_H_ */

View File

@ -1,50 +0,0 @@
/**
* @file monitoring.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "monitoring.h"
/* CANopen includes */
#include <gen_define.h>
#include <co_canopen.h>
/******************************************************************************
* Macro constant declarations
******************************************************************************/
/******************************************************************************
* Global variable declarations
******************************************************************************/
static bool appSleep_b = CO_FALSE; /**< application sleep flag */
static CO_NMT_STATE_T nodeNMTState_gau[3]; /**< saved NMT states */
/******************************************************************************
* Public Function Definitions
******************************************************************************/
void MonitoringRun(void)
{
uint8 arrIndex_u8;
if (appSleep_b != CO_TRUE)
{
for (arrIndex_u8 = 0u; arrIndex_u8 < 3; arrIndex_u8++)
{
if (nodeNMTState_gau[arrIndex_u8] == CO_NMT_STATE_PREOP)
{
LssConfigureNode(arrIndex_u8);
}
if (nodeNMTState[arrIndex] == CO_NMT_STATE_OPERATIONAL)
{
/* Do nothing */
}
}
}
appSleep_b = CO_TRUE;
}

View File

@ -1,23 +0,0 @@
/**
* @file monitoring.h
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
#ifndef MONITORING_H_
#define MONITORING_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
void MonitoringRun(void);
#endif /* MONITORING_H_ */

View File

@ -13,44 +13,49 @@
#define OD_ENTRIES_H_
/* Device Indexes */
#define OD_ENTRY_PU_MOTOR_CTRL_INDEX 0x6000
#define OD_ENTRY_PU_COND_DATA_IN_INDEX 0x6001
#define OD_ENTRY_PU_COND_DATA_OUT_INDEX 0x6002
#define OD_ENTRY_PU_MOTOR_DATA_OUT_INDEX 0x6003
#define OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX 0x6004
#define OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX 0x6005
#define OD_ENTRY_PU_MOTOR_CTRL_INDEX 0x6000
#define OD_ENTRY_PU_COND_DATA_IN_INDEX 0x6001
#define OD_ENTRY_PU_COND_DATA_OUT_INDEX 0x6002
#define OD_ENTRY_PU_MOTOR_DATA_OUT_INDEX 0x6003
#define OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX 0x2000
#define OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX 0x2001
#define OD_ENTRY_PU_GRUNDFOS_PUMP_CONTROL_INDEX 0x2003
/* Device Sub-indexes */
#define OD_ENTRY_PU_MOTOR_CTRL_ID_SUB_INDEX 0x01
#define OD_ENTRY_PU_MOTOR_CTRL_CMD_SUB_INDEX 0x02
#define OD_ENTRY_PU_MOTOR_CTRL_POS_SUB_INDEX 0x03
#define OD_ENTRY_PU_MOTOR_CTRL_PRESSURE_SUB_INDEX 0x04
#define OD_ENTRY_PU_MOTOR_CTRL_FLOW_SUB_INDEX 0x05
#define OD_ENTRY_PU_MOTOR_CTRL_ID_SUB_INDEX 0x01
#define OD_ENTRY_PU_MOTOR_CTRL_CMD_SUB_INDEX 0x02
#define OD_ENTRY_PU_MOTOR_CTRL_POS_SUB_INDEX 0x03
#define OD_ENTRY_PU_MOTOR_CTRL_PRESSURE_SUB_INDEX 0x04
#define OD_ENTRY_PU_MOTOR_CTRL_FLOW_SUB_INDEX 0x05
#define OD_ENTRY_PU_COND1_DATA_IN_SUB_INDEX 0x01
#define OD_ENTRY_PU_COND2_DATA_IN_SUB_INDEX 0x03
#define OD_ENTRY_PU_COND3_DATA_IN_SUB_INDEX 0x05
#define OD_ENTRY_PU_COND1_DATA_IN_SUB_INDEX 0x01
#define OD_ENTRY_PU_COND2_DATA_IN_SUB_INDEX 0x03
#define OD_ENTRY_PU_COND3_DATA_IN_SUB_INDEX 0x05
#define OD_ENTRY_PU_TEMP1_DATA_IN_SUB_INDEX 0x02
#define OD_ENTRY_PU_TEMP2_DATA_IN_SUB_INDEX 0x04
#define OD_ENTRY_PU_TEMP3_DATA_IN_SUB_INDEX 0x06
#define OD_ENTRY_PU_TEMP1_DATA_IN_SUB_INDEX 0x02
#define OD_ENTRY_PU_TEMP2_DATA_IN_SUB_INDEX 0x04
#define OD_ENTRY_PU_TEMP3_DATA_IN_SUB_INDEX 0x06
#define OD_ENTRY_PU_COND1_DATA_OUT_SUB_INDEX 0x01
#define OD_ENTRY_PU_COND2_DATA_OUT_SUB_INDEX 0x03
#define OD_ENTRY_PU_COND3_DATA_OUT_SUB_INDEX 0x05
#define OD_ENTRY_PU_COND1_DATA_OUT_SUB_INDEX 0x01
#define OD_ENTRY_PU_COND2_DATA_OUT_SUB_INDEX 0x03
#define OD_ENTRY_PU_COND3_DATA_OUT_SUB_INDEX 0x05
#define OD_ENTRY_PU_TEMP1_DATA_OUT_SUB_INDEX 0x02
#define OD_ENTRY_PU_TEMP2_DATA_OUT_SUB_INDEX 0x04
#define OD_ENTRY_PU_TEMP3_DATA_OUT_SUB_INDEX 0x06
#define OD_ENTRY_PU_TEMP1_DATA_OUT_SUB_INDEX 0x02
#define OD_ENTRY_PU_TEMP2_DATA_OUT_SUB_INDEX 0x04
#define OD_ENTRY_PU_TEMP3_DATA_OUT_SUB_INDEX 0x06
#define OD_ENTRY_PU_FLOWMETER1_DATA_OUT_SUB_INDEX 0x01
#define OD_ENTRY_PU_FLOWMETER2_DATA_OUT_SUB_INDEX 0x02
#define OD_ENTRY_PU_FLOWMETER3_DATA_OUT_SUB_INDEX 0x03
#define OD_ENTRY_PU_FLOWMETER4_DATA_OUT_SUB_INDEX 0x04
#define OD_ENTRY_PU_FLOWMETER1_DATA_OUT_SUB_INDEX 0x01
#define OD_ENTRY_PU_FLOWMETER2_DATA_OUT_SUB_INDEX 0x02
#define OD_ENTRY_PU_FLOWMETER3_DATA_OUT_SUB_INDEX 0x03
#define OD_ENTRY_PU_FLOWMETER4_DATA_OUT_SUB_INDEX 0x04
#define OD_ENTRY_PU_PRESSURE1_DATA_OUT_SUB_INDEX 0x01
#define OD_ENTRY_PU_PRESSURE2_DATA_OUT_SUB_INDEX 0x02
#define OD_ENTRY_PU_PRESSURE3_DATA_OUT_SUB_INDEX 0x03
#define OD_ENTRY_PU_PRESSURE4_DATA_OUT_SUB_INDEX 0x04
#define OD_ENTRY_PU_PRESSURE1_DATA_OUT_SUB_INDEX 0x01
#define OD_ENTRY_PU_PRESSURE2_DATA_OUT_SUB_INDEX 0x02
#define OD_ENTRY_PU_PRESSURE3_DATA_OUT_SUB_INDEX 0x03
#define OD_ENTRY_PU_PRESSURE4_DATA_OUT_SUB_INDEX 0x04
#define OD_ENTRY_PU_GRUNDFOS_PUMP_ENABLE_SUB_INDEX 0x01
#define OD_ENTRY_PU_GRUNDFOS_PUMP_SET_SPEED_SUB_INDEX 0x02
#define OD_ENTRY_PU_GRUNDFOS_PUMP_FEEDBACK_SUB_INDEX 0x00
#endif /* OD_ENTRIES_H_ */

View File

@ -0,0 +1,184 @@
/**
* @file pressureController.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "pressureController.h"
#include "math.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
/******************************************************************************
* Type declarations
******************************************************************************/
/******************************************************************************
* Module Global Variable Declarations
******************************************************************************/
/******************************************************************************
* Private Function Declarations
******************************************************************************/
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
void PuControllersInitInputs(PuControllersPidInput_st *pumpPin_pst)
{
/* === Pump RO Pressure === */
pumpPin_pst->kpGain_f32 = 6.0f;
pumpPin_pst->kiGain_f32 = 5.0f;
pumpPin_pst->kdGain_f32 = -3.0f;
pumpPin_pst->satDeriv_f32 = 5.0f;
pumpPin_pst->sampleTime_f32 = 0.1f;
pumpPin_pst->commandMin_f32 = 0.0f;
pumpPin_pst->commandMax_f32 = 100.0f;
pumpPin_pst->regulatorActivation_f32 = 1.0f;
pumpPin_pst->integralResetFlag_b = false;
}
void PuControllersPidLoop(const PuControllersPidInput_st *input_pst, PuControllersPidOutput_st *output_pst, PuControllersPidState_st *state_pst)
{
float32 derivTerm_f32;
/* External Trigger */
if (input_pst->integralResetFlag_b)
{
state_pst->integState_f32 = 0.0f;
}
if(input_pst->regulatorActivation_f32 == 0.0f)
{
state_pst->prevMeasFilt2_f32 = 0.0f;
state_pst->sumOutput_f32 = 0.0f;
state_pst->integState_f32 = 0.0f;
output_pst->derivOutput_f32 = 0.0f;
output_pst->integOutput_f32 = 0.0f;
output_pst->propOutput_f32 = 0.0f;
}
/* Check if the regulator control should be active */
if (input_pst->regulatorActivation_f32 > 0.0f)
{
/* If regulator was inactive previously, reset integral and derivative states */
if (!state_pst->isRegulatorActive_b)
{
state_pst->prevMeasFilt2_f32 = 0.0f;
state_pst->integState_f32 = 0.0f;
state_pst->isRegulatorActive_b = true;
}
/* Compute derivative component based on measurement change rate */
derivTerm_f32 = -(input_pst->measFilt2_f32 - state_pst->prevMeasFilt2_f32) * input_pst->kdGain_f32 / input_pst->sampleTime_f32;
/* Apply saturation limits to derivative output to prevent excessive corrections */
if (derivTerm_f32 > input_pst->satDeriv_f32)
{
output_pst->derivOutput_f32 = input_pst->satDeriv_f32;
}
else if (derivTerm_f32 < -input_pst->satDeriv_f32)
{
output_pst->derivOutput_f32 = -input_pst->satDeriv_f32;
}
else
{
output_pst->derivOutput_f32 = derivTerm_f32;
}
/* Output current integral state */
output_pst->integOutput_f32 = state_pst->integState_f32;
/* Compute proportional output based on setpoint error */
derivTerm_f32 = input_pst->setpoint_f32 - input_pst->measFilt_f32;
if (fabsf(derivTerm_f32) > input_pst->tolerance_f32)
{
output_pst->propOutput_f32 = input_pst->kpGain_f32 * derivTerm_f32;
}
else
{
output_pst->propOutput_f32 = 0.0f;
output_pst->derivOutput_f32 = 0.0;
}
/* Sum PID components to form the overall regulator output */
state_pst->sumOutput_f32 = output_pst->propOutput_f32 + output_pst->integOutput_f32 + output_pst->derivOutput_f32;
/* Calculate integral contribution based on error */
derivTerm_f32 *= input_pst->kiGain_f32;
/* Adjust integral contribution to respect command saturation limits */
if (state_pst->prevCommandInput_f32 >= input_pst->commandMax_f32)
{
derivTerm_f32 = (float32)(fmin((float64)derivTerm_f32, 0.0f));
}
else if (input_pst->commandMin_f32 >= state_pst->prevCommandInput_f32)
{
derivTerm_f32 = (float32)(fmax(0.0f, (float64)derivTerm_f32));
}
/* Update previous measurement for derivative calculation in next cycle */
state_pst->prevMeasFilt2_f32 = input_pst->measFilt2_f32;
if (input_pst->kpGain_f32 == 0.0f)// I controller only
{
state_pst->integState_f32 += input_pst->sampleTime_f32 * derivTerm_f32;
}
/* Integrate integral term with adjusted contribution */
else
{
if (fabsf(output_pst->propOutput_f32 / input_pst->kpGain_f32) > input_pst->tolerance_f32)
{
state_pst->integState_f32 += input_pst->sampleTime_f32 * derivTerm_f32;
}
}
}
else if (state_pst->isRegulatorActive_b)
{
/* Disable regulator and reset summed output if regulator is deactivated */
state_pst->sumOutput_f32 = 0.0f;
state_pst->isRegulatorActive_b = false;
}
/* Combine regulator output with feed-forward command to form total command */
derivTerm_f32 = input_pst->commandRm_f32 + state_pst->sumOutput_f32;
/* Ensure final command output respects specified saturation limits */
if (derivTerm_f32 > input_pst->commandMax_f32)
{
output_pst->commandSetpoint_f32 = input_pst->commandMax_f32;
}
else if (derivTerm_f32 < input_pst->commandMin_f32)
{
output_pst->commandSetpoint_f32 = input_pst->commandMin_f32;
}
else
{
output_pst->commandSetpoint_f32 = derivTerm_f32;
}
/* Store last command to aid future saturation checks */
state_pst->prevCommandInput_f32 = derivTerm_f32;
}
/******************************************************************************
* Private Function Definitions
******************************************************************************/
/******************************************************************************
* Callback Function Definitions
******************************************************************************/

View File

@ -0,0 +1,73 @@
/**
* @file pressureController.h
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief
*
*/
#ifndef PRESSURECONTROLLER_H_
#define PRESSURECONTROLLER_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
/******************************************************************************
* Type declarations
******************************************************************************/
typedef struct
{
float32 regulatorActivation_f32;
float32 commandRm_f32;
float32 setpoint_f32;
float32 measFilt_f32;
float32 measFilt2_f32;
float32 kpGain_f32;
float32 kiGain_f32;
float32 kdGain_f32;
float32 sampleTime_f32;
float32 satDeriv_f32;
float32 commandMax_f32;
float32 commandMin_f32;
bool integralResetFlag_b;
float32 tolerance_f32;
} PuControllersPidInput_st;
/**
* @brief Output structure for regulator controller model.
*/
typedef struct
{
float32 commandSetpoint_f32;
float32 propOutput_f32;
float32 integOutput_f32;
float32 derivOutput_f32;
} PuControllersPidOutput_st;
typedef struct
{
float32 sumOutput_f32;
float32 prevMeasFilt2_f32;
float32 integState_f32;
float32 prevCommandInput_f32;
bool isRegulatorActive_b;
} PuControllersPidState_st;
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
void PuControllersInitInputs(PuControllersPidInput_st *pumpPin_pst);
void PuControllersPidLoop(const PuControllersPidInput_st *input_pst, PuControllersPidOutput_st *output_pst, PuControllersPidState_st *state_pst);
#endif /* PRESSURECONTROLLER_H_ */

View File

@ -13,35 +13,31 @@
* Include Header Files
******************************************************************************/
#include "pressureSensor.h"
#include "analogMeasurement.h"
/******************************************************************************
* Type declarations
******************************************************************************/
#define PRESSURE_SENSOR_GAIN 0.64f
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define PRESSURE_SENSOR_ADC_REF_VOLTAGE 3.3f
#define PRESSURE_SENSOR_ADC_RESOLUTION 4095.0f /* 12-bit ADC */
/******************************************************************************
* Private function Declarations
******************************************************************************/
static float PressureSensorReadVoltage(PressureSensorMain_st *pressureSensor_pst);
static float PressureSensorReadVoltage(uint32 channel_u32);
/******************************************************************************
* Extern Function Definitions
******************************************************************************/
void PressureSensorInit(PressureSensorMain_st *pressureSensor_pst,
ADC_HandleTypeDef *adcHandle_pst, uint32_t channel_u32)
void PressureSensorInit(PressureSensorMain_st *pressureSensor_pst)
{
if (pressureSensor_pst == NULL || adcHandle_pst == NULL)
pressureSensor_pst->rawT_f32 = 0.0f;
if (pressureSensor_pst == NULL)
{
/* ERROR */
}
pressureSensor_pst->adcHandle_pst = adcHandle_pst;
pressureSensor_pst->channel_u32 = channel_u32;
}
@ -52,7 +48,8 @@ void PressureSensorGetVal(PressureSensorMain_st *pressureSensor_pst)
/* ERROR */
}
pressureSensor_pst->rawT_f32 = (PressureSensorReadVoltage(pressureSensor_pst) - 0.5f) / 0.2f;
pressureSensor_pst->rawT_f32 = (PressureSensorReadVoltage(pressureSensor_pst->channel_u32) - 0.5f) / 0.2f;
pressureSensor_pst->voltage_f32 = PressureSensorReadVoltage(pressureSensor_pst->channel_u32);
}
@ -67,40 +64,12 @@ void PressureSensorGetVal(PressureSensorMain_st *pressureSensor_pst)
* @return ADC output voltage based on sensor reading.
*
*/
static float32 PressureSensorReadVoltage(PressureSensorMain_st *pressureSensor_pst)
static float32 PressureSensorReadVoltage(uint32 channel_u32)
{
uint32 adcVal_u32 = 0uL;
if (pressureSensor_pst == NULL || pressureSensor_pst->adcHandle_pst == NULL)
{
return 0.0f; /* Error Case */
}
ADC_ChannelConfTypeDef sConfig = {0};
sConfig.Channel = pressureSensor_pst->channel_u32; /* Set the channel specific to this flowmeter */
sConfig.Rank = ADC_REGULAR_RANK_1;
sConfig.SamplingTime = ADC_SAMPLETIME_12CYCLES_5;
if (HAL_ADC_ConfigChannel(pressureSensor_pst->adcHandle_pst, &sConfig) != HAL_OK)
{
return 0.0f; /* ERROR */
}
/* Start ADC conversion and poll for completion */
if (HAL_ADC_Start(pressureSensor_pst->adcHandle_pst) == HAL_OK)
{
if (HAL_ADC_PollForConversion(pressureSensor_pst->adcHandle_pst, HAL_MAX_DELAY) == HAL_OK)
{
adcVal_u32 = HAL_ADC_GetValue(pressureSensor_pst->adcHandle_pst);
}
HAL_ADC_Stop(pressureSensor_pst->adcHandle_pst);
}
else
{
/* ERROR */
}
/* Convert ADC value to voltage (assuming 12-bit resolution and 3.3V reference) */
float32 voltage_f32 = (float32)adcVal_u32 * (PRESSURE_SENSOR_ADC_REF_VOLTAGE / PRESSURE_SENSOR_ADC_RESOLUTION);
uint32 adcVal_u32 = 0uL;
AnalogMeasurementReadData(channel_u32, &adcVal_u32);
float32 voltage_f32 = (float32)adcVal_u32 * (ANALOG_MEAS_ADC_REF_VOLTAGE / ANALOG_MEAS_ADC_RESOLUTION) / PRESSURE_SENSOR_GAIN;
return voltage_f32;
}

View File

@ -19,18 +19,15 @@
******************************************************************************/
typedef struct
{
ADC_HandleTypeDef *adcHandle_pst;
uint32 channel_u32;
float32 rawT_f32;
float32 voltage_f32 ;
} PressureSensorMain_st; /* HubaPressure sensor structure definition */
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define PRESSURE_SENSOR_PS1_ADC_CHANNEL 1u
#define PRESSURE_SENSOR_PS2_ADC_CHANNEL 2u
#define PRESSURE_SENSOR_PS3_ADC_CHANNEL 3u
#define PRESSURE_SENSOR_PS4_ADC_CHANNEL 4u
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
@ -38,14 +35,11 @@ typedef struct
* @brief Init function of the Pressure sensor module.
*
* @param pressureSensor_pst : Pointer to main strucutre of the module.
* adcHandle_pst : ADC handler f the flowmeter.
* channel_u32 : ADC channel of the connected sensor to use.
*
* @return Pressure value.
*
*/
void PressureSensorInit(PressureSensorMain_st *pressureSensor_pst,
ADC_HandleTypeDef *adcHandle_pst, uint32 channel_u32);
void PressureSensorInit(PressureSensorMain_st *pressureSensor_pst);
/**
* @brief Function to get pressure value.

View File

@ -15,8 +15,11 @@
#include "processBoard.h"
#include "flowmeter.h"
#include "pressureSensor.h"
#include "grundfos.h"
#include "od_entries.h"
#include "co_odaccess.h"
#include "nms_can.h"
#include "analogMeasurement.h"
#include "hal_system.h"
/******************************************************************************
* Type declarations
******************************************************************************/
@ -24,21 +27,18 @@
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define PROCESS_BOARD_VALVE_POS_INDEX 0x6002
#define PROCESS_BOARD_VALVE_FLOW_INDEX 0x6006
#define PROCESS_BOARD_VALVE_PRESSURE_INDEX 0x6001
#define NMS_CAN_CANOPEN_MASTER_LINE 1u
#define PROCESS_BOARD_VALVE_SUB_INDEX 0x0
#define PROCESS_BOARD_FLOWMETER_ADC_MODULE &hadc1
#define PROCESS_BOARD_PRESSURE_SENSOR_ADC_MODULE &hadc1
#define PU_PUMP_SPEED_CHANGE_INTERVAL 900000uLL
#define PU_PUMP_MAX_SPEED 10u
#define PU_PUMP_MIN_SPEED 2u
#define PU_PMP_ENABLE 1u
#define PU_PMP_DISABLE 0u
#define PU_PMP_RATED_SPEED 3600uL
#define PU_MAX_PRESSURE 20u
/******************************************************************************
* Global variables
******************************************************************************/
static volatile uint8 motorCmd_gu8;
static volatile float32 flow_gf32 = 0.0f;
static volatile float32 pressure_gf32 = 0.0f;
FlowmeterMain_st flowmeterFM1_gst;
FlowmeterMain_st flowmeterFM2_gst;
FlowmeterMain_st flowmeterFM3_gst;
@ -49,144 +49,180 @@ PressureSensorMain_st pressureSensorPS2_gst;
PressureSensorMain_st pressureSensorPS3_gst;
PressureSensorMain_st pressureSensorPS4_gst;
ProcessBoardCondDataSt condBoard1_gst;
ProcessBoardCondDataSt condBoard2_gst;
ProcessBoardCondDataSt condBoard3_gst;
ProcessBoardMvDataSt mvBoard1_gst;
ProcessBoardMvDataSt mvBoard2_gst;
ProcessBoardMvDataSt mvBoard3_gst;
ProcessBoardMvDataSt mvBoard4_gst;
ProcessBoardMvDataSt mvBoard5_gst;
ProcessBoardMvDataSt mvBoard6_gst;
ProcessBoardMvDataSt mvBoard7_gst;
ProcessBoardMvDataSt mvBoard8_gst;
GrundfosMain_st grundfosPMP_gst;
/******************************************************************************
* Private Function Declarations
******************************************************************************/
static void ProcessBoardTriggerMvPosCtrl(uint8 motorId_u8, uint8 posData_u8);
static void ProcessBoardTriggerMvCartCtrl(uint8 motorId_u8, uint8 flowRate_u8, uint8 pressure_u8);
static void ProcessBoardReadCondDataIN(void);
static void ProcessBoardWriteCondDataOUT(void);
static void ProcessBoardReadMvDataIN(void);
static void ProcessBoardFlowmeterDataOUT(FlowmeterMain_st flowmeter_st);
static void ProcessBoardPressureSensorDataOUT(PressureSensorMain_st pressureSensor_st);
static void ProcessBoardFlowmeterDataOUT(float32 rawQ_f32);
static void ProcessBoardPressureSensorDataOUT(float32 rawT_f32);
static void ProcessBoardPumpSpeedDataOUT(uint32 pmpSpeed_u32);
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
void ProcessBoardInit(void)
{
motorCmd_gu8 = 0u;
HalSystemInit();
AnalogMeasurementInit();
FlowmeterInit(&flowmeterFM1_gst, PROCESS_BOARD_FLOWMETER_ADC_MODULE, FLOWMETER_FM1_ADC_CHANNEL);
PressureSensorInit(&pressureSensorPS1_gst, PROCESS_BOARD_PRESSURE_SENSOR_ADC_MODULE, PRESSURE_SENSOR_PS1_ADC_CHANNEL);
/* Initializing the structures (Pressure sensor, Flow
* meter, and Grundfos) with their respective ADC channel */
pressureSensorPS1_gst.channel_u32 = PS1_ADC_CHANNEL;
pressureSensorPS2_gst.channel_u32 = PS2_ADC_CHANNEL;
pressureSensorPS3_gst.channel_u32 = PS3_ADC_CHANNEL;
pressureSensorPS4_gst.channel_u32 = PS4_ADC_CHANNEL;
FlowmeterInit(&flowmeterFM2_gst, PROCESS_BOARD_FLOWMETER_ADC_MODULE, FLOWMETER_FM2_ADC_CHANNEL);
PressureSensorInit(&pressureSensorPS2_gst, PROCESS_BOARD_PRESSURE_SENSOR_ADC_MODULE, PRESSURE_SENSOR_PS2_ADC_CHANNEL);
grundfosPMP_gst.channel_u32 = PMP_ADC_CHANNEL;
FlowmeterInit(&flowmeterFM3_gst, PROCESS_BOARD_FLOWMETER_ADC_MODULE, FLOWMETER_FM3_ADC_CHANNEL);
PressureSensorInit(&pressureSensorPS3_gst, PROCESS_BOARD_PRESSURE_SENSOR_ADC_MODULE, PRESSURE_SENSOR_PS3_ADC_CHANNEL);
flowmeterFM1_gst.channel_u32 = FM1_ADC_CHANNEL;
flowmeterFM2_gst.channel_u32 = FM2_ADC_CHANNEL;
flowmeterFM3_gst.channel_u32 = FM3_ADC_CHANNEL;
flowmeterFM4_gst.channel_u32 = FM4_ADC_CHANNEL;
FlowmeterInit(&flowmeterFM4_gst, PROCESS_BOARD_FLOWMETER_ADC_MODULE, FLOWMETER_FM4_ADC_CHANNEL);
PressureSensorInit(&pressureSensorPS4_gst, PROCESS_BOARD_PRESSURE_SENSOR_ADC_MODULE, PRESSURE_SENSOR_PS4_ADC_CHANNEL);
FlowmeterInit(&flowmeterFM1_gst);
FlowmeterInit(&flowmeterFM2_gst);
FlowmeterInit(&flowmeterFM3_gst);
FlowmeterInit(&flowmeterFM4_gst);
PressureSensorInit(&pressureSensorPS1_gst);
PressureSensorInit(&pressureSensorPS2_gst);
PressureSensorInit(&pressureSensorPS3_gst);
PressureSensorInit(&pressureSensorPS4_gst);
GrundfosPmpInit(&grundfosPMP_gst);
}
void ProcessBoardRun(void)
void ProcessBoardRun(bool pumpTurnOn_b)
{
uint8 id_u8;
uint8 motorCmd_u8;
uint8 posData_u8;
uint8 flowRate_u8;
uint8 pressure_u8;
AnalogMesaurementRun();
coOdGetObj_u8(OD_ENTRY_PU_MOTOR_CTRL_INDEX, OD_ENTRY_PU_MOTOR_CTRL_ID_SUB_INDEX, &id_u8);
coOdGetObj_u8(OD_ENTRY_PU_MOTOR_CTRL_INDEX, OD_ENTRY_PU_MOTOR_CTRL_CMD_SUB_INDEX, &motorCmd_u8);
coOdGetObj_u8(OD_ENTRY_PU_MOTOR_CTRL_INDEX, OD_ENTRY_PU_MOTOR_CTRL_POS_SUB_INDEX, &posData_u8);
coOdGetObj_u8(OD_ENTRY_PU_MOTOR_CTRL_INDEX, OD_ENTRY_PU_MOTOR_CTRL_PRESSURE_SUB_INDEX, &flowRate_u8);
coOdGetObj_u8(OD_ENTRY_PU_MOTOR_CTRL_INDEX, OD_ENTRY_PU_MOTOR_CTRL_FLOW_SUB_INDEX, &pressure_u8);
if(motorCmd_u8 == 1u)
if (pumpTurnOn_b == true)
{
ProcessBoardTriggerMvPosCtrl(11, posData_u8);
GrundfosPmpEnable(PU_PMP_ENABLE);
/* Flowmeter data IN */
FlowmeterGetFlow(&flowmeterFM1_gst);
FlowmeterGetFlow(&flowmeterFM2_gst);
FlowmeterGetFlow(&flowmeterFM3_gst);
FlowmeterGetFlow(&flowmeterFM4_gst);
/* Pressure sensor data IN */
// PressureSensorGetVal(&pressureSensorPS1_gst);
// PressureSensorGetVal(&pressureSensorPS2_gst);
// PressureSensorGetVal(&pressureSensorPS3_gst);
/* Flowmeter data OUT */
ProcessBoardFlowmeterDataOUT(flowmeterFM1_gst.rawQ_f32);
ProcessBoardFlowmeterDataOUT(flowmeterFM2_gst.rawQ_f32);
ProcessBoardFlowmeterDataOUT(flowmeterFM3_gst.rawQ_f32);
ProcessBoardFlowmeterDataOUT(flowmeterFM4_gst.rawQ_f32);
/* Pressure sensor data OUT */
ProcessBoardPressureSensorDataOUT(pressureSensorPS1_gst.rawT_f32);
ProcessBoardPressureSensorDataOUT(pressureSensorPS2_gst.rawT_f32);
ProcessBoardPressureSensorDataOUT(pressureSensorPS3_gst.rawT_f32);
ProcessBoardPressureSensorDataOUT(pressureSensorPS4_gst.rawT_f32);
ProcessBoardPumpSpeedDataOUT(grundfosPMP_gst.rawQ_f32);
ProcessBoardGrundfosPumpHandler(pumpTurnOn_b);
}
else
{
ProcessBoardTriggerMvCartCtrl(id_u8, flowRate_u8, pressure_u8);
GrundfosPmpEnable(PU_PMP_DISABLE);
}
FlowmeterGetFlow(&flowmeterFM4_gst);
PressureSensorGetVal(&pressureSensorPS1_gst);
ProcessBoardFlowmeterDataOUT(flowmeterFM4_gst);
ProcessBoardPressureSensorDataOUT(pressureSensorPS1_gst);
ProcessBoardReadCondDataIN();
ProcessBoardWriteCondDataOUT();
}
void ProcessBoardGrundfosPumpHandler(uint8 speed_u8)
{
GrundfosPmpSetSpeed(speed_u8);
/* Grundfos Pump feedback speed OUT */
GrundfosPmpFeedback(&grundfosPMP_gst);
if ((uint8)(grundfosPMP_gst.rawQ_f32) > PU_PMP_RATED_SPEED)
{
speed_u8 -= 2u;
}
}
/******************************************************************************
* Private function definitions
******************************************************************************/
static void ProcessBoardTriggerMvPosCtrl(uint8 motorId_u8, uint8 posData_u8)
{
//static void ProcessBoardGrundfosPumpHandler(bool pumpTurnOn_b)
//{
// static uint8 speed_u8 = PU_PUMP_MIN_SPEED;
// static uint64 startTime_u64 = 0uLL;
// uint64 currentTimeMs_u64;
//
// HalSystemGetRunTimeMs(&currentTimeMs_u64);
//
// if (startTime_u64 == 0uLL)
// {
// HalSystemGetRunTimeMs(&startTime_u64);
// }
//
// if (pumpTurnOn_b == true)
// {
// GrundfosPmpEnable(PU_PMP_ENABLE);
// }
// else
// {
// GrundfosPmpEnable(PU_PMP_DISABLE);
// }
//
//
// if ((currentTimeMs_u64 - startTime_u64) >= PU_PUMP_SPEED_CHANGE_INTERVAL)
// {
// if (pressureSensorPS1_gst.rawT_f32 > PU_MAX_PRESSURE || pressureSensorPS2_gst.rawT_f32 > PU_MAX_PRESSURE ||
// pressureSensorPS3_gst.rawT_f32 > PU_MAX_PRESSURE || pressureSensorPS4_gst.rawT_f32 > PU_MAX_PRESSURE)
// {
// /* Decrease speed if pressure is too high */
// if (speed_u8 > PU_PUMP_MIN_SPEED)
// {
// speed_u8 -= 2u;
// }
// }
// else if (speed_u8 <= PU_PUMP_MAX_SPEED)
// {
// speed_u8 += 2u;
// }
// else
// {
// speed_u8 = PU_PUMP_MIN_SPEED;
// }
//
// startTime_u64 = currentTimeMs_u64;
// }
//
// GrundfosPmpSetSpeed(speed_u8);
//
// /* Grundfos Pump feedback speed OUT */
// GrundfosPmpFeedback(&grundfosPMP_gst);
//
// if ((uint8)(grundfosPMP_gst.rawQ_f32) > PU_PMP_RATED_SPEED)
// {
// speed_u8 -= 2u;
// }
//}
static void ProcessBoardFlowmeterDataOUT(float32 rawQ_f32)
{
NmsCanPutObj_u16(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER1_DATA_OUT_SUB_INDEX, (uint16)(flowmeterFM1_gst.rawQ_f32 * 100.0f));
NmsCanPutObj_u16(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER2_DATA_OUT_SUB_INDEX, (uint16)(flowmeterFM2_gst.rawQ_f32 * 100.0f));
NmsCanPutObj_u16(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER3_DATA_OUT_SUB_INDEX, (uint16)(flowmeterFM3_gst.rawQ_f32 * 100.0f));
NmsCanPutObj_u16(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER4_DATA_OUT_SUB_INDEX, (uint16)(flowmeterFM4_gst.rawQ_f32 * 100.0f));
}
static void ProcessBoardTriggerMvCartCtrl(uint8 motorId_u8, uint8 flowRate_u8, uint8 pressure_u8)
static void ProcessBoardPressureSensorDataOUT(float32 rawT_f32)
{
NmsCanPutObj_u16(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE1_DATA_OUT_SUB_INDEX, (uint16)pressureSensorPS1_gst.rawT_f32 * 100u);
NmsCanPutObj_u16(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE2_DATA_OUT_SUB_INDEX, (uint16)pressureSensorPS2_gst.rawT_f32 * 100u);
NmsCanPutObj_u16(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE3_DATA_OUT_SUB_INDEX, (uint16)(pressureSensorPS3_gst.rawT_f32 * 100.0f));
NmsCanPutObj_u16(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE4_DATA_OUT_SUB_INDEX, (uint16)pressureSensorPS4_gst.rawT_f32 * 100u);
}
static void ProcessBoardReadCondDataIN(void)
static void ProcessBoardPumpSpeedDataOUT(uint32 pmpSpeed_u32)
{
coOdGetObj_u32(OD_ENTRY_PU_COND_DATA_IN_INDEX, OD_ENTRY_PU_COND1_DATA_IN_SUB_INDEX, &condBoard1_gst.conductivityData_u32);
coOdGetObj_u32(OD_ENTRY_PU_COND_DATA_IN_INDEX, OD_ENTRY_PU_TEMP1_DATA_IN_SUB_INDEX, &condBoard1_gst.temperature_u32);
coOdGetObj_u32(OD_ENTRY_PU_COND_DATA_IN_INDEX, OD_ENTRY_PU_COND1_DATA_IN_SUB_INDEX, &condBoard2_gst.conductivityData_u32);
coOdGetObj_u32(OD_ENTRY_PU_COND_DATA_IN_INDEX, OD_ENTRY_PU_TEMP2_DATA_IN_SUB_INDEX, &condBoard2_gst.temperature_u32);
coOdGetObj_u32(OD_ENTRY_PU_COND_DATA_IN_INDEX, OD_ENTRY_PU_COND1_DATA_IN_SUB_INDEX, &condBoard3_gst.conductivityData_u32);
coOdGetObj_u32(OD_ENTRY_PU_COND_DATA_IN_INDEX, OD_ENTRY_PU_TEMP3_DATA_IN_SUB_INDEX, &condBoard3_gst.temperature_u32);
}
static void ProcessBoardWriteCondDataOUT(void)
{
coOdPutObj_u32(OD_ENTRY_PU_COND_DATA_OUT_INDEX, OD_ENTRY_PU_COND1_DATA_IN_SUB_INDEX, condBoard1_gst.conductivityData_u32);
coOdPutObj_u32(OD_ENTRY_PU_COND_DATA_OUT_INDEX, OD_ENTRY_PU_TEMP1_DATA_IN_SUB_INDEX, condBoard1_gst.temperature_u32);
coOdPutObj_u32(OD_ENTRY_PU_COND_DATA_OUT_INDEX, OD_ENTRY_PU_COND2_DATA_IN_SUB_INDEX, condBoard2_gst.conductivityData_u32);
coOdPutObj_u32(OD_ENTRY_PU_COND_DATA_OUT_INDEX, OD_ENTRY_PU_TEMP2_DATA_IN_SUB_INDEX, condBoard2_gst.temperature_u32);
coOdPutObj_u32(OD_ENTRY_PU_COND_DATA_OUT_INDEX, OD_ENTRY_PU_COND3_DATA_IN_SUB_INDEX, condBoard3_gst.conductivityData_u32);
coOdPutObj_u32(OD_ENTRY_PU_COND_DATA_OUT_INDEX, OD_ENTRY_PU_TEMP3_DATA_IN_SUB_INDEX, condBoard3_gst.temperature_u32);
}
static void ProcessBoardFlowmeterDataOUT(FlowmeterMain_st flowmeter_st)
{
coOdPutObj_r32(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER1_DATA_OUT_SUB_INDEX, flowmeterFM1_gst.rawQ_f32);
coOdPutObj_r32(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER1_DATA_OUT_SUB_INDEX, flowmeterFM2_gst.rawQ_f32);
coOdPutObj_r32(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER1_DATA_OUT_SUB_INDEX, flowmeterFM3_gst.rawQ_f32);
coOdPutObj_r32(OD_ENTRY_PU_FLOWMETER_DATA_OUT_INDEX, OD_ENTRY_PU_FLOWMETER1_DATA_OUT_SUB_INDEX, flowmeterFM4_gst.rawQ_f32);
}
static void ProcessBoardPressureSensorDataOUT(PressureSensorMain_st pressureSensor_st)
{
coOdPutObj_r32(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE1_DATA_OUT_SUB_INDEX, pressureSensorPS1_gst.rawT_f32);
coOdPutObj_r32(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE1_DATA_OUT_SUB_INDEX, pressureSensorPS2_gst.rawT_f32);
coOdPutObj_r32(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE1_DATA_OUT_SUB_INDEX, pressureSensorPS3_gst.rawT_f32);
coOdPutObj_r32(OD_ENTRY_PU_PRESSURE_DATA_OUT_INDEX, OD_ENTRY_PU_PRESSURE1_DATA_OUT_SUB_INDEX, pressureSensorPS4_gst.rawT_f32);
}
static void ProcessBoardReadMvDataIN(void)
{
/* To be implemented */
NmsCanPutObj_u16(OD_ENTRY_PU_GRUNDFOS_PUMP_CONTROL_INDEX, OD_ENTRY_PU_GRUNDFOS_PUMP_FEEDBACK_SUB_INDEX, (uint16)grundfosPMP_gst.rawQ_f32);
}

View File

@ -47,6 +47,8 @@ void ProcessBoardInit(void);
* @return void
*
*/
void ProcessBoardRun(void);
void ProcessBoardRun(bool pumpTurnOn_b);
void ProcessBoardGrundfosPumpHandler(uint8 speed_u8);
#endif /* PROCESSBOARD_H_ */

View File

@ -0,0 +1,611 @@
/**
* @file nms_can.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief Source code for CANOpen files abstracted for furthur use in the project.
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_can.h"
#include "enduranceTestBench.h"
/* CANopen includes */
#include <gen_define.h>
#include <co_canopen.h>
#include "co_sdo.h"
#include "co_pdo.h"
#include "co_odaccess.h"
/******************************************************************************
* Global Variable Declaration
******************************************************************************/
/******************************************************************************
* Macro constant declarations
******************************************************************************/
#define NMS_CAN_CANOPEN_SLAVE_LINE 0u
#define NMS_CAN_CANOPEN_MASTER_LINE 1u
#define NMS_CAN_CANOPEN_BITRATE 250u
#define NMS_CAN_PU_MASTER_NODE_ID 1u
#define NMS_CAN_PU_SLAVE_NODE_ID 3u
#define NMS_CAN_LSS_TIMEOUT 20u /* Defined in stack examples */
#define NMS_CAN_LSS_CONFIG_TIMEOUT 1000u
#define NMS_CAN_LSS_CONFIG_INTERVAL 4u
#define NMS_CAN_APPL_TIMER_TIME 250000uL
#define NMS_CAN_LSS_NODE_HB_MS 1000uL
#define NMS_CAN_LSS_NODE_STATE_RESET_INTERVAL 3u
#define NMS_CAN_SDO_TRANSMIT 0x580u
#define NMS_CAN_SDO_RECEIVE 0x600u
#define NMS_CAN_SDO_PARAM_INDEX 0x1280u
#define NMS_CAN_LSS_NODE_COUNT 20u
#define NMS_CAN_MIN_OPERATIONAL_NODES 15u
/******************************************************************************
* Type Declarations
******************************************************************************/
typedef struct
{
uint32 vendorId_u32;
uint32 productId_u32;
uint32 versionNbr_u32;
uint32 serialNbr_u32;
uint8 nodeId_u8;
} NmsCanLssNodeInfo_t;
/******************************************************************************
* Global Declarations
******************************************************************************/
NmsCanLssNodeInfo_t var_gst;
static CO_TIMER_T monitorTimer_gst; /**< application timer */
static bool monitorSleep_gb = CO_FALSE; /**< sleep flag */
static bool masterStarted_gb; /**< master started flag */
static const NmsCanLssNodeInfo_t nodeLookupTable_gast[NMS_CAN_LSS_NODE_COUNT] =
{
{0x59A, 0x4d2, 0x1, 0x01, 0x5} ,
{0x59A, 0x4d2, 0x1, 0x02, 0x6} ,
{0x59A, 0x4d2, 0x1, 0x03, 0x7} ,
{0x59A, 0x4d2, 0x1, 0x04, 0x8} ,
{0x59A, 0x4d2, 0x1, 0x05, 0x9} ,
{0x59A, 0x4d2, 0x1, 0x06, 0xA} ,
{0x59A, 0x4d2, 0x1, 0x07, 0xB} ,
{0x59A, 0x4d2, 0x1, 0x08, 0xC} ,
{0x59A, 0x4d2, 0x1, 0x09, 0xD} ,
{0x59A, 0x4d2, 0x1, 0x0A, 0xE} ,
{0x59A, 0x4d2, 0x1, 0x0B, 0xF} ,
{0x59A, 0x4d2, 0x1, 0x0C, 0x10},
{0x59A, 0x4d2, 0x1, 0x0D, 0x11},
{0x59A, 0x4d2, 0x1, 0x0E, 0x12},
{0x59A, 0x4d2, 0x1, 0x0F, 0x13},
{0x59A, 0x4d2, 0x1, 0x10, 0x14},
{0x59A, 0x4d2, 0x1, 0x11, 0x15},
{0x59A, 0x4d2, 0x1, 0x12, 0x16},
{0x59A, 0x4d2, 0x1, 0x13, 0x17},
{0x59A, 0x4d2, 0x1, 0x14, 0x18}
};
static CO_NMT_STATE_T nodeNMTState_gaen[NMS_CAN_LSS_NODE_COUNT];
static CO_TIMER_T nodeResetTimer_gst;
/******************************************************************************
* Private Function Definition
******************************************************************************/
static RET_T NmsCanOverwriteLoadIndication(uint8 index_u8);
static void NmsCanLssIndCallback( CO_LSS_MASTER_SERVICE_T service_en, uint16 errorCode_u16, uint8 errorSpec_u8, uint32 *pIdentity_pu32);
static void NmsCanLssHbMonitorCallback(uint8 nodeID_u8, CO_ERRCTRL_T state_en, CO_NMT_STATE_T nmtState_en);
static void NmsCanLssResetNodesCallback(void *pData_pv); /**< callback of reset handler */
static uint8 NmsCanLssGetNodeIndex(uint8 nodeId_u8);
static void NmsCanLssToggleMonitorFlag(void *pData_pv);
static void NmsCanLssNodeHandlerRun(void);
static uint32 NmsCanLssConfigureNode(uint8 arrIndex_u8);
static RET_T NmsCanLssSetSdoCobID(uint8 sdoNr_u8, uint8 nodeId_u8);
/* Supress warnings for implicit declaration.
* Need this function for overwriting the manual COB ids
* for the TPDO. */
extern void userOverwriteCobIdSettings(void);
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
void NmsCanInit()
{
for (uint8 i_u8 = 0u; i_u8 < NMS_CAN_LSS_NODE_COUNT; i_u8++)
{
nodeNMTState_gaen[i_u8] = CO_NMT_STATE_UNKNOWN;
}
codrvHardwareInit();
codrvCanInit(NMS_CAN_CANOPEN_BITRATE);
/* CANopen Initialization */
coCanOpenStackInit(NmsCanOverwriteLoadIndication);
codrvTimerSetup(CO_TIMER_INTERVAL);
coEventRegister_LSS_MASTER(NmsCanLssIndCallback);
coEventRegister_ERRCTRL(NmsCanLssHbMonitorCallback);
/* Register SDO event handlers */
coEventRegister_SDO_CLIENT_READ(EnduranceTestBenchReadInd);
coEventRegister_SDO_CLIENT_WRITE(EnduranceTestBenchWriteInd);
/* enable CAN communication */
codrvCanEnable();
coTimerStart(&monitorTimer_gst, NMS_CAN_APPL_TIMER_TIME, NmsCanLssToggleMonitorFlag, NULL, CO_TIMER_ATTR_ROUNDUP_CYCLIC);
//coTimerStart(&nodeResetTimer_gst, (NMS_CAN_LSS_NODE_STATE_RESET_INTERVAL * 1000000uLL), NmsCanLssResetNodesCallback, NULL, CO_TIMER_ATTR_ROUNDUP_CYCLIC);
coLssIdentifyNonConfiguredSlaves(NMS_CAN_LSS_CONFIG_TIMEOUT, NMS_CAN_LSS_CONFIG_INTERVAL);
/* node == 0, the NMT request is sent to all nodes. */
coNmtStateReq(0, CO_NMT_STATE_OPERATIONAL, CO_TRUE);
}
void NmsCanRun(void)
{
coCommTask();
/* LSS main runner */
NmsCanLssNodeHandlerRun();
}
uint32 NmsCanGetObj_u8(uint16 index_u16, uint8 subIndex_u8, uint8 *pObj_pu8)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = coOdGetObj_u8(index_u16, subIndex_u8, pObj_pu8);
if ( retVal_en == RET_OK)
{
error_u32 = NMS_ERR_NONE;
}
return error_u32;
}
uint32 NmsCanGetObj_u32(uint16 index_u16, uint8 subIndex_u8, uint32 *pObj_pu32)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = coOdGetObj_u32(index_u16, subIndex_u8, pObj_pu32);
if ( retVal_en == RET_OK)
{
error_u32 = NMS_ERR_NONE;
}
return error_u32;
}
uint32 NmsCanGetObj_f32(uint16 index_u16, uint8 subIndex_u8, float32 *pObj_pf32)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = coOdGetObj_r32(index_u16, subIndex_u8, pObj_pf32);
if ( retVal_en == RET_OK)
{
error_u32 = NMS_ERR_NONE;
}
return error_u32;
}
uint32 NmsCanPutObj_u8(uint16 index_u16, uint8 subIndex_u8, uint8 newVal_u8)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = coOdPutObj_u8(index_u16, subIndex_u8, newVal_u8);
if ( retVal_en == RET_OK)
{
error_u32 = NMS_ERR_NONE;
}
return error_u32;
}
uint32 NmsCanPutObj_u16(uint16 index_u16, uint8 subIndex_u8, uint16 newVal_u16)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = coOdPutObj_u16(index_u16, subIndex_u8, newVal_u16);
if ( retVal_en == RET_OK)
{
error_u32 = NMS_ERR_NONE;
}
return error_u32;
}
uint32 NmsCanPutObj_u32(uint16 index_u16, uint8 subIndex_u8, uint32 newVal_u32)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = coOdPutObj_u32(index_u16, subIndex_u8, newVal_u32);
if ( retVal_en == RET_OK)
{
error_u32 = NMS_ERR_NONE;
}
return error_u32;
}
uint32 NmsCanPutObj_f32(uint16 index_u16, uint8 subIndex_u8, uint32 newVal_u32)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = coOdPutObj_r32(index_u16, subIndex_u8, newVal_u32);
if ( retVal_en == RET_OK)
{
error_u32 = NMS_ERR_NONE;
}
return error_u32;
}
bool NmsCanAreAllNodesOperational(void)
{
uint8 operationalNodeNb_u8 = 0u;
for (uint8 i_u8 = 0u; i_u8 < NMS_CAN_LSS_NODE_COUNT ; i_u8++)
{
if (nodeNMTState_gaen[i_u8] == CO_NMT_STATE_OPERATIONAL)
{
operationalNodeNb_u8++;
}
}
return (operationalNodeNb_u8 >= NMS_CAN_MIN_OPERATIONAL_NODES) ? CO_TRUE : CO_FALSE;
}
/******************************************************************************
* Private Function Definitions
******************************************************************************/
/**
* @brief Handler for the defined nodes in the network.
* This function starts the configuration of a node if needed
*
* @return void
*
*/
static void NmsCanLssNodeHandlerRun(void)
{
if (monitorSleep_gb != CO_TRUE)
{
for (uint8 i_u8 = 0u; i_u8 < NMS_CAN_LSS_NODE_COUNT; i_u8++)
{
if (nodeNMTState_gaen[i_u8] == CO_NMT_STATE_PREOP || nodeNMTState_gaen[i_u8] == CO_NMT_STATE_UNKNOWN)
{
NmsCanLssConfigureNode(i_u8);
}
if (nodeNMTState_gaen[i_u8] == CO_NMT_STATE_OPERATIONAL)
{
/* Do nothing */
}
}
}
monitorSleep_gb = CO_TRUE;
}
/**
* @brief Load function for overwriting the TPDO COB id values.
*
* @param index_u8 Subindex parameter to point parameter area(unused)
* canLine_u8 The canline MASTER or SLAVE
*
* @return Error Code
*/
static RET_T NmsCanOverwriteLoadIndication(uint8 index_u8)
{
userOverwriteCobIdSettings();
return RET_OK;
}
/**
* @brief This function is called if a new NMT state of a node,
* is recordnized by the CANopen stack.
*
* @param nodeID_u8 Node id of the node that has registered a change.
* state_en Error control state
* nmtState_en NMT state of the particular node.
*
* @return Array index of the node in the network.
*
*/
static uint8 NmsCanLssGetNodeIndex(uint8 nodeId_u8)
{
uint8 arrIndex_u8;
/* find node ID array arrIndex_u8 */
for (arrIndex_u8 = 0u; arrIndex_u8 < NMS_CAN_LSS_NODE_COUNT; arrIndex_u8++)
{
if (nodeId_u8 == nodeLookupTable_gast[arrIndex_u8].nodeId_u8)
{
return arrIndex_u8;
}
}
return NMS_UINT8_MAX;
}
/**
* @brief This function is called when a new NMT state of a node
* is recognized by the CANopen stack.
*
* @param canLine_u8 Indicates whether the node is on the MASTER or SLAVE CAN line.
* pData Pointer to additional data (unused).
*/
static void NmsCanLssToggleMonitorFlag(void *pData_pv)
{
(void)pData_pv;
/* deactivate application sleep flag */
monitorSleep_gb = CO_FALSE;
}
/**
* @brief Configure a specific node.
* This function adds the defined node to heartbeat consumers,
* and sets its heartbeat interval.
*
* @param arrIndex_u8 Index of the node in the array which is to be configured.
*
* @return Status of the operation.
*
*/
static uint32 NmsCanLssConfigureNode(uint8 arrIndex_u8)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
RET_T retVal_en = RET_INTERNAL_ERROR;
/* Get the node ID from the lookup table using arrIndex_u8 */
uint8 nodeId_u8 = nodeLookupTable_gast[arrIndex_u8].nodeId_u8;
/* Add node to hb consumers with +25% tolerance
* Rationale - Allows some flexibility in detecting timeouts due to minor clock drifts,
* bus delays, or transmission issues.*/
retVal_en = coHbConsumerSet(nodeId_u8,
((NMS_CAN_LSS_NODE_HB_MS / 100 * 25) + NMS_CAN_LSS_NODE_HB_MS));
retVal_en = coHbConsumerStart(nodeId_u8);
/* setup SDO channel */
retVal_en = NmsCanLssSetSdoCobID((arrIndex_u8 + 1), nodeLookupTable_gast[arrIndex_u8].nodeId_u8);
//retVal_en = coSdoWrite(NmsCan_CANOPEN_MASTER_LINE, (arrIndex_u8 + 1), 0x1017u, 0u, (uint8*)(&nodeHBs[0]), 2u, CO_FALSE, 1000u);
/* start node */
retVal_en = coNmtStateReq(nodeId_u8, CO_NMT_STATE_OPERATIONAL, CO_FALSE);
if (retVal_en != RET_OK)
{
error_u32 = NMS_LSS_NODE_CONFIG_ERROR;
}
/* set local state to operational, if not operational yet */
if (masterStarted_gb == CO_FALSE)
{
/* set local state */
coNmtLocalStateReq(CO_NMT_STATE_OPERATIONAL);
/* save started flag */
masterStarted_gb = CO_TRUE;
}
return error_u32;
}
/******************************************************************************
* Callback Function Definitions
******************************************************************************/
/**
* @brief LSS indication function for handling the LSS api calls for dynamic
* setup of node ids.
*
* @param canLine_u8 The canline MASTER or SLAVE
* service_en LSS master services for indication functions
* errorCode_u16 Error code in the module
* errorSpec_u8 Specific error case that has occured
* pIdentity_pu32 LSS slave identity.
*
*/
static void NmsCanLssIndCallback(CO_LSS_MASTER_SERVICE_T service_en, uint16 errorCode_u16, uint8 errorSpec_u8, uint32 *pIdentity_pu32)
{
static uint8 matchedIndex_u8 = NMS_UINT8_MAX;
if (errorCode_u16 != 0u)
{
if (errorCode_u16 == NMS_UINT16_MAX)
{
/* ERROR */
}
else
{
/* ERROR */
}
if (service_en == CO_LSS_MASTER_SERVICE_STORE)
{
/* DEBUG INFO */
coLssSwitchGlobal(CO_LSS_STATE_WAITING);
}
return;
}
switch (service_en)
{
case CO_LSS_MASTER_SERVICE_NON_CONFIG_SLAVE:
/* DEBUG INFO */
coLssFastScan(NMS_CAN_LSS_TIMEOUT);
break;
case CO_LSS_MASTER_SERVICE_FASTSCAN:
/* Match detected node with lookup table */
for (uint8 i_u8 = 0; i_u8 < NMS_CAN_LSS_NODE_COUNT; i_u8++)
{
if (pIdentity_pu32[0] == nodeLookupTable_gast[i_u8].vendorId_u32 &&
pIdentity_pu32[1] == nodeLookupTable_gast[i_u8].productId_u32 &&
pIdentity_pu32[2] == nodeLookupTable_gast[i_u8].versionNbr_u32 &&
pIdentity_pu32[3] == nodeLookupTable_gast[i_u8].serialNbr_u32)
{
coLssSwitchSelective(pIdentity_pu32[0], pIdentity_pu32[1],
pIdentity_pu32[2], pIdentity_pu32[3], 20);
matchedIndex_u8 = i_u8;
break;
}
}
break;
case CO_LSS_MASTER_SERVICE_SWITCH_SELECTIVE:
if (matchedIndex_u8 < NMS_CAN_LSS_NODE_COUNT)
{
coLssSetNodeId(nodeLookupTable_gast[matchedIndex_u8].nodeId_u8, NMS_CAN_LSS_TIMEOUT);
matchedIndex_u8 = NMS_UINT8_MAX;
}
else
{
/* ERROR */
}
break;
case CO_LSS_MASTER_SERVICE_SET_NODEID:
/* DEBUG INFO */
coLssInquireNodeId(NMS_CAN_LSS_TIMEOUT);
break;
case CO_LSS_MASTER_SERVICE_INQUIRE_NODEID:
/* DEBUG INFO */
coLssStoreConfig( 200);
break;
case CO_LSS_MASTER_SERVICE_STORE:
/* DEBUG INFO */
coLssSwitchGlobal(CO_LSS_STATE_WAITING);
break;
default:
/* ERROR */
break;
}
}
/**
* @brief This function is called if a new NMT state of a node,
* is recordnized by the CANopen stack.
*
* @param nodeID_u8 Node id of the node that has registered a change.
* state_en Error control state
* nmtState_en NMT state of the particular node.
*
* @return void
*
*/
static void NmsCanLssHbMonitorCallback(uint8 nodeID_u8, CO_ERRCTRL_T state_en, CO_NMT_STATE_T nmtState_en)
{
uint8 arrIndex_u8;
/* look if node is monitored */
arrIndex_u8 = NmsCanLssGetNodeIndex(nodeID_u8);
/* handle monitored node */
if (arrIndex_u8 != NMS_UINT16_MAX)
{
/* save states */
nodeNMTState_gaen[arrIndex_u8] = nmtState_en;
/* indicate if monitored node lost heartbeat */
if (nmtState_en == CO_NMT_STATE_UNKNOWN)
{
/* To be transmitted via CAN */
/* ERROR */
}
/* indicate if monitored node sent a bootup message */
if (state_en == CO_ERRCTRL_BOOTUP)
{
/* INFO */
}
/* handle unmonitored node */
}
else
{
/* ERROR */
}
}
/**
* @brief This function tries to reset nodes with unknown NMT state.
*
* @param pData_pv Data.
*/
static void NmsCanLssResetNodesCallback(void *pData_pv)
{
uint8 arrIndex_u8;
(void)pData_pv;
/* reset defined nodes without known state */
for (arrIndex_u8 = 0u; arrIndex_u8 < NMS_CAN_LSS_NODE_COUNT; arrIndex_u8++)
{
if ((nodeNMTState_gaen[arrIndex_u8] != CO_NMT_STATE_PREOP) &&
(nodeNMTState_gaen[arrIndex_u8] != CO_NMT_STATE_OPERATIONAL))
{
/* reset node */
coNmtStateReq(nodeLookupTable_gast[arrIndex_u8].nodeId_u8, CO_NMT_STATE_RESET_NODE, CO_FALSE);
}
}
}
/**
* @brief This function configures a SDO client for the
* given node ID and SDO number.
*
* @param sdoNr_u8 Sdo number
* nodeId_u8 Node id of the node.
*
* @return Error state.
*
*/
static RET_T NmsCanLssSetSdoCobID(uint8 sdoNr_u8, uint8 nodeId_u8)
{
uint16 cobIndex_u16;
uint32 newCobId_u32;
RET_T retVal = RET_INTERNAL_ERROR;
/* get od index of sdoNr */
cobIndex_u16 = NMS_CAN_SDO_PARAM_INDEX + sdoNr_u8 - 1u;
/* set cobID for client to server direction (request) */
newCobId_u32 = NMS_CAN_SDO_RECEIVE + nodeId_u8;
retVal = coOdSetCobid(cobIndex_u16, 1u, newCobId_u32);
if (retVal == RET_OK)
{
/* set cobID for server to client direction (response) */
newCobId_u32 = NMS_CAN_SDO_TRANSMIT + nodeId_u8;
retVal = coOdSetCobid(cobIndex_u16, 2u, newCobId_u32);
}
/* print failed setup details */
if (retVal != RET_OK)
{
/* ERROR */
}
return retVal;
}

View File

@ -0,0 +1,124 @@
/**
* @file nms_can.h
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief CANOpen files abstracted for furthur use in the project.
*
*/
#ifndef NMS_CAN_H_
#define NMS_CAN_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
#include "co_datatype.h"
#include "co_nmt.h"
///******************************************************************************
// * Macro constant declarations
// ******************************************************************************/
//#define NMS_CANOPEN_BITRATE 250u
///******************************************************************************
// * Extern Function Declarations
// ******************************************************************************/
/**
* @brief Initializes the CAN controller and CANopen stack.
*/
void NmsCanInit(void);
/**
* @brief Runs the CAN communication tasks.
*
* @param canLine_u8 Can line selected.
*/
void NmsCanRun(void);
/**
* @brief Retrieves a 8-bit object from the CANopen object dictionary.
*
* @param index_u16 The object dictionary index.
* subIndex_u8 The sub-index of the object.
* pObj_pu8 Pointer to store the retrieved object value.
* canLine_u8 Can line selected.
*
* @return Error code. (NMS_ERR_NONE if successful, or an error code).
*/
uint32 NmsCanGetObj_u8(uint16 index_u16, uint8 subIndex_u8, uint8 *pObj_pu8);
/**
* @brief Retrieves a 32-bit object from the CANopen object dictionary.
*
* @param index_u16 The object dictionary index.
* subIndex_u8 The sub-index of the object.
* pObj_pu8 Pointer to store the retrieved object value.
*
* @return Error code. (NMS_ERR_NONE if successful, or an error code).
*/
uint32 NmsCanGetObj_u32(uint16 index_u16, uint8 subIndex_u8, uint32 *pObj_pu32);
/**
* @brief Retrieves a float object from the CANopen object dictionary.
*
* @param index_u16 The object dictionary index.
* subIndex_u8 The sub-index of the object.
* pObj_f32 Pointer to store the retrieved object value.
*
* @return Error code. (NMS_ERR_NONE if successful, or an error code).
*/
uint32 NmsCanGetObj_f32(uint16 index_u16, uint8 subIndex_u8, float32 *pObj_pf32);
/**
* @brief Puts a 8-bit object in the CANopen object dictionary.
*
* @param index_u16 The object dictionary index.
* subIndex_u8 The sub-index of the object.
* newVal_u32 The new value to be set.
*
* @return Error code. (NMS_ERR_NONE if successful, or an error code).
*/
uint32 NmsCanPutObj_u8(uint16 index_u16, uint8 subIndex_u8, uint8 newVal_u8);
/**
* @brief Puts a 32-bit object in the CANopen object dictionary.
*
* @param index_u16 The object dictionary index.
* subIndex_u8 The sub-index of the object.
* newVal_u16 The new value to be set.
*
* @return Error code. (NMS_ERR_NONE if successful, or an error code).
*/
uint32 NmsCanPutObj_u16(uint16 index_u16, uint8 subIndex_u8, uint16 newVal_u16);
/**
* @brief Puts a 32-bit object in the CANopen object dictionary.
*
* @param index_u16 The object dictionary index.
* subIndex_u8 The sub-index of the object.
* newVal_u32 The new value to be set.
*
* @return Error code. (NMS_ERR_NONE if successful, or an error code).
*/
uint32 NmsCanPutObj_u32(uint16 index_u16, uint8 subIndex_u8, uint32 newVal_u32);
/**
* @brief Puts a float object in the CANopen object dictionary.
*
* @param index_u16 The object dictionary index.
* subIndex_u8 The sub-index of the object.
* newVal_u32 The new value to be set.
*
* @return Error code. (NMS_ERR_NONE if successful, or an error code).
*/
uint32 NmsCanPutObj_f32(uint16 index_u16, uint8 subIndex_u8, uint32 newVal_u32);
/**
* @brief Checks if all nodes are in OPERATIONAL state.
*
* @return CO_TRUE if all nodes are OPERATIONAL, CO_FALSE otherwise.
*/
bool NmsCanAreAllNodesOperational(void);
#endif /* NMS_CAN_H_ */

View File

@ -0,0 +1,267 @@
/**
* @file hal_adc.c
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief STM HAL layer wrapper class for ADC.
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "hal_adc.h"
/* CubeMX */
#include "adc.h"
/******************************************************************************
* Macro Constant Declarations
******************************************************************************/
#define HAL_ADC_TIMEOUT 10u /* in milliseconds */
/******************************************************************************
* Module Global Variable Declarations
******************************************************************************/
static uint32 (*halAdcCallbacks[MAP_HAL_ADC_NUMBER])(void);
/******************************************************************************
* Extern Function Definitions
******************************************************************************/
void HalAdcCalibrate(MapHalAdcModule_en module_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
ADC_HandleTypeDef *targetModule_pst;
error_u32 = MapHalAdcModule(module_en, &targetModule_pst);
if (error_u32 == NMS_ERR_NONE)
{
HAL_ADCEx_Calibration_Start(targetModule_pst, ADC_SINGLE_ENDED);
}
else
{
/* Handle error */
}
}
uint32 HalAdcStart(MapHalAdcModule_en module_en)
{
uint32 error_u32 = NMS_ERR_NONE;
HAL_StatusTypeDef halAdcStatus_en = HAL_OK;
ADC_HandleTypeDef *targetModule_pst;
error_u32 = MapHalAdcModule(module_en, &targetModule_pst);
if (error_u32 == NMS_ERR_NONE)
{
/* Start the ADC conversion */
halAdcStatus_en = HAL_ADC_Start(targetModule_pst);
switch (halAdcStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_INTERNAL; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalAdcRead(MapHalAdcModule_en module_en, uint32 *adcValue_pu32)
{
uint32 error_u32 = NMS_ERR_NONE;
HAL_StatusTypeDef halAdcStatus_en = HAL_OK;
ADC_HandleTypeDef *targetModule_pst;
error_u32 = MapHalAdcModule(module_en, &targetModule_pst);
if (error_u32 == NMS_ERR_NONE)
{
halAdcStatus_en = HAL_ADC_PollForConversion(targetModule_pst, HAL_ADC_TIMEOUT);
if (halAdcStatus_en == HAL_OK)
{
*adcValue_pu32 = HAL_ADC_GetValue(targetModule_pst);
return NMS_ERR_NONE;
}
else
{
return NMS_ERR_UNKNOWN;
}
}
return error_u32;
}
uint32 HalAdcStop(MapHalAdcModule_en module_en)
{
uint32 error_u32 = NMS_ERR_NONE;
HAL_StatusTypeDef halAdcStatus_en = HAL_OK;
ADC_HandleTypeDef * targetModule_pst;
error_u32 = MapHalAdcModule(module_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
halAdcStatus_en = HAL_ADC_Stop(targetModule_pst);
switch(halAdcStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_INTERNAL; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalAdcStartDMA(MapHalAdcModule_en module_en, uint32 * pData_u32, uint32 length_u32)
{
uint32 error_u32 = NMS_ERR_NONE;
HAL_StatusTypeDef halAdcStatus_en = HAL_OK;
ADC_HandleTypeDef * targetModule_pst;
error_u32 = MapHalAdcModule(module_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
halAdcStatus_en = HAL_ADC_Start_DMA(targetModule_pst, pData_u32, length_u32);
switch(halAdcStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_INTERNAL; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalAdcConfigureCallback(MapHalAdcModule_en adcModule_en, uint32 (*callback_pfn)(void))
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if (adcModule_en < MAP_HAL_ADC_NUMBER )
{
halAdcCallbacks[adcModule_en] = callback_pfn;
error_u32 = NMS_ERR_NONE;
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
void HalAdcDeinit(MapHalAdcModule_en adcModule_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
ADC_HandleTypeDef * targetModule_pst;
uint8 index_u8;
uint8 startIndex_u8;
uint8 iteration_u8 = 1u; /* Default to 1 loop iteration (deinit one module) */
if(adcModule_en == MAP_HAL_ADC_NUMBER)
{
iteration_u8 = adcModule_en;
startIndex_u8 = 0u;
}
else
{
iteration_u8 += adcModule_en;
startIndex_u8 = adcModule_en;
}
for(index_u8 = startIndex_u8; index_u8 < iteration_u8; index_u8++)
{
error_u32 = MapHalAdcModule((MapHalAdcModule_en)index_u8, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
HAL_ADC_DeInit(targetModule_pst);
}
}
}
/******************************************************************************
* Callback Function Definitions
******************************************************************************/
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
MapHalAdcModule_en adcModule_en;
error_u32 = MapHalAdcCallback(MAP_HAL_ADC_1, &adcModule_en);
if (error_u32 == NMS_ERR_NONE)
{
if (adcModule_en < MAP_HAL_ADC_NUMBER)
{
if (halAdcCallbacks[adcModule_en] != NULL)
{
halAdcCallbacks[adcModule_en]();
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
}
else
{
error_u32 = NMS_ERR_INVALID_MODULE;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
}
void HAL_ADC_ErrorCallback(ADC_HandleTypeDef* hadc)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
ADC_HandleTypeDef *targetModule_pst = NULL;
error_u32 = MapHalAdcModule(MAP_HAL_ADC_1, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
switch(hadc->State)
{
case HAL_ADC_STATE_RESET:
error_u32 = NMS_ERR_UNKNOWN;
break;
case HAL_ADC_STATE_BUSY:
error_u32 = NMS_ERR_BUSY;
break;
case HAL_ADC_STATE_TIMEOUT:
error_u32 = NMS_ERR_TIMEOUT;
break;
case HAL_ADC_STATE_ERROR:
error_u32 = NMS_ERR_BUSY;
break;
case HAL_ADC_STATE_READY:
error_u32 = NMS_ERR_NOT_RUNNING;
break;
default:
error_u32 = NMS_ERR_UNKNOWN;
break;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
}

View File

@ -0,0 +1,108 @@
/**
* @file hal_adc.h
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief STM HAL ADC wrapper class.
*/
#ifndef HAL_ADC_H
#define HAL_ADC_H
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
#include "map_hal.h"
/* CubeMX */
#include "adc.h"
/******************************************************************************
* Typedef
******************************************************************************/
typedef enum
{
HAL_ADC_SUCCESS = 0U,
HAL_ADC_ERROR,
HAL_ADC_TIMEOUT
} HalAdcStatus_ten;
/******************************************************************************
* Function Declarations
******************************************************************************/
/**
* @brief Initializes the ADC hardware interface.
* This function sets up the necessary resources and configurations for the ADC.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
void HalAdcCalibrate(MapHalAdcModule_en module_en);
/**
* @brief Starts the ADC conversion on the specified ADC module.
* This function initiates the conversion process for the given ADC module.
*
* @param module_en The ADC module to be used (based on the system configuration).
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalAdcStart(MapHalAdcModule_en module_en);
/**
* @brief Reads the ADC value from the specified ADC module.
*
* @param module_en The ADC module to read from.
* adcValue_pu32 Pointer to store the ADC value.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalAdcRead(MapHalAdcModule_en module_en, uint32 *adcValue_pu32);
/**
* @brief Stops the ADC conversion for the specified ADC module.
*
* @param module_en The ADC module to stop.
*
* @return uint32_t: Status of the ADC stop operation.
*/
uint32 HalAdcStop(MapHalAdcModule_en module_en);
/**
* @brief Reads the ADC value in DMA mode
*
* @param module_en The ADC module to read from.
* pData_u32 Pointer to store the ADC value.
* length_u32 Length of data.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalAdcStartDMA(MapHalAdcModule_en module_en, uint32 * pData_u32, uint32 length_u32);
/**
* @brief Deinitializes the specified ADC module.
* This function frees up the resources associated with the ADC module
* and prepares it for shutdown or reconfiguration.
*
* @param adcModule_en The ADC module to deinitialize.
*
* @return None
*/
void HalAdcDeinit(MapHalAdcModule_en adcModule_en);
/**
* @brief Configures a callback function for ADC conversion completion.
* This function registers a callback function that will be called
* once the ADC conversion is completed.
*
* @param adcModule_en The ADC module to configure the callback for.
* callback_pfn Pointer to the callback function that will be called
* after the ADC conversion is complete.
* The callback should return a `uint32` value.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalAdcConfigureCallback(MapHalAdcModule_en adcModule_en, uint32 (*callback_pfn)(void));
#endif /* HAL_ADC_H */

View File

@ -0,0 +1,331 @@
/**
* @file hal_gpio.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief HAL layer for the GPIO module.
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "map_hal.h"
#include "hal_gpio.h"
/* CubeMX */
#include "gpio.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
#define HAL_GET_GPIO_OUTPUT_TYPE(port, pin) \
((((port)->OTYPER & (OUTPUT_TYPE << (pin))) == 0) ? GPIO_MODE_OUTPUT_PP : GPIO_MODE_OUTPUT_OD)
#define HAL_GPIO_GET_INTERRUPT_INPUT_MODE(port, pin) \
(((((port)->MODER >> ((pin) * 2)) & 0x3) == GPIO_MODE_IT_RISING) || \
((((port)->MODER >> ((pin) * 2)) & 0x3) == GPIO_MODE_IT_FALLING) || \
((((port)->MODER >> ((pin) * 2)) & 0x3) == GPIO_MODE_IT_RISING_FALLING))
#define HAL_GPIO_MODE_MASK (0x3u)
/******************************************************************************
* Type declarations
******************************************************************************/
/******************************************************************************
* Module Global Variable Declarations
******************************************************************************/
static uint32 (*halGpioCallbacks[MAP_HAL_GPIO_NUMBER])(HalGpioEdgeType_en);
/******************************************************************************
* Static Function Declarations
******************************************************************************/
/******************************************************************************
* Extern Function Definition
******************************************************************************/
uint32 HalGpioInit(void)
{
return NMS_ERR_NONE;
}
uint32 HalGpioRead( MapHalGpioPin_en pin_en, HalGpioState_en * state_pen )
{
uint32 error_u32 = NMS_ERR_DEFAULT;
uint16 targetPin_u16;
GPIO_TypeDef* targetPort_pst = NULL;
error_u32 = MapHalGpio(pin_en, &targetPin_u16, &targetPort_pst);
if(error_u32 == NMS_ERR_NONE)
{
*state_pen = (HAL_GPIO_ReadPin(targetPort_pst, targetPin_u16) == GPIO_PIN_SET)
? HAL_GPIO_STATE_HIGH
: HAL_GPIO_STATE_LOW;
}
else
{
*state_pen = HAL_GPIO_STATE_UNKNOWN;
error_u32 = NMS_ERR_UNEXPECTED;
}
return error_u32;
}
uint32 HalGpioWrite( MapHalGpioPin_en pin_en, HalGpioState_en state_en )
{
uint32 error_u32 = NMS_ERR_DEFAULT;
uint16 targetPin_u16;
GPIO_TypeDef* targetPort_pst = NULL;
error_u32 = MapHalGpio(pin_en, &targetPin_u16, &targetPort_pst);
if(error_u32 == NMS_ERR_NONE)
{
uint32 outpuType_u32 = HAL_GET_GPIO_OUTPUT_TYPE(targetPort_pst, pin_en);
if(outpuType_u32 == GPIO_MODE_OUTPUT_PP || outpuType_u32 == GPIO_MODE_OUTPUT_OD)
{
switch (state_en)
{
case HAL_GPIO_STATE_HIGH:
HAL_GPIO_WritePin(targetPort_pst, targetPin_u16, GPIO_PIN_SET); break;
case HAL_GPIO_STATE_LOW:
HAL_GPIO_WritePin(targetPort_pst, targetPin_u16, GPIO_PIN_RESET); break;
default:
error_u32 = NMS_ERR_UNKNOWN; break;
}
}
HalGpioState_en activeState_en = (HAL_GPIO_ReadPin(targetPort_pst, targetPin_u16) == GPIO_PIN_SET)
? HAL_GPIO_STATE_HIGH
: HAL_GPIO_STATE_LOW;
if(activeState_en != state_en)
{
error_u32 = NMS_ERR_INVALID_CONFIG;
}
}
else
{
error_u32 = NMS_ERR_UNEXPECTED;
}
return error_u32;
}
uint32 HalGpioToggle( MapHalGpioPin_en pin_en )
{
uint32 error_u32 = NMS_ERR_DEFAULT;
uint16 targetPin_u16;
GPIO_TypeDef* targetPort_pst = NULL;
error_u32 = MapHalGpio(pin_en, &targetPin_u16, &targetPort_pst);
if(error_u32 == NMS_ERR_NONE)
{
uint32 outpuType_u32 = HAL_GET_GPIO_OUTPUT_TYPE(targetPort_pst, targetPin_u16);
if(outpuType_u32 == GPIO_MODE_OUTPUT_PP || outpuType_u32 == GPIO_MODE_OUTPUT_OD)
{
HAL_GPIO_TogglePin(targetPort_pst, targetPin_u16);
}
}
else
{
error_u32 = NMS_ERR_UNEXPECTED;
}
return error_u32;
}
uint32 HalGpioReConfigure( MapHalGpioPin_en pin_en, HalGpioType_en type_en )
{
uint32 error_u32 = NMS_ERR_DEFAULT;
uint16 targetPin_u16;
GPIO_TypeDef* targetPort_pst = NULL;
GPIO_InitTypeDef gpioInit_st = {0};
error_u32 = MapHalGpio(pin_en, &targetPin_u16, &targetPort_pst);
if(error_u32 == NMS_ERR_NONE)
{
gpioInit_st.Pin = targetPin_u16;
switch(type_en)
{
case HAL_GPIO_INPUT:
gpioInit_st.Mode = GPIO_MODE_INPUT;
gpioInit_st.Pull = GPIO_NOPULL;
error_u32 = NMS_ERR_NONE;
break;
case HAL_GPIO_OUTPUT_PUSH_PULL_UP:
gpioInit_st.Mode = GPIO_MODE_OUTPUT_PP;
gpioInit_st.Pull = GPIO_PULLUP;
error_u32 = NMS_ERR_NONE;
break;
case HAL_GPIO_OUTPUT_PUSH_PULL_DOWN:
gpioInit_st.Mode = GPIO_MODE_OUTPUT_PP;
gpioInit_st.Pull = GPIO_PULLDOWN;
error_u32 = NMS_ERR_NONE;
break;
case HAL_GPIO_OUTPUT_PUSH_PULL_FREE:
gpioInit_st.Mode = GPIO_MODE_OUTPUT_PP;
gpioInit_st.Pull = GPIO_NOPULL;
error_u32 = NMS_ERR_NONE;
break;
case HAL_GPIO_OUTPUT_OPEN_DRAIN_UP:
gpioInit_st.Mode = GPIO_MODE_OUTPUT_OD;
gpioInit_st.Pull = GPIO_PULLUP;
error_u32 = NMS_ERR_NONE;
break;
case HAL_GPIO_OUTPUT_OPEN_DRAIN_FREE:
gpioInit_st.Mode = GPIO_MODE_OUTPUT_OD;
gpioInit_st.Pull = GPIO_NOPULL;
error_u32 = NMS_ERR_NONE;
break;
case HAL_GPIO_ISR_RISING:
gpioInit_st.Mode = GPIO_MODE_IT_RISING;
gpioInit_st.Pull = GPIO_NOPULL;
error_u32 = NMS_ERR_NONE;
break;
case HAL_GPIO_ISR_FALLING:
gpioInit_st.Mode = GPIO_MODE_IT_FALLING;
gpioInit_st.Pull = GPIO_NOPULL;
error_u32 = NMS_ERR_NONE;
break;
default: /* HAL_GPIO_ALTERNATE or unknown state. */
error_u32 = NMS_ERR_INVALID_ARGUMENT;
break;
}
}
else
{
error_u32 = NMS_ERR_UNEXPECTED;
}
/* Deploy hardware modification. */
if(error_u32 == NMS_ERR_NONE)
{
HAL_GPIO_DeInit(targetPort_pst, targetPin_u16);
HAL_GPIO_Init(targetPort_pst, &gpioInit_st);
}
return error_u32;
}
uint32 HalGpioSetCallback( MapHalGpioPin_en pin_en, uint32 (*callback_pfn)(HalGpioEdgeType_en edge_en))
{
uint32 error_u32 = NMS_ERR_NONE;
/* Ideal values of edge are 0 or 1 for now */
if ((pin_en < MAP_HAL_GPIO_NUMBER) && (callback_pfn != NULL))
{
#ifdef DEBUG_ISSUE_EXTI_GPIO
/* The check is always false. The configuration of interruption is not set in the GPIO settings, but in EXTI setttings.
* This part of code need to be update to correct this feature (check the pin wanted is in interruption mode).
* mbarth
*/
GPIO_TypeDef* targetPort_pst = NULL;
uint32 moder_u32 = HAL_GPIO_GET_INTERRUPT_INPUT_MODE(targetPort_pst, pin_en);
if ((moder_u32 == GPIO_MODE_IT_RISING) || (moder_u32 == GPIO_MODE_IT_FALLING) || (moder_u32 == GPIO_MODE_IT_RISING_FALLING))
#endif
{
halGpioCallbacks[pin_en] = callback_pfn;
}
}
else
{
error_u32 = NMS_ERR_UNEXPECTED;
}
return error_u32;
}
/******************************************************************************
* Static Function Definitions
******************************************************************************/
/******************************************************************************
* Callback Function Definitions
******************************************************************************/
/**
* @brief CubeMX GPIO callback
*
* @param[in] GPIO_Pin The GPIO pin on which the interrupt occurs
*
*/
void HAL_GPIO_EXTI_Rising_Callback( uint16 GPIO_Pin )
{
uint32 error_u32 = NMS_ERR_NONE;
MapHalGpioPin_en mappedPin_en;
error_u32 = MapHalGpioCallback(GPIO_Pin, &mappedPin_en);
if ((error_u32 == NMS_ERR_NONE) && (halGpioCallbacks[mappedPin_en] != NULL))
{
halGpioCallbacks[mappedPin_en](HAL_GPIO_EDGE_RISING);
}
}
/**
* @brief CubeMX GPIO falling callback
*
* @param[in] GPIO_Pin The GPIO pin on which the interrupt occurs
*
*/
void HAL_GPIO_EXTI_Falling_Callback( uint16 GPIO_Pin )
{
uint32 error_u32 = NMS_ERR_DEFAULT;
MapHalGpioPin_en mappedPin_en;
error_u32 = MapHalGpioCallback(GPIO_Pin, &mappedPin_en);
if ((error_u32 == NMS_ERR_NONE) && (halGpioCallbacks[mappedPin_en] != NULL))
{
halGpioCallbacks[mappedPin_en](HAL_GPIO_EDGE_FALLING);
}
}
/**
* @brief CubeMX GPIO callback
*
* @param[in] GPIO_Pin The GPIO pin on which the interrupt occurs
*
*/
void HAL_GPIO_EXTI_Callback( uint16 GPIO_Pin )
{
uint32 error_u32 = NMS_ERR_DEFAULT;
MapHalGpioPin_en mappedPin_en;
error_u32 = MapHalGpioCallback(GPIO_Pin, &mappedPin_en);
if ((error_u32 == NMS_ERR_NONE) && (halGpioCallbacks[mappedPin_en] != NULL))
{
halGpioCallbacks[mappedPin_en](HAL_GPIO_EDGE_NONE); /* Default value set for now*/
}
}

View File

@ -0,0 +1,120 @@
/**
* @file hal_gpio.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief HAL layer for the GPIO module.
*
*/
#ifndef HAL_TIMER_H_
#define HAL_TIMER_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
#include "map_hal.h"
/******************************************************************************
* Type declarations
******************************************************************************/
typedef enum
{
HAL_GPIO_STATE_UNKNOWN = 0U,
HAL_GPIO_STATE_LOW,
HAL_GPIO_STATE_HIGH,
} HalGpioState_en; /**< Enumeration used to analyze the gpio state. */
typedef enum {
HAL_GPIO_EDGE_NONE = 0U,
HAL_GPIO_EDGE_RISING,
HAL_GPIO_EDGE_FALLING,
HAL_GPIO_EDGE_RISING_AND_FALLING
} HalGpioEdgeType_en; /**< Enumeration used to analyze the edge of interrupt. */
typedef enum
{
HAL_GPIO_INPUT = 0U,
HAL_GPIO_OUTPUT_PUSH_PULL_UP,
HAL_GPIO_OUTPUT_PUSH_PULL_DOWN,
HAL_GPIO_OUTPUT_PUSH_PULL_FREE,
HAL_GPIO_OUTPUT_OPEN_DRAIN_UP,
HAL_GPIO_OUTPUT_OPEN_DRAIN_FREE,
HAL_GPIO_ISR_RISING,
HAL_GPIO_ISR_FALLING,
HAL_GPIO_ALTERNATE
} HalGpioType_en; /**< Enumeration used to analyze the gpio function type. */
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
/**
* @brief Initializes and configures GPIO input/output pins.
*
* @note Output pins are set to predefined states during initialization.
*
* @return Pin state: HIGH, LOW, or UNKNOWN.
*/
uint32 HalGpioInit(void);
/**
* @brief Reads the state of a GPIO input pin.
*
* @param pin_en GPIO pin selection.
* state_pen Pointer to store the read pin state.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalGpioRead(MapHalGpioPin_en pin_en, HalGpioState_en *state_pen);
/**
* @brief Sets the state of a GPIO output pin.
*
* @param pin_en GPIO pin selection.
* state_pen Desired GPIO pin state.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalGpioWrite(MapHalGpioPin_en pin_en, HalGpioState_en state_pen);
/**
* @brief Toggles the state of a GPIO pin.
*
* @param pin_en GPIO pin selection.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalGpioToggle(MapHalGpioPin_en pin_en);
/**
* @brief Reconfigures the properties of a GPIO pin.
*
* @param pin_en GPIO pin selection.
* type_en GPIO pin type.
*
* @return Error code: 0 if successful, nonzero otherwise.
*
* @warning GPIO speed modification is not supported in this driver version.
* Future updates may include support for this feature.
*/
uint32 HalGpioReConfigure(MapHalGpioPin_en pin_en, HalGpioType_en type_en);
/**
* @brief Assigns a callback function for GPIO interrupt events.
*
* @param pin_en GPIO pin selection.
* callback_pfn Pointer to the callback function.
* edge_en Interrupt trigger edge:
* - 1 for Rising Edge
* - 0 for Falling Edge (Consider using an enum for clarity).
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalGpioSetCallback(MapHalGpioPin_en pin_en, uint32 (*callback_pfn)(HalGpioEdgeType_en edge_en));
#endif /* HAL_GPIO_H_ */

View File

@ -0,0 +1,97 @@
/******************************************************************************
* @file hal_i2c.c
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief STM HAL layer wrapper class for I2C.
*
******************************************************************************/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "hal_i2c.h"
/* CubeMX */
#include "i2c.h"
/******************************************************************************
* Function Definitions
******************************************************************************/
uint32 HalI2CInit(void)
{
return NMS_ERR_NONE;
}
uint32 HalI2CWrite(MapHalI2cModule_en module_en, uint16 devAddr_u16, uint16 memAddr_u16, uint16 memAddrSize_u16, uint8 *pData_pu8, uint16 size_u16)
{
uint32 error_u32 = NMS_ERR_NONE;
HAL_StatusTypeDef halStatus_en = HAL_OK;
I2C_HandleTypeDef *targetModule_pst;
error_u32 = MapHalI2cModule(module_en, &targetModule_pst);
if (error_u32 == NMS_ERR_NONE)
{
halStatus_en = HAL_I2C_Mem_Write(targetModule_pst, devAddr_u16, memAddr_u16, memAddrSize_u16, pData_pu8, size_u16, HAL_MAX_DELAY);
switch (halStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_INTERNAL; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalI2CRead(MapHalI2cModule_en module_en, uint16 devAddr_u16, uint16 memAddr_u16, uint16 memAddrSize_u16, uint8 *pData_pu8, uint16 size_u16)
{
uint32 error_u32 = NMS_ERR_NONE;
HAL_StatusTypeDef halStatus_en = HAL_OK;
I2C_HandleTypeDef *targetModule_pst;
error_u32 = MapHalI2cModule(module_en, &targetModule_pst);
if (error_u32 == NMS_ERR_NONE)
{
halStatus_en = HAL_I2C_Mem_Read(targetModule_pst, devAddr_u16, memAddr_u16, memAddrSize_u16, pData_pu8, size_u16, HAL_MAX_DELAY);
switch (halStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_INTERNAL; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalI2CMasterTransmit(MapHalI2cModule_en module_en, uint16 devAddr_u16, uint8 *pData_pu8, uint16 size_u16)
{
uint32 error_u32 = NMS_ERR_NONE;
HAL_StatusTypeDef halStatus_en = HAL_OK;
I2C_HandleTypeDef *targetModule_pst;
error_u32 = MapHalI2cModule(module_en, &targetModule_pst);
if (error_u32 == NMS_ERR_NONE)
{
halStatus_en = HAL_I2C_Master_Transmit(targetModule_pst, devAddr_u16, pData_pu8, size_u16, HAL_MAX_DELAY);
switch (halStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_INTERNAL; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}

View File

@ -0,0 +1,77 @@
/******************************************************************************
* @file hal_i2c.h
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief STM HAL layer wrapper class for I2C.
*
******************************************************************************/
#ifndef HAL_I2C_H
#define HAL_I2C_H
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "map_hal.h"
#include "nms_types.h"
#include "stdint.h"
#include "i2c.h"
/******************************************************************************
* Function Prototypes
******************************************************************************/
/**
* @brief Initializes the I2C hardware interface.
* This function configures the necessary resources and sets up the
* I2C hardware to prepare it for use.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalI2CInit(void);
/**
* @brief Reads data from a specific memory address on an I2C device.
* This function sends a memory read request to the I2C device and
* stores the received data in a provided buffer.
*
* @param module_en The I2C module to be used (depends on the system configuration).
* devAddr_u16 The 7-bit address of the I2C device.
* memAddr_u16 The memory address within the I2C device to read from.
* memAddrSize_u16 The size of the memory address (e.g., 8-bit, 16-bit).
* pData_pu8 Pointer to the buffer where the read data will be stored.
* size_u16 Number of bytes to read.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalI2CRead(MapHalI2cModule_en module_en, uint16 devAddr_u16, uint16 memAddr_u16, uint16 memAddrSize_u16, uint8 *pData_pu8, uint16 size_u16);
/**
* @brief Writes data to a specific memory address on an I2C device.
* This function sends a memory write request to the I2C device to
* write data from the provided buffer to the device's memory.
*
* @param module_en The I2C module to be used (depends on the system configuration).
* devAddr_u16 The 7-bit address of the I2C device.
* memAddr_u16 The memory address within the I2C device to read from.
* memAddrSize_u16 The size of the memory address (e.g., 8-bit, 16-bit).
* pData_pu8 Pointer to the buffer where the read data will be stored.
* size_u16 Number of bytes to write.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalI2CWrite(MapHalI2cModule_en module_en, uint16 devAddr_u16, uint16 memAddr_u16, uint16 memAddrSize_u16, uint8 *pData_pu8, uint16 size_u16);
/**
* @brief Transmits in master mode an amount of data in blocking mode.
*
* @param module_en The I2C module to be used (depends on the system configuration).
* devAddr_u16 The 7-bit address of the I2C device.
* pData_pu8 Pointer to the buffer where the read data will be stored.
* size_u16 Number of bytes to write.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalI2CMasterTransmit(MapHalI2cModule_en module_en, uint16 devAddr_u16, uint8 *pData_pu8, uint16 size_u16);
#endif /* HAL_I2C_H */

View File

@ -21,6 +21,7 @@
* Include Header Files
******************************************************************************/
#include "hal_system.h"
#include "string.h"
/* cubeMX */
#include "main.h"
@ -143,7 +144,7 @@ uint32 HalSystemGetResetCause( HalSystemResetCauseEn resetCauseSelector_en, uint
if (causes_pu32 == NULL)
{
error_u32 = NMS_ERR_NULL_POINTER;
error_u32 = NMS_ERR_INVALID_POINTER;
}
else
{

View File

@ -0,0 +1,548 @@
/**
* @file hal_timer.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief HAL layer for the TIMER module.
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "map_hal.h"
#include "hal_timer.h"
/* CubeMX */
#include "tim.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
#define HAL_TIMER_SEC_TO_MSEC 1000000uLL /**< Number of microseconds within a second */
/******************************************************************************
* Type declarations
******************************************************************************/
typedef struct
{
uint64 timerPeriod_u64;
uint64 downCounter_u64;
} HalTimerInstance_tst;
/******************************************************************************
* Module Global Variable Declarations
******************************************************************************/
static HalTimerInstance_tst instance_gast[MAP_HAL_TIMER_NUMBER] = {0};
static void (*halTimerCallbacks[MAP_HAL_TIMER_NUMBER])(void);
/******************************************************************************
* Static Function Declarations
******************************************************************************/
static uint32 HalTimerComputeTimerPeriod(MapHalTimerModule_en timerModule_en, uint64 * timerPeriod_u64);
/******************************************************************************
* Extern Function Definition
******************************************************************************/
uint32 HalTimerInit(void)
{
uint32 error_u32 = NMS_ERR_NONE;
for(uint8 i_u8 = 0u; i_u8 < MAP_HAL_TIMER_NUMBER; i_u8++)
{
uint64 timerPeriod_u64 = 0uLL;
error_u32 = HalTimerComputeTimerPeriod((MapHalTimerModule_en)(i_u8), &timerPeriod_u64);
if (error_u32 == NMS_ERR_NONE)
{
instance_gast[i_u8].timerPeriod_u64 = timerPeriod_u64;
instance_gast[i_u8].downCounter_u64 = 0uLL;
}
}
return error_u32;
}
uint32_t HalTimerGetCounter(MapHalTimerModule_en timerModule_en)
{
TIM_HandleTypeDef *targetModule_pst = NULL;
/* Get the timer handle using MapHalTimerModule */
if (MapHalTimerModule(timerModule_en, &targetModule_pst) != NMS_ERR_NONE || targetModule_pst == NULL)
{
return 0;
}
return (uint32)(targetModule_pst->Instance->CNT);
}
void HalTimerSetCounter(MapHalTimerModule_en timerModule_en, uint32 counter_u32)
{
TIM_HandleTypeDef *targetModule_pst = NULL;
if (MapHalTimerModule(timerModule_en, &targetModule_pst) != NMS_ERR_NONE || targetModule_pst == NULL)
{
return;
}
targetModule_pst->Instance->CNT = counter_u32;
}
void HalTimerSetCompare(MapHalTimerModule_en timerModule_en, uint32 channel_u32, uint32 compareValue_32)
{
TIM_HandleTypeDef *targetModule_pst = NULL;
if (MapHalTimerModule(timerModule_en, &targetModule_pst) != NMS_ERR_NONE || targetModule_pst == NULL)
{
/* Handle the error (e.g., log it or return early) */
return;
}
switch (channel_u32)
{
case TIM_CHANNEL_1:
targetModule_pst->Instance->CCR1 = compareValue_32; break;
case TIM_CHANNEL_2:
targetModule_pst->Instance->CCR2 = compareValue_32; break;
case TIM_CHANNEL_3:
targetModule_pst->Instance->CCR3 = compareValue_32; break;
case TIM_CHANNEL_4:
targetModule_pst->Instance->CCR4 = compareValue_32; break;
#ifdef TIM_CHANNEL_5
case TIM_CHANNEL_5:
targetModule_pst->Instance->CCR5 = compareValue_32; break;
#endif
#ifdef TIM_CHANNEL_6
case TIM_CHANNEL_6:
targetModule_pst->Instance->CCR6 = compareValue_32; break;
#endif
default:
/* Invalid channel case (log or handle the error) */
break;
}
}
uint32 HalTimerGetAutoReload(MapHalTimerModule_en timerModule_en)
{
TIM_HandleTypeDef *targetModule_pst = NULL;
if (MapHalTimerModule(timerModule_en, &targetModule_pst) != NMS_ERR_NONE || targetModule_pst == NULL)
{
/* Error */
}
return (uint32)(targetModule_pst->Instance->ARR);
}
uint32 HalTimerEncoderStart(MapHalTimerModule_en timerModule_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
HAL_StatusTypeDef halTimerStatus_en = NMS_ERR_NONE;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
/* Start the requested timer */
halTimerStatus_en = HAL_TIM_Encoder_Start(targetModule_pst, TIM_CHANNEL_ALL);
switch(halTimerStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_UNKNOWN; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalTimerEncoderStop(MapHalTimerModule_en timerModule_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
HAL_StatusTypeDef halTimerStatus_en = NMS_ERR_NONE;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
/* Start the requested timer */
halTimerStatus_en = HAL_TIM_Encoder_Stop(targetModule_pst, TIM_CHANNEL_ALL);
switch(halTimerStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_UNKNOWN; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalTimerPwmStart(MapHalTimerModule_en timerModule_en, uint32 Channel_u32)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
HAL_StatusTypeDef halTimerStatus_en = NMS_ERR_NONE;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
/* Start the requested timer */
halTimerStatus_en = HAL_TIM_PWM_Start(targetModule_pst, Channel_u32);
switch(halTimerStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_UNKNOWN; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalTimerPwmStop(MapHalTimerModule_en timerModule_en, uint32 Channel_u32)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
HAL_StatusTypeDef halTimerStatus_en = NMS_ERR_NONE;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
/* Stop the requested timer */
halTimerStatus_en = HAL_TIM_PWM_Stop(targetModule_pst, Channel_u32);
switch(halTimerStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_UNKNOWN; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalTimerStart(MapHalTimerModule_en timerModule_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
HAL_StatusTypeDef halTimerStatus_en = NMS_ERR_NONE;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
/* Start the requested timer */
halTimerStatus_en = HAL_TIM_Base_Start_IT(targetModule_pst);
switch(halTimerStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_UNKNOWN; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalTimerStop(MapHalTimerModule_en timerModule_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
HAL_StatusTypeDef halTimerStatus_en = NMS_ERR_NONE;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
/* Stop the requested timer */
halTimerStatus_en = HAL_TIM_Base_Stop_IT(targetModule_pst);
switch(halTimerStatus_en)
{
case HAL_BUSY: error_u32 = NMS_ERR_BUSY; break;
case HAL_TIMEOUT: error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_ERROR: error_u32 = NMS_ERR_UNKNOWN; break;
case HAL_OK: error_u32 = NMS_ERR_NONE; break;
default: error_u32 = NMS_ERR_UNKNOWN; break;
}
}
return error_u32;
}
uint32 HalTimerReloadUs(MapHalTimerModule_en timerModule_en, uint64 period_u64)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
if(period_u64 == 0uLL)
{
error_u32 = NMS_ERR_UNKNOWN;
}
else
{
/* Compute the number of step that we need to count */
instance_gast[timerModule_en].downCounter_u64 = period_u64 / instance_gast[timerModule_en].timerPeriod_u64;
if((instance_gast[timerModule_en].downCounter_u64 * instance_gast[timerModule_en].timerPeriod_u64) < period_u64)
{
instance_gast[timerModule_en].downCounter_u64++;
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
}
}
return error_u32;
}
uint32 HalTimerGetRemainingTimeUs(MapHalTimerModule_en timerModule_en, uint64 * remainingTime_pu64)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
/* Add the time corresponding to the number of interruption left for this timer */
*remainingTime_pu64 = instance_gast[timerModule_en].downCounter_u64;
*remainingTime_pu64 *= instance_gast[timerModule_en].timerPeriod_u64;
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
uint32 HalTimerConfigureCallback(MapHalTimerModule_en timerModule_en, void (*callback_pfn)(void))
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if (timerModule_en < MAP_HAL_TIMER_NUMBER )
{
halTimerCallbacks[timerModule_en] = callback_pfn;
error_u32 = NMS_ERR_NONE;
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
void HalTimerDeinit(MapHalTimerModule_en timerModule_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
TIM_HandleTypeDef * targetModule_pst;
uint8 index_u8;
uint8 startIndex_u8;
uint8 iteration_u8 = 1u; /* Default to 1 loop iteration (deinit one module) */
if(timerModule_en == MAP_HAL_TIMER_NUMBER)
{
iteration_u8 = timerModule_en;
startIndex_u8 = 0u;
}
else
{
iteration_u8 += timerModule_en;
startIndex_u8 = timerModule_en;
}
for(index_u8 = startIndex_u8; index_u8 < iteration_u8; index_u8++)
{
error_u32 = MapHalTimerModule((MapHalTimerModule_en)index_u8, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
HAL_TIM_Base_DeInit(targetModule_pst);
}
}
}
/******************************************************************************
* Static Function Definitions
******************************************************************************/
/**
* @brief Compute the timerPeriod of the requested timer
*
* @param timerModule_en The timer module to use
*
* @return The value of the timer period. If the timer module is invalid, the
* value returned will be 0.
*
* @note CAUTION : The part to compute the actual time frequency is target
* dependant, do not forget to update it to fit your needs.
* This affects the calculation of the timerPeriod and so
* can change the resolution that has been computed by the
* user in cubeMX
*/
static uint32 HalTimerComputeTimerPeriod(MapHalTimerModule_en timerModule_en, uint64 * timerPeriod_u64)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
uint32 timerFrequency_u32 = 0uL;
TIM_HandleTypeDef * targetModule_pst;
error_u32 = MapHalTimerModule(timerModule_en, &targetModule_pst);
if(error_u32 == NMS_ERR_NONE)
{
*timerPeriod_u64 = HAL_TIMER_SEC_TO_MSEC;
*timerPeriod_u64 *= (targetModule_pst->Instance->PSC + 1UL);
*timerPeriod_u64 *= (targetModule_pst->Instance->ARR + 1UL);
*timerPeriod_u64 /= timerFrequency_u32;
}
else
{
timerPeriod_u64 = 0uLL;
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
/******************************************************************************
* Callback Function Definitions
******************************************************************************/
/**
* @brief CubeMX timer period elapsed callback
*
* @param[in] htim pointer to a TIM_HandleTypeDef structure that contains
* the configuration information for the specified TIMER.
* @return Error code in case there is one during the process.
*/
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
MapHalTimerModule_en timerModule_en;
uint32 error_u32 = NMS_ERR_DEFAULT;
error_u32 = MapHalTimerCallback(&htim, &timerModule_en);
if (error_u32 == NMS_ERR_NONE)
{
/* Check if we reach the interrupt enough to reach the goal counter */
if(instance_gast[timerModule_en].downCounter_u64 == 0uLL)
{
if(halTimerCallbacks[timerModule_en] != NULL)
{
/* Call the user callback */
halTimerCallbacks[timerModule_en]();
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
}
else
{
instance_gast[timerModule_en].downCounter_u64--;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
}
/**
* @brief CubeMX timer error callback
*
* @param[in] htim pointer to a TIM_HandleTypeDef structure that contains
* the configuration information for the specified TIMER.
* @return Error code in case there is one during the process.
*/
void HAL_TIM_ErrorCallback(TIM_HandleTypeDef * htim)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
MapHalTimerModule_en timerModule_en;
error_u32 = MapHalTimerCallback(&htim, &timerModule_en);
if(error_u32 == NMS_ERR_NONE)
{
switch(htim->State)
{
case HAL_TIM_STATE_RESET:
error_u32 = NMS_ERR_NOT_INITIALIZED; break;
case HAL_TIM_STATE_BUSY:
error_u32 = NMS_ERR_BUSY;
break;
case HAL_TIM_STATE_TIMEOUT:
error_u32 = NMS_ERR_TIMEOUT; break;
case HAL_TIM_STATE_ERROR:
error_u32 = NMS_ERR_UNEXPECTED; break;
case HAL_TIM_STATE_READY:
error_u32 = NMS_ERR_NOT_RUNNING; break;
default:
error_u32 = NMS_ERR_UNKNOWN; break;
}
}
else
{
error_u32 = NMS_ERR_INVALID_ARGUMENT;
}
}

View File

@ -0,0 +1,171 @@
/**
* @file hal_timer.h
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief HAL layer for the TIMER module.
*
*/
#ifndef __HAL_TIMER_H_
#define __HAL_TIMER_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
#include "map_hal.h"
/******************************************************************************
* Type declarations
******************************************************************************/
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
/**
* @brief Initializes the HAL timer module.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerInit(void);
/**
* @brief Retrieves the current value of the TIM counter register.
*
* @param htim Pointer to the TIM handle containing the TIM instance.
*
* @return The 16-bit or 32-bit value of the timer counter register (TIMx_CNT).
*/
uint32 HalTimerGetCounter(MapHalTimerModule_en timerModule_en);
/**
* @brief Sets a specific value to the TIM counter register.
*
* @param htim Pointer to the TIM handle containing the TIM instance.
* @param counter_u32 Value to set in the TIM counter register.
*/
void HalTimerSetCounter(MapHalTimerModule_en timerModule_en, uint32 counter_u32);
/**
* @brief Set the compare value for a given timer channel.
*
* @param timerModule_en Timer module.
* channel Timer channel (e.g., TIM_CHANNEL_1, TIM_CHANNEL_2).
* compareValue Value to set in the compare register.
*
* @note This function abstracts the STM32 HAL macro __HAL_TIM_SET_COMPARE.
*/
void HalTimerSetCompare(MapHalTimerModule_en timerModule_en, uint32 channel_u32, uint32 compareValue_32);
/**
* @brief Get the Auto-Reload value of the specified timer module.
*
* @param timerModule_en Timer module selection from MapHalTimerModule_en.
*
* @return The auto-reload value of the selected timer module.
* Returns 0 if the timer module is invalid.
*/
uint32 HalTimerGetAutoReload(MapHalTimerModule_en timerModule_en);
/**
* @brief Starts the specified timer module in encoder mode.
*
* @param timerModule_en Timer module to be started in encoder mode.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerEncoderStart(MapHalTimerModule_en timerModule_en);
/**
* @brief Stops the specified timer module in encoder mode.
*
* @param timerModule_en Timer module to be stopped in encoder mode.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerEncoderStop(MapHalTimerModule_en timerModule_en);
/**
* @brief Stops the specified timer module in PWM mode.
*
* @param timerModule_en Timer module to be stopped in encoder mode.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerPwmStart(MapHalTimerModule_en timerModule_en, uint32 Channel_u32);
/**
* @brief Stops the specified timer module in PWM mode.
*
* @param timerModule_en Timer module to be stopped in encoder mode.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerPwmStop(MapHalTimerModule_en timerModule_en, uint32 Channel_u32);
/**
* @brief Starts the specified timer module.
*
* @param timerModule_en Timer module to be started.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerStart(MapHalTimerModule_en timerModule_en);
/**
* @brief Stops the specified timer module.
*
* @param timerModule_en Timer module to be stopped.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerStop(MapHalTimerModule_en timerModule_en);
/**
* @brief Updates the timer's prescaler and counter value based on the given period.
*
* @param timerModule_en Timer module to configure.
* @param period_u64 Timer refresh period in microseconds.
* The value is rounded up to the nearest resolution divider.
*
* @note The period cannot be 0, as it would imply an immediate event.
* Instead, execute the event directly or call the stop function manually.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerReloadUs(MapHalTimerModule_en timerModule_en, uint64 period_u64);
/**
* @brief Retrieves the remaining time for the specified timer in microseconds.
*
* @param timerModule_en Timer module to query.
* @param remainingTime_u64 Pointer to store the remaining time in microseconds.
* The value is rounded up to the nearest resolution divider.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerGetRemainingTimeUs(MapHalTimerModule_en timerModule_en, uint64 *remainingTime_u64);
/**
* @brief Configures a callback function for the specified timer module.
*
* @param timerModule_en Timer module for which the callback is being set.
* @param callback_pfn Pointer to the callback function.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 HalTimerConfigureCallback(MapHalTimerModule_en timerModule_en, void (*callback_pfn)(void));
/**
* @brief Deinitializes the specified timer module, stopping all active timers.
* This is useful for transitioning between application and bootloader.
*
* @param timerModule_en Timer module to be deinitialized.
*/
void HalTimerDeinit(MapHalTimerModule_en timerModule_en);
#endif /* __HAL_TIMER_H_ */

View File

@ -0,0 +1,218 @@
/**
* @file map_hal.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief Mapping of the hardware interfaces.
*
*/
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
#include "map_hal.h"
#include "stm32g4xx_hal_tim.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
extern TIM_HandleTypeDef htim7;
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
uint32 MapHalGpio( MapHalGpioPin_en pin_en, uint16* targetPin_pu16, GPIO_TypeDef** targetPort_ppst)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if(targetPin_pu16 == NULL || targetPort_ppst == NULL)
{
error_u32 = NMS_ERR_UNKNOWN;
}
else
{
switch (pin_en)
{
case MAP_HAL_PMP_ENABLE:
*targetPin_pu16 = GPIO_PIN_15;
*targetPort_ppst = GPIOB;
error_u32 = NMS_ERR_NONE;
break;
default:
error_u32 = NMS_ERR_UNKNOWN;
break;
}
}
return error_u32;
}
uint32 MapHalGpioCallback(uint16 targetPin_u16, MapHalGpioPin_en * pin_pen)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
switch (targetPin_u16)
{
case GPIO_PIN_15:
*pin_pen = MAP_HAL_PMP_ENABLE;
error_u32 = NMS_ERR_NONE;
break;
default:
error_u32 = NMS_ERR_UNKNOWN;
break;
}
return error_u32;
}
uint32 MapHalTimerModule(MapHalTimerModule_en timer_en, TIM_HandleTypeDef ** targetModule_ppst)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if(targetModule_ppst != NULL)
{
switch(timer_en)
{
case MAP_HAL_TIMER_RTOS:
*targetModule_ppst = &htim17;
error_u32 = NMS_ERR_NONE;
break;
case MAP_HAL_TIMER_FILTER:
*targetModule_ppst = &htim6;
error_u32 = NMS_ERR_NONE;
break;
default:
error_u32 = NMS_ERR_UNKNOWN;
break;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
uint32 MapHalTimerCallback(TIM_HandleTypeDef ** targetModule_ppst, MapHalTimerModule_en * timer_pen)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if(*targetModule_ppst != NULL)
{
if (*targetModule_ppst == &htim17)
{
*timer_pen = MAP_HAL_TIMER_RTOS;
error_u32 = NMS_ERR_NONE;
}
else if (*targetModule_ppst == &htim6)
{
*timer_pen = MAP_HAL_TIMER_FILTER;
error_u32 = NMS_ERR_NONE;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
uint32 MapHalAdcModule(MapHalAdcModule_en adc_en, ADC_HandleTypeDef ** targetModule_ppst)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if(targetModule_ppst != NULL)
{
switch(adc_en)
{
case MAP_HAL_ADC_1:
*targetModule_ppst = &hadc1;
error_u32 = NMS_ERR_NONE;
break;
default:
error_u32 = NMS_ERR_UNKNOWN;
break;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
extern uint32 MapHalAdcCallback(ADC_HandleTypeDef *targetModule_pst, MapHalAdcModule_en *adcModule_en)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if (targetModule_pst != NULL)
{
if (targetModule_pst == &hadc1)
{
*adcModule_en = MAP_HAL_ADC_1;
error_u32 = NMS_ERR_NONE;
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}
uint32 MapHalI2cModule(MapHalI2cModule_en module_en, I2C_HandleTypeDef ** targetModule_ppst)
{
uint32 error_u32 = NMS_ERR_DEFAULT;
if(targetModule_ppst != NULL)
{
switch(module_en)
{
case MAP_HAL_GRUNDFOS_PMP_I2C_HANDLE:
*targetModule_ppst = &hi2c4;
error_u32 = NMS_ERR_NONE;
break;
default:
error_u32 = NMS_ERR_UNKNOWN;
break;
}
}
else
{
error_u32 = NMS_ERR_UNKNOWN;
}
return error_u32;
}

View File

@ -0,0 +1,137 @@
/**
* @file map_hal.c
*
* @copyright Nehemis SARL reserves all rights even in the event of industrial
* property rights. We reserve all rights of disposal such as
* copying and passing on to third parties.
*
* @brief Mapping of the hardware interfaces.
*
*/
#ifndef MAP_HAL_H_
#define MAP_HAL_H_
/******************************************************************************
* Include Header Files
******************************************************************************/
#include "nms_types.h"
/* CubeMX */
#include "gpio.h"
#include "tim.h"
#include "adc.h"
#include "fdcan.h"
#include "i2c.h"
/******************************************************************************
* Global define
******************************************************************************/
#define MOTOR_PWM_CHANNEL TIM_CHANNEL_1
/******************************************************************************
* Type declarations
******************************************************************************/
typedef enum
{
MAP_HAL_PMP_ENABLE,
MAP_HAL_GPIO_NUMBER
} MapHalGpioPin_en;
typedef enum
{
MAP_HAL_TIMER_RTOS,
MAP_HAL_TIMER_FILTER,
MAP_HAL_TIMER_NUMBER
} MapHalTimerModule_en;
typedef enum
{
MAP_HAL_ADC_1,
MAP_HAL_ADC_NUMBER
}MapHalAdcModule_en;
typedef enum
{
MAP_HAL_GRUNDFOS_PMP_I2C_HANDLE,
MAP_HAL_I2C_NUMBER
}MapHalI2cModule_en;
/******************************************************************************
* Extern Function Declarations
******************************************************************************/
/**
* @brief Maps a HAL GPIO pin to the corresponding STM32 port and pin.
*
* @param pin_en HAL GPIO pin to be mapped.
* @param targetPort_ppst Pointer to the corresponding STM32 port.
* @param targetPin_pu16 Pointer to the corresponding STM32 pin.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 MapHalGpio(MapHalGpioPin_en pin_en, uint16* targetPin_pu16, GPIO_TypeDef** targetPort_ppst);
/**
* @brief Maps a specific pin callback to the corresponding STM32 pin.
*
* @param targetPin_u16 STM32 pin.
* @param pin_pen Pointer to the enumerator representing the HAL pin.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 MapHalGpioCallback(uint16 targetPin_u16, MapHalGpioPin_en* pin_pen);
/**
* @brief Maps a HAL timer module to its corresponding STM32 timer module.
*
* @param[in] halModule_en HAL timer module (e.g., HAL_TIMER_1).
* @param[out] targetModule_ppst Pointer to the corresponding STM32 timer module (e.g., htim1).
*
* @return Error code:
* - HAL_TIM_LOG_LOCATION_4_ERROR_INVALID_ARGUMENT if the mapping fails.
* - LOG_ERROR_NONE if successful.
*/
uint32 MapHalTimerModule(MapHalTimerModule_en timer_en, TIM_HandleTypeDef** targetModule_ppst);
/**
* @brief Retrieves the HAL timer module associated with a given STM32 timer module.
*
* @param[in] targetModule_ppst Pointer to the STM32 timer module (e.g., htim1).
* @param[out] timerModule_pen Pointer to store the corresponding HAL module (e.g., HAL_TIMER_1).
*
* @return Error code:
* - HAL_TIM_LOG_LOCATION_4_ERROR_INVALID_ARGUMENT if the mapping fails.
* - LOG_ERROR_NONE if successful.
*/
uint32 MapHalTimerCallback(TIM_HandleTypeDef** targetModule_ppst, MapHalTimerModule_en* timer_pen);
/**
* @brief Maps a HAL ADC pin to the corresponding STM32 port and pin.
*
* @param pin_en HAL GPIO pin to be mapped.
* @param targetModule_ppst Pointer to the corresponding STM32 ADC module.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 MapHalAdcModule(MapHalAdcModule_en pin_en, ADC_HandleTypeDef** targetModule_ppst);
/**
* @brief Maps a specific pin callback to the corresponding STM32 pin.
*
* @param targetModule_pst STM32 pin.
* @param adcModule_en Pointer to the enumerator representing the HAL pin.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 MapHalAdcCallback(ADC_HandleTypeDef *targetModule_pst, MapHalAdcModule_en *adcModule_en);
/**
* @brief Maps a HAL I2C pin to the corresponding STM32 port and pin.
*
* @param pin_en HAL GPIO pin to be mapped.
* @param targetModule_ppst Pointer to the corresponding STM32 ADC module.
*
* @return Error code: 0 if successful, nonzero otherwise.
*/
uint32 MapHalI2cModule(MapHalI2cModule_en module_en, I2C_HandleTypeDef ** targetModule_ppst);
#endif /* MAP_HAL_H_ */

View File

@ -9,6 +9,9 @@
* the Valve Controller and CANopen stack. It defines the main
* scheduler loop for running these components within the firmware.
*
* @todo SDL_MIN_OPERATIONAL_NODES to be changed to 20, are the node is fixed.
* (electronic issue in the board)
*
*/
/******************************************************************************
@ -24,609 +27,131 @@
/* User includes */
#include "sdl.h"
#include "processBoard.h"
#include "enduranceTestBench.h"
#include "hal_system.h"
#include "nms_can.h"
#include "hal_timer.h"
#include "stdlib.h"
#include "filter.h"
#include "pressureController.h"
/******************************************************************************
* Macro constant declarations
******************************************************************************/
#define SDL_CANOPEN_BITRATE 250u
#define SDL_PU_MASTER_NODE_ID 1u
#define SDL_LSS_TIMEOUT 20u /* Defined in stack examples */
#define SDL_LSS_CONFIG_TIMEOUT 1000u
#define SDL_LSS_CONFIG_INTERVAL 4u
#define SDL_APPL_TIMER_TIME 250000uL
#define SDL_LSS_NODE_COUNT 20u
#define SDL_LSS_NODE_HB_MS 1000uL
#define SDL_LSS_NODE_STATE_RESET_INTERVAL 3u
#define SDL_TEST_BENCH_SDO_TIMEOUT 1000u
#define SDL_TEST_BENCH_STARTUP_TIMEOUT 10000uLL
#define SDL_POSITION_SETPOINT_INDEX 0x6002
#define SDL_POSITION_SETPOINT_SUB_INDEX 0x0
#define SDL_POSITION_FEEDBACK_INDEX 0x6004
#define SDL_POSITION_FEEDBACK_SUB_INDEX 0x0
#define SDL_SDO_CLIENT_COB 0x1280
#define SDL_SDO_CLIENT_TO_SERVER_COB 0x600
#define SDL_SDO_SERVER_TO_CLIENT_COB 0x580
/******************************************************************************
* Type Declarations
******************************************************************************/
typedef struct
static void SdlFilterInterrupt(void);
static inline float32 RevModelConvertToPercent(float32 value_f32, float32 minVal_f32, float32 maxVal_f32)
{
uint32 vendorId_u32;
uint32 productId_u32;
uint32 versionNbr_u32;
uint32 serialNbr_u32;
uint8 nodeId_u8;
} SdlLssNodeInfo_t;
float32 clamped = value_f32;
if (clamped < minVal_f32)
{
clamped = minVal_f32;
}
else if (clamped > maxVal_f32)
{
clamped = maxVal_f32;
}
return 100.0f * (clamped - minVal_f32) / (maxVal_f32 - minVal_f32);
}
/******************************************************************************
* Global Declarations
******************************************************************************/
SdlLssNodeInfo_t var_gst;
static CO_TIMER_T monitorTimer_gst; /**< application timer */
static CO_TIMER_T nodeResetTimer_gst; /**< node reset timer */
static bool monitorSleep_gb = CO_FALSE; /**< sleep flag */
static bool masterStarted_gb; /**< master started flag */
static const SdlLssNodeInfo_t nodeLookupTable_gast[SDL_LSS_NODE_COUNT] =
{
{0x319, 0x4d2, 0x1, 0x01, 0x5} ,
{0x319, 0x4d2, 0x1, 0x02, 0x6} ,
{0x319, 0x4d2, 0x1, 0x03, 0x7} ,
{0x319, 0x4d2, 0x1, 0x04, 0x8} ,
{0x319, 0x4d2, 0x1, 0x05, 0x9} ,
{0x319, 0x4d2, 0x1, 0x06, 0xA} ,
{0x319, 0x4d2, 0x1, 0x07, 0xB} ,
{0x319, 0x4d2, 0x1, 0x08, 0xC} ,
{0x319, 0x4d2, 0x1, 0x09, 0xD} ,
{0x319, 0x4d2, 0x1, 0x0A, 0xE} ,
{0x319, 0x4d2, 0x1, 0x0B, 0xF} ,
{0x319, 0x4d2, 0x1, 0x0C, 0x10},
{0x319, 0x4d2, 0x1, 0x0D, 0x11},
{0x319, 0x4d2, 0x1, 0x0E, 0x12},
{0x319, 0x4d2, 0x1, 0x0F, 0x13},
{0x319, 0x4d2, 0x1, 0x10, 0x14},
{0x319, 0x4d2, 0x1, 0x11, 0x15},
{0x319, 0x4d2, 0x1, 0x12, 0x16},
{0x319, 0x4d2, 0x1, 0x13, 0x17},
{0x319, 0x4d2, 0x1, 0x14, 0x18}
};
static CO_NMT_STATE_T nodeNMTState_gaen[SDL_LSS_NODE_COUNT];
/******************************************************************************
* Static function Declarations
******************************************************************************/
static void SdlInitCanopen(void);
static void SdlRunCanopen(void);
static RET_T SdlOverwriteLoadIndication(uint8 index_u8);
static void SdlLssIndCallback(CO_LSS_MASTER_SERVICE_T service_en, uint16 errorCode_u16, uint8 errorSpec_u8, uint32 *pIdentity_pu32);
static void SdlLssHbMonitorCallback(uint8 nodeID_u8, CO_ERRCTRL_T state_en, CO_NMT_STATE_T nmtState_en);
static void SdlLssResetNodesCallback(void *pData_pv); /**< callback of reset handler */
static uint8 SdlLssGetNodeIndex(uint8 nodeId_u8);
static void SdlLssToggleMonitorFlag(void *pData);
static void SdlLssNodeHandlerRun(void);
static uint32 SdlLssConfigureNode(uint8 arrIndex_u8);
static RET_T SdlLssSetSdoCobID(uint8 sdoNr_u8, uint8 nodeId_u8);
/* Supress warnings for implicit declaration.
* Need this function for overwriting the manual COB ids
* for the TPDO. */
extern void userOverwriteCobIdSettings(void);
static bool SdlAreAllNodesOperational(void);
static void SdlEnduranceTestBenchRun(void);
static bool testBenchStarted_b;
static PuControllersPidInput_st pmpRoPressurePidInput_st = {0};
static PuFiltersSensorData_st receivedFilterData_st;
/******************************************************************************
* Public Function Definitions
******************************************************************************/
void SdlInit(void)
{
SdlInitCanopen();
testBenchStarted_b = false;
HalTimerStart(MAP_HAL_TIMER_FILTER);
NmsCanInit();
PuFiltersInit();
ProcessBoardInit();
HalTimerConfigureCallback(MAP_HAL_TIMER_FILTER, SdlFilterInterrupt);
PuControllersInitInputs(&pmpRoPressurePidInput_st);
}
void SdlRun(void)
{
SdlRunCanopen();
SdlLssNodeHandlerRun();
if (SdlAreAllNodesOperational())
{
SdlEnduranceTestBenchRun();
}
}
static uint64 lastPressureUpdateMs_u64 = 0uLL;
uint64 currentTimeMs_u64;
static uint8 pressureSetpoint_u8 = 0u;
uint8 turnOnTestbench = 0u;
NmsCanGetObj_u8(0x2007, 0x0, &turnOnTestbench);
NmsCanRun();
/******************************************************************************
* Private Function Declarations
******************************************************************************/
/**
* @brief Init the CANopen stack.
*
*/
static void SdlInitCanopen(void)
{
RET_T retval;
HalSystemInit();
codrvHardwareInit();
retval = codrvCanInit(SDL_CANOPEN_BITRATE);
retval = codrvTimerSetup(CO_TIMER_INTERVAL);
// if (turnOnTestbench == 1)
// {
// if (NmsCanAreAllNodesOperational())
// {
EnduranceTestBenchRun(&testBenchStarted_b);
/* CANopen Initialization */
retval = coCanOpenStackInit(SdlOverwriteLoadIndication);
retval = coEventRegister_LSS_MASTER(SdlLssIndCallback);
retval = coEventRegister_ERRCTRL(SdlLssHbMonitorCallback);
/* enable CAN communication */
retval = codrvCanEnable();
retval = coTimerStart(&monitorTimer_gst, SDL_APPL_TIMER_TIME, SdlLssToggleMonitorFlag, NULL, CO_TIMER_ATTR_ROUNDUP_CYCLIC);
retval = coTimerStart(&nodeResetTimer_gst, (SDL_LSS_NODE_STATE_RESET_INTERVAL * 1000000uLL), SdlLssResetNodesCallback, NULL, CO_TIMER_ATTR_ROUNDUP_CYCLIC);
retval = coNmtStateReq(SDL_PU_MASTER_NODE_ID, CO_NMT_STATE_OPERATIONAL, CO_TRUE);
coLssIdentifyNonConfiguredSlaves(SDL_LSS_CONFIG_TIMEOUT, SDL_LSS_CONFIG_INTERVAL);
}
/**
* @brief Runs the CANopen stack.
*
*/
static void SdlRunCanopen(void)
{
coCommTask();
SdlLssNodeHandlerRun();
}
/******************************************************************************
* Private Function Definitions
******************************************************************************/
/**
* @brief Handler for the defined nodes in the network.
* This function starts the configuration of a node if needed
*
* @return void
*
*/
static void SdlLssNodeHandlerRun(void)
{
if (monitorSleep_gb != CO_TRUE)
{
for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++)
{
if (nodeNMTState_gaen[i_u8] == CO_NMT_STATE_PREOP)
if (testBenchStarted_b)
{
SdlLssConfigureNode(i_u8);
}
if (nodeNMTState_gaen[i_u8] == CO_NMT_STATE_OPERATIONAL)
{
/* Do nothing */
}
}
}
monitorSleep_gb = CO_TRUE;
}
ProcessBoardRun(true);
HalSystemGetRunTimeMs(&currentTimeMs_u64);
/**
* @brief Load function for overwriing the TPDO COB id values.
*
* @param index_u8 Subindex parameter to point parameter area(unused)
*
* @return Error Code
*/
static RET_T SdlOverwriteLoadIndication(uint8 index_u8)
{
userOverwriteCobIdSettings();
return RET_OK;
}
/**
* @brief This function is called if a new NMT state of a node,
* is recordnized by the CANopen stack.
*
* @param nodeID_u8 Node id of the node that has registered a change.
* state_en Error control state
* nmtState_en NMT state of the particular node.
*
* @return Array index of the node in the network.
*
*/
static uint8 SdlLssGetNodeIndex(uint8 nodeId_u8)
{
uint8 arrIndex_u8;
/* find node ID array arrIndex_u8 */
for (arrIndex_u8 = 0u; arrIndex_u8 < SDL_LSS_NODE_COUNT; arrIndex_u8++)
{
if (nodeId_u8 == nodeLookupTable_gast[arrIndex_u8].nodeId_u8)
{
return arrIndex_u8;
}
}
return NMS_UINT8_MAX;
}
/**
* @brief This function is called if a new NMT state of a node,
* is recordnized by the CANopen stack.
*
* @param nodeID_u8 Node id of the node that has registered a change.
* state_en Error control state
* nmtState_en NMT state of the particular node.
*
* @return Array index of the node in the network.
*
*/
static void SdlLssToggleMonitorFlag(void *pData)
{
(void)pData;
/* deactivate application sleep flag */
monitorSleep_gb = CO_FALSE;
}
/**
* @brief Configure a specific node.
* This function adds the defined node to heartbeat consumers,
* and sets its heartbeat interval.
*
* @param arrIndex_u8 Index of the node in the array which is to be configured.
*
* @return Status of the operation.
*
*/
static uint32 SdlLssConfigureNode(uint8 arrIndex_u8)
{
uint32 error_u32 = SDL_DEFAULT_ERROR;
RET_T retVal_en = RET_INTERNAL_ERROR;
uint16 hb_u16 = 500u;
/* Get the node ID from the lookup table using the index passed */
uint8 nodeId_u8 = nodeLookupTable_gast[arrIndex_u8].nodeId_u8;
/* Add node to heartbeat consumers with +25% tolerance
* Rationale - Allows some flexibility in detecting timeouts due to minor clock drifts,
* bus delays, or transmission issues.*/
retVal_en = coHbConsumerSet(nodeId_u8,
((SDL_LSS_NODE_HB_MS / 100u * 25u) + SDL_LSS_NODE_HB_MS));
retVal_en = coHbConsumerStart(nodeId_u8);
/* setup SDO channel */
retVal_en = SdlLssSetSdoCobID((arrIndex_u8 + 1u), nodeLookupTable_gast[arrIndex_u8].nodeId_u8);
/* start node */
retVal_en = coNmtStateReq(nodeId_u8, CO_NMT_STATE_OPERATIONAL, CO_FALSE);
if (retVal_en != RET_OK)
{
error_u32 = SDL_LSS_NODE_CONFIG_ERROR;
}
/* set local state to operational, if not operational yet */
if (masterStarted_gb == CO_FALSE)
{
/* set local state */
coNmtLocalStateReq(CO_NMT_STATE_OPERATIONAL);
/* save started flag */
masterStarted_gb = CO_TRUE;
}
return error_u32;
}
/******************************************************************************
* Callback Function Definitions
******************************************************************************/
/**
* @brief LSS indication function for handling the LSS api calls for dynamic
* setup of node ids.
*
* @param service_en LSS master services for indication functions
* errorCode_u16 Error code in the module
* errorSpec_u8 Specific error case that has occured
* pIdentity_pu32 LSS slave identity.
*
*/
static void SdlLssIndCallback(CO_LSS_MASTER_SERVICE_T service_en, uint16 errorCode_u16, uint8 errorSpec_u8, uint32 *pIdentity_pu32)
{
static uint8 matchedIndex_u8 = NMS_UINT8_MAX;
if (errorCode_u16 != 0u)
{
if (errorCode_u16 == NMS_UINT16_MAX)
{
/* ERROR */
}
else
{
/* ERROR */
}
if (service_en == CO_LSS_MASTER_SERVICE_STORE)
{
/* DEBUG INFO */
coLssSwitchGlobal(CO_LSS_STATE_WAITING);
}
return;
}
switch (service_en)
{
case CO_LSS_MASTER_SERVICE_NON_CONFIG_SLAVE:
/* DEBUG INFO */
coLssFastScan(SDL_LSS_TIMEOUT);
break;
case CO_LSS_MASTER_SERVICE_FASTSCAN:
/* Match detected node with lookup table */
for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++)
{
if (pIdentity_pu32[0] == nodeLookupTable_gast[i_u8].vendorId_u32 &&
pIdentity_pu32[1] == nodeLookupTable_gast[i_u8].productId_u32 &&
pIdentity_pu32[2] == nodeLookupTable_gast[i_u8].versionNbr_u32 &&
pIdentity_pu32[3] == nodeLookupTable_gast[i_u8].serialNbr_u32)
if ((currentTimeMs_u64 - lastPressureUpdateMs_u64) >= 5000)
{
coLssSwitchSelective(pIdentity_pu32[0], pIdentity_pu32[1],
pIdentity_pu32[2], pIdentity_pu32[3], 20);
matchedIndex_u8 = i_u8;
break;
}
}
break;
case CO_LSS_MASTER_SERVICE_SWITCH_SELECTIVE:
if (matchedIndex_u8 < SDL_LSS_NODE_COUNT)
{
coLssSetNodeId(nodeLookupTable_gast[matchedIndex_u8].nodeId_u8, SDL_LSS_TIMEOUT);
matchedIndex_u8 = NMS_UINT8_MAX;
}
else
{
/* ERROR */
}
break;
case CO_LSS_MASTER_SERVICE_SET_NODEID:
/* DEBUG INFO */
coLssInquireNodeId(SDL_LSS_TIMEOUT);
break;
case CO_LSS_MASTER_SERVICE_INQUIRE_NODEID:
/* DEBUG INFO */
coLssStoreConfig(200);
break;
case CO_LSS_MASTER_SERVICE_STORE:
/* DEBUG INFO */
coLssSwitchGlobal(CO_LSS_STATE_WAITING);
break;
default:
/* ERROR */
break;
}
}
/**
* @brief This function is called if a new NMT state of a node,
* is recordnized by the CANopen stack.
*
* @param nodeID_u8 Node id of the node that has registered a change.
* state_en Error control state
* nmtState_en NMT state of the particular node.
*
* @return void
*
*/
static void SdlLssHbMonitorCallback(uint8 nodeID_u8, CO_ERRCTRL_T state_en, CO_NMT_STATE_T nmtState_en)
{
uint8 arrIndex_u8;
/* look if node is monitored */
arrIndex_u8 = SdlLssGetNodeIndex(nodeID_u8);
/* handle monitored node */
if (arrIndex_u8 != NMS_UINT16_MAX)
{
/* save states */
nodeNMTState_gaen[arrIndex_u8] = nmtState_en;
/* indicate if monitored node lost heartbeat */
if (nmtState_en == CO_NMT_STATE_UNKNOWN)
{
/* To be transmitted via CAN */
/* ERROR */
}
/* indicate if monitored node sent a bootup message */
if (state_en == CO_ERRCTRL_BOOTUP)
{
/* INFO */
}
/* handle unmonitored node */
}
else
{
/* ERROR */
}
}
/**
* @brief This function tries to reset nodes with unknown NMT state.
*
* @param pData_pv Data.
*/
static void SdlLssResetNodesCallback(void *pData_pv)
{
uint8 arrIndex_u8;
(void)pData_pv;
/* reset defined nodes without known state */
for (arrIndex_u8 = 0u; arrIndex_u8 < SDL_LSS_NODE_COUNT; arrIndex_u8++)
{
if ((nodeNMTState_gaen[arrIndex_u8] != CO_NMT_STATE_PREOP) &&
(nodeNMTState_gaen[arrIndex_u8] != CO_NMT_STATE_OPERATIONAL))
{
/* reset node */
coNmtStateReq(nodeLookupTable_gast[arrIndex_u8].nodeId_u8, CO_NMT_STATE_RESET_NODE, CO_FALSE);
}
}
}
/**
* @brief This function configures a SDO client for the
* given node ID and SDO number.
*
* @param sdoNr_u8 Sdo number
* nodeId_u8 Node id of the node.
*
* @return Error state.
*
*/
static RET_T SdlLssSetSdoCobID(uint8 sdoNr_u8, uint8 nodeId_u8)
{
uint16 cobIndex_u16;
uint32 newCobId_u32;
RET_T retVal_en = RET_INTERNAL_ERROR;
/* get od index of sdoNr */
cobIndex_u16 = SDL_SDO_CLIENT_COB + sdoNr_u8 - 1u; /* SDO starts from 1280 index */
/* set cobID for client to server direction (request) */
newCobId_u32 = SDL_SDO_CLIENT_TO_SERVER_COB + nodeId_u8;
retVal_en = coOdSetCobid(cobIndex_u16, 1u, newCobId_u32);
if (retVal_en == RET_OK)
{
/* set cobID for server to client direction (response) */
newCobId_u32 = SDL_SDO_SERVER_TO_CLIENT_COB + nodeId_u8;
retVal_en = coOdSetCobid(cobIndex_u16, 2u, newCobId_u32);
}
/* print failed setup details */
if (retVal_en != RET_OK)
{
/* ERROR */
}
return retVal_en;
}
/**
* @brief This is the main function that runs the endurance
* test bench.
*
* @return void
*
*/
static void SdlEnduranceTestBenchRun(void)
{
RET_T retVal_en;
uint8 max_u8 = NMS_UINT8_MAX;
uint8 min_u8 = 0u;
static uint64 startTime_u64 = 0uLL;
uint8 alternate_u8 = 0u;
uint64 currentTime_u64;
if(startTime_u64 == 0uLL)
{
HalSystemGetRunTimeMs(&startTime_u64);
srand(startTime_u64);
}
HalSystemGetRunTimeMs(&currentTime_u64);
if(currentTime_u64 - startTime_u64 <= SDL_TEST_BENCH_STARTUP_TIMEOUT)
{
if(alternate_u8 == 0u)
{
for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT / 2; i_u8++)
{
retVal_en = coSdoWrite((i_u8 + 1), SDL_POSITION_SETPOINT_INDEX, SDL_POSITION_SETPOINT_SUB_INDEX,
(uint8*)(&max_u8), sizeof(max_u8), CO_FALSE, SDL_TEST_BENCH_SDO_TIMEOUT);
}
for (uint8 i_u8 = 10u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++)
{
retVal_en = coSdoWrite((i_u8 + 1), SDL_POSITION_SETPOINT_INDEX, SDL_POSITION_SETPOINT_SUB_INDEX,
(uint8*)(&min_u8), sizeof(min_u8), CO_FALSE, SDL_TEST_BENCH_SDO_TIMEOUT);
}
}
else
{
for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT / 2; i_u8++)
{
retVal_en = coSdoWrite((i_u8 + 1), SDL_POSITION_SETPOINT_INDEX, SDL_POSITION_SETPOINT_SUB_INDEX,
(uint8*)(&min_u8), sizeof(min_u8), CO_FALSE, SDL_TEST_BENCH_SDO_TIMEOUT);
}
for (uint8 i_u8 = 10u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++)
{
retVal_en = coSdoWrite((i_u8 + 1), SDL_POSITION_SETPOINT_INDEX, SDL_POSITION_SETPOINT_SUB_INDEX,
(uint8*)(&max_u8), sizeof(max_u8), CO_FALSE, SDL_TEST_BENCH_SDO_TIMEOUT);
}
}
uint8 readPos_u8 = 0u;
bool allMotorsReached_b = false;
while (!allMotorsReached_b)
{
allMotorsReached_b = true; /* Assume all motors have reached the position */
for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++)
{
retVal_en = coSdoRead((i_u8 + 1), SDL_POSITION_SETPOINT_INDEX, SDL_POSITION_SETPOINT_SUB_INDEX,
(uint8*)(&readPos_u8), sizeof(readPos_u8), CO_FALSE, SDL_TEST_BENCH_SDO_TIMEOUT);
if (alternate_u8 == 0u)
{
if ((i_u8 < SDL_LSS_NODE_COUNT / 2 && readPos_u8 != max_u8) ||
(i_u8 >= SDL_LSS_NODE_COUNT / 2 && readPos_u8 != min_u8))
if (pressureSetpoint_u8 + 2 <= 15)
{
allMotorsReached_b = false; /* Keep waiting */
pressureSetpoint_u8 += 2;
}
}
else
{
if ((i_u8 < SDL_LSS_NODE_COUNT / 2 && readPos_u8 != min_u8) ||
(i_u8 >= SDL_LSS_NODE_COUNT / 2 && readPos_u8 != max_u8))
else
{
allMotorsReached_b = false; /* Keep waiting */
pressureSetpoint_u8 = 0;
}
lastPressureUpdateMs_u64 = currentTimeMs_u64;
}
SdlEnablePressureControl(pressureSetpoint_u8);
}
}
alternate_u8 = !alternate_u8;
}
else
{
for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++)
{
uint8 randomPos_u8 = (rand() % (NMS_UINT8_MAX + 1));
retVal_en = coSdoWrite((i_u8 + 1), SDL_POSITION_SETPOINT_INDEX, SDL_POSITION_SETPOINT_SUB_INDEX,
(uint8*)(&randomPos_u8), sizeof(randomPos_u8), CO_FALSE, SDL_TEST_BENCH_SDO_TIMEOUT);
}
}
// }
// }
// else
// {
// ProcessBoardRun(false);
// }
}
/**
* @brief Checks if all nodes are in OPERATIONAL state.
*
* @return CO_TRUE if all nodes are OPERATIONAL, CO_FALSE otherwise.
*/
static bool SdlAreAllNodesOperational(void)
void SdlEnablePressureControl(uint8 pressureSetpoint_u8)
{
for (uint8 i_u8 = 0u; i_u8 < SDL_LSS_NODE_COUNT; i_u8++)
{
if (nodeNMTState_gaen[i_u8] != CO_NMT_STATE_OPERATIONAL)
{
return CO_FALSE; /* If any node is not in OPERATIONAL, return false */
}
}
return CO_TRUE;
static PuControllersPidOutput_st pmpRoPressurePidOutput_st = {0};
static PuControllersPidState_st pmpRoPressurePidState_st = {0};
pmpRoPressurePidState_st.isRegulatorActive_b = true;
/* Coming from reverse model */
float32 cmdPumpRoRm_f32 = 0.0f;
pmpRoPressurePidInput_st.commandRm_f32 = cmdPumpRoRm_f32;
/* Coming from filters */
pmpRoPressurePidInput_st.measFilt_f32 = receivedFilterData_st.pressureRoPs2_f32;
pmpRoPressurePidInput_st.measFilt2_f32 = receivedFilterData_st.pmpPressureMeasFilt_f32;
pmpRoPressurePidInput_st.setpoint_f32 = pressureSetpoint_u8;
PuControllersPidLoop(&pmpRoPressurePidInput_st, &pmpRoPressurePidOutput_st, &pmpRoPressurePidState_st);
ProcessBoardGrundfosPumpHandler(pmpRoPressurePidOutput_st.commandSetpoint_f32 / 10.0f);
}
static void SdlFilterInterrupt(void)
{
receivedFilterData_st = PuFiltersRun();
}

View File

@ -40,4 +40,6 @@ void SdlInit(void);
*/
void SdlRun(void);
void SdlEnablePressureControl(uint8 pressureSetpoint_u8);
#endif /* SDL_H_ */

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

159
FASTapi/endurance_can.py Normal file
View File

@ -0,0 +1,159 @@
# Real CANopen data manager for Endurance Test Bench HMI
import canopen
import time
class EnduranceDataManager:
def __init__(self):
self.motor_data = {} # {node_id: {setpoint, feedback}}
self.pu_data = {"setpoint": {}, "feedback": {}, "flowmeter": {}, "pressure": {}, "pump": {}}
self.connected = False
self.network = None
self.nodes = {}
self.serial_numbers = {}
def connect_to_can(self):
try:
self.network = canopen.Network()
self.network.connect(bustype='pcan', channel='PCAN_USBBUS1', bitrate=250000)
self._init_pu_node()
self._init_motor_nodes()
self.connected = True
except Exception as e:
print(f"[CAN ERROR] Could not connect to CAN: {e}")
self.connected = False
def disconnect(self):
if self.network:
self.network.disconnect()
self.connected = False
self.motor_data.clear()
self.pu_data = {"setpoint": {}, "feedback": {}, "flowmeter": {}, "pressure": {}, "pump": {}}
self.nodes.clear()
def send_test_command(self, value: int):
try:
if self.valve_node:
self.valve_node.sdo[0x2007].raw = value
print(f"[TEST COMMAND] Sent value {value} to 0x2007")
else:
print("[TEST COMMAND] Valve node not initialized")
except Exception as e:
print(f"[TEST COMMAND ERROR] {e}")
def _init_pu_node(self):
try:
node = canopen.RemoteNode(1, r'C:\Users\vineetagupta\Documents\NorthStar_Bitbucket\EnduranceTestBench\EnduranceTestBench\coappl\enduranceTestBench.eds')
self.network.add_node(node)
node.nmt.state = 'OPERATIONAL'
node.tpdo.read()
self.nodes[1] = node
tpdo_cobs = {
0x284: 'setpoint',
0x285: 'setpoint',
0x286: 'setpoint',
0x281: 'flowmeter',
0x282: 'pressure',
0x283: 'pump'
}
for cob_id, key in tpdo_cobs.items():
tpdo_num = self._get_tpdo_number_by_cob_id(node, cob_id)
if tpdo_num is not None:
node.tpdo[tpdo_num].enabled = True
def make_pu_cb(k):
def cb(map_obj):
for var in map_obj:
sid = f"0x{var.subindex:02X}"
self.pu_data[k][sid] = var.raw
return cb
node.tpdo[tpdo_num].add_callback(make_pu_cb(key))
except Exception as e:
print(f"PU node error: {e}")
def _get_tpdo_number_by_cob_id(self, node, cob_id):
for i in range(1, 9):
if i in node.tpdo:
if node.tpdo[i].cob_id == cob_id:
return i
return None
def get_valve_data(self):
result = {}
for i in range(5, 25):
sid = f"0x{i - 4:02X}"
setpoint = self.pu_data["setpoint"].get(sid, 0)
feedback = self.motor_data.get(i, {}).get("feedback", 0)
drift = abs(setpoint - feedback)
serial = self.serial_numbers.get(i)
status = "UNKNOWN"
try:
if i in self.nodes:
status = self.nodes[i].nmt.state or "UNKNOWN"
except:
pass
if drift >= 5 and drift <= 10:
drift_display = f"⚠️ { drift}"
elif drift >= 10:
drift_display = f"{ drift}"
else:
drift_display = f"{drift}"
result[i] = {
"node_id": f"{i}",
"setpoint": setpoint,
"feedback": feedback,
"drift": drift_display,
"status": status,
"serial": serial
}
return result
def _init_motor_nodes(self):
for node_id in range(5, 6):
try:
motor_node = canopen.RemoteNode(
node_id,
r'C:\Users\vineetagupta\Documents\NorthStar_Bitbucket\MotorBoard\MotorValveBoard\coappl\motorcontrollervalve.eds'
)
self.network.add_node(motor_node)
motor_node.nmt.state = 'OPERATIONAL'
motor_node.tpdo.read()
motor_node.tpdo[1].enabled = True
def make_cb(nid):
def cb(map_obj):
for var in map_obj:
if var.index == 0x2004 and var.subindex == 0x0:
self.motor_data[nid] = {"feedback": var.raw}
return cb
motor_node.tpdo[1].add_callback(make_cb(node_id))
self.nodes[node_id] = motor_node
if not hasattr(self, 'serial_numbers'):
self.serial_numbers = {}
if node_id not in self.serial_numbers:
try:
serial = motor_node.sdo[0x1018][4].raw
self.serial_numbers[node_id] = serial
except Exception as e:
print(f"[Serial Read Error] Node {node_id}: {e}")
self.serial_numbers[node_id] = "Unknown"
except Exception as e:
print(f"[Motor Node {node_id}] Error: {e}")
def get_flow_data(self):
return self.pu_data["flowmeter"]
def get_pressure_data(self):
return self.pu_data["pressure"]
def get_pump_rpm(self):
return self.pu_data["pump"].get("0x00", 0)

99
FASTapi/graphViewer.py Normal file
View File

@ -0,0 +1,99 @@
import os
import csv
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
from datetime import datetime
import matplotlib.pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
LOGS_DIR = "logs"
class GraphViewer(tk.Toplevel):
def __init__(self, master=None):
super().__init__(master)
self.title("Valve Graph Viewer")
self.geometry("1000x600")
self._create_widgets()
self._populate_dates()
def _create_widgets(self):
self.date_label = ttk.Label(self, text="Select Date:")
self.date_label.pack()
self.date_cb = ttk.Combobox(self, state="readonly")
self.date_cb.pack()
self.node_label = ttk.Label(self, text="Select Node:")
self.node_label.pack()
self.node_cb = ttk.Combobox(self, state="readonly", values=[f"Node{nid:02}" for nid in range(5, 25)])
self.node_cb.pack()
self.plot_btn = ttk.Button(self, text="Plot Graph", command=self._plot_graph)
self.plot_btn.pack(pady=10)
self.canvas_frame = ttk.Frame(self)
self.canvas_frame.pack(fill="both", expand=True)
def _populate_dates(self):
if not os.path.exists(LOGS_DIR):
return
dates = [d for d in os.listdir(LOGS_DIR) if os.path.isdir(os.path.join(LOGS_DIR, d))]
self.date_cb['values'] = sorted(dates)
if dates:
self.date_cb.current(0)
self.node_cb.current(0)
def _plot_graph(self):
date = self.date_cb.get()
node = self.node_cb.get()
filepath = os.path.join(LOGS_DIR, date, f"{node}.csv")
if not os.path.exists(filepath):
messagebox.showerror("File Not Found", f"No data for {node} on {date}.")
return
timestamps = []
setpoints = []
feedbacks = []
flows = []
pressures = []
with open(filepath, newline='') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
try:
timestamps.append(datetime.strptime(row["Timestamp"], "%Y-%m-%d %H:%M:%S"))
setpoints.append(float(row["Setpoint"]))
feedbacks.append(float(row["Feedback"]))
flows.append(float(row["Flow (L/h)"]))
pressures.append(float(row["Pressure (bar)"]))
except Exception as e:
print(f"[PARSE ERROR] {e}")
self._draw_plot(timestamps, setpoints, feedbacks, flows, pressures)
def _draw_plot(self, t, sp, fb, fl, pr):
for widget in self.canvas_frame.winfo_children():
widget.destroy()
fig, ax = plt.subplots(figsize=(10, 5))
ax.plot(t, sp, label="Setpoint")
ax.plot(t, fb, label="Feedback")
ax.plot(t, fl, label="Flow (L/h)")
ax.plot(t, pr, label="Pressure (bar)")
ax.set_title("Valve Performance")
ax.set_xlabel("Time")
ax.set_ylabel("Values")
ax.legend()
ax.grid(True)
canvas = FigureCanvasTkAgg(fig, master=self.canvas_frame)
canvas.draw()
canvas.get_tk_widget().pack(fill="both", expand=True)
# Usage:
# from graph_viewer import GraphViewer
# btn.config(command=lambda: GraphViewer(root))

47
FASTapi/logger.py Normal file
View File

@ -0,0 +1,47 @@
import csv
import os
import threading
from datetime import datetime
LOG_INTERVAL_SECONDS = 0.5
VALVE_IDS = range(5, 25)
BASE_LOG_DIR = "logs"
def start_per_valve_logger(data_mgr):
def log_data():
threading.Timer(LOG_INTERVAL_SECONDS, log_data).start()
try:
now = datetime.now()
timestamp_str = now.strftime("%Y-%m-%d %H:%M:%S")
date_folder = now.strftime("%Y-%m-%d")
valve_data = data_mgr.get_valve_data()
flow = data_mgr.get_flow_data()
pressure = data_mgr.get_pressure_data()
# Aggregate flow and pressure
total_flow = sum(flow.get(f"0x{i:02X}", 0) for i in range(1, 5)) / 100.0
total_pressure = sum(pressure.get(f"0x{i:02X}", 0) for i in range(1, 4)) / 100.0
# Create daily folder
log_dir = os.path.join(BASE_LOG_DIR, date_folder)
os.makedirs(log_dir, exist_ok=True)
for node_id in VALVE_IDS:
valve = valve_data.get(node_id, {})
setpoint = valve.get("setpoint", 0)
feedback = valve.get("feedback", 0)
filepath = os.path.join(log_dir, f"Node{node_id:02}.csv")
is_new_file = not os.path.exists(filepath)
with open(filepath, "a", newline="") as f:
writer = csv.writer(f)
if is_new_file:
writer.writerow(["Timestamp", "Setpoint", "Feedback", "Flow (L/h)", "Pressure (bar)"])
writer.writerow([timestamp_str, setpoint, feedback, total_flow, total_pressure])
except Exception as e:
print(f"[LOG ERROR] {e}")
log_data()

68
FASTapi/main.py Normal file
View File

@ -0,0 +1,68 @@
from fastapi import FastAPI, Request
from fastapi.staticfiles import StaticFiles
from fastapi.responses import HTMLResponse, JSONResponse
from fastapi.templating import Jinja2Templates
import uvicorn
from endurance_can import EnduranceDataManager
from logger import start_per_valve_logger
app = FastAPI()
# Static and templates
app.mount("/static", StaticFiles(directory="static"), name="static")
templates = Jinja2Templates(directory="templates")
# Global CAN manager
data_mgr = EnduranceDataManager()
data_mgr.connect_to_can()
start_per_valve_logger(data_mgr)
@app.get("/", response_class=HTMLResponse)
async def root(request: Request):
return templates.TemplateResponse("index.html", {"request": request})
@app.get("/api/valve-data")
async def get_valve_data():
return JSONResponse(content=data_mgr.get_valve_data())
@app.get("/api/flow-data")
async def get_flow_data():
return JSONResponse(content=data_mgr.get_flow_data())
@app.get("/api/pressure-data")
async def get_pressure_data():
return JSONResponse(content=data_mgr.get_pressure_data())
@app.get("/api/pump-rpm")
async def get_pump_rpm():
return JSONResponse(content={"rpm": data_mgr.get_pump_rpm()})
@app.post("/api/start-test")
async def start_test():
data_mgr.send_test_command(1)
return {"status": "started"}
@app.post("/api/stop-test")
async def stop_test():
data_mgr.send_test_command(0)
return {"status": "stopped"}
@app.get("/data")
def get_data():
return {
"valves": data_mgr.get_valve_data(),
"flow": data_mgr.get_flow_data(),
"pressure": data_mgr.get_pressure_data(),
"pump": data_mgr.get_pump_rpm()
}
@app.get("/graphs", response_class=HTMLResponse)
async def show_graphs(request: Request):
return templates.TemplateResponse("graphs.html", {"request": request})
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8080, reload=True)

105
FASTapi/static/main.js Normal file
View File

@ -0,0 +1,105 @@
<script>
const ctx = document.getElementById('liveChart').getContext('2d');
const nodeLabel = document.getElementById('selectedNodeLabel');
const nodeSelector = document.getElementById('nodeSelector');
let selectedNode = "5"; // Default node
const historyLimit = 300; // Keep up to 300 points in memory (5 min if 1/s)
const viewWindow = 60; // Show last 60 points on screen
let allData = {
labels: [],
setpoint: [],
feedback: [],
flow: [],
pressure: []
};
// Populate dropdown
for (let i = 5; i <= 24; i++) {
const option = document.createElement("option");
option.value = i.toString();
option.text = `Node ${i.toString().padStart(2, "0")}`;
if (i === 5) option.selected = true;
nodeSelector.appendChild(option);
}
nodeSelector.addEventListener("change", () => {
selectedNode = nodeSelector.value;
nodeLabel.textContent = selectedNode.padStart(2, "0");
// Reset history for this new node
allData = {
labels: [],
setpoint: [],
feedback: [],
flow: [],
pressure: []
};
chart.data.labels = [];
chart.data.datasets.forEach(ds => ds.data = []);
chart.update();
});
const chart = new Chart(ctx, {
type: 'line',
data: {
labels: [],
datasets: [
{ label: 'Setpoint', borderColor: 'blue', data: [], fill: false },
{ label: 'Feedback', borderColor: 'green', data: [], fill: false },
{ label: 'Flow (L/h)', borderColor: 'orange', data: [], fill: false },
{ label: 'Pressure (bar)', borderColor: 'red', data: [], fill: false }
]
},
options: {
responsive: true,
animation: false,
scales: {
x: { title: { display: true, text: 'Time' } },
y: { title: { display: true, text: 'Value' } }
}
}
});
function fetchLiveData() {
fetch("/data")
.then(res => res.json())
.then(data => {
const now = new Date().toLocaleTimeString();
const valve = data.valves?.[selectedNode] || {};
const flow = data.flow?.["0x01"] || 0;
const pressure = data.pressure?.["0x01"] || 0;
// Append to history arrays
allData.labels.push(now);
allData.setpoint.push(valve.setpoint || 0);
allData.feedback.push(valve.feedback || 0);
allData.flow.push(flow);
allData.pressure.push(pressure);
// Trim history if needed
if (allData.labels.length > historyLimit) {
allData.labels.shift();
allData.setpoint.shift();
allData.feedback.shift();
allData.flow.shift();
allData.pressure.shift();
}
// Extract last `viewWindow` points to show in graph
const start = Math.max(0, allData.labels.length - viewWindow);
chart.data.labels = allData.labels.slice(start);
chart.data.datasets[0].data = allData.setpoint.slice(start);
chart.data.datasets[1].data = allData.feedback.slice(start);
chart.data.datasets[2].data = allData.flow.slice(start);
chart.data.datasets[3].data = allData.pressure.slice(start);
chart.update();
});
}
setInterval(fetchLiveData, 1000);
</script>

22
FASTapi/static/styles.css Normal file
View File

@ -0,0 +1,22 @@
.status-indicator {
display: inline-block;
width: 12px;
height: 12px;
border-radius: 50%;
}
.status-operational {
background-color: green;
}
.status-stopped {
background-color: red;
}
.status-preop {
background-color: orange;
}
.status-unknown {
background-color: gray;
}

View File

@ -0,0 +1,92 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Live Valve Graph</title>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
</head>
<body>
<div style="text-align: center;">
<h3>Live Valve Graph - Node <span id="selectedNodeLabel">05</span></h3>
<label for="nodeSelector">Select Node:</label>
<select id="nodeSelector">
</select>
</div>
<canvas id="liveChart" width="1000" height="400"></canvas>
<script>
const ctx = document.getElementById('liveChart').getContext('2d');
const nodeLabel = document.getElementById('selectedNodeLabel');
const nodeSelector = document.getElementById('nodeSelector');
let selectedNode = "5";
// Add node options 05 to 24
for (let i = 5; i <= 24; i++) {
const option = document.createElement("option");
option.value = i.toString();
option.text = `Node ${i.toString().padStart(2, "0")}`;
if (i === 5) option.selected = true;
nodeSelector.appendChild(option);
}
nodeSelector.addEventListener("change", () => {
selectedNode = nodeSelector.value;
nodeLabel.textContent = selectedNode.padStart(2, "0");
// Clear chart
chart.data.labels = [];
chart.data.datasets.forEach(ds => ds.data = []);
chart.update();
});
const chart = new Chart(ctx, {
type: 'line',
data: {
labels: [],
datasets: [
{ label: 'Setpoint', borderColor: 'blue', data: [], fill: false },
{ label: 'Feedback', borderColor: 'green', data: [], fill: false },
{ label: 'Flow (L/h)', borderColor: 'orange', data: [], fill: false },
{ label: 'Pressure (bar)', borderColor: 'red', data: [], fill: false }
]
},
options: {
responsive: true,
animation: false,
scales: {
x: { title: { display: true, text: 'Time' } },
y: { title: { display: true, text: 'Value' } }
}
}
});
function fetchLiveData() {
fetch("/data")
.then(res => res.json())
.then(data => {
const now = new Date().toLocaleTimeString();
const valve = data.valves?.[selectedNode] || {};
const flow = data.flow?.["0x01"] || 0;
const pressure = data.pressure?.["0x01"] || 0;
chart.data.labels.push(now);
chart.data.datasets[0].data.push(valve.setpoint || 0);
chart.data.datasets[1].data.push(valve.feedback || 0);
chart.data.datasets[2].data.push(flow);
chart.data.datasets[3].data.push(pressure);
if (chart.data.labels.length > 50) {
chart.data.labels.shift();
chart.data.datasets.forEach(ds => ds.data.shift());
}
chart.update();
});
}
setInterval(fetchLiveData, 1000);
</script>
</body>
</html>

View File

@ -0,0 +1,140 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Endurance Test Bench</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
<style>
.status-indicator {
display: inline-block;
width: 15px;
height: 15px;
border-radius: 50%;
}
.status-unknown {
background-color: gray;
}
.valve-table-wrapper {
max-height: 500px;
overflow-y: auto;
}
</style>
</head>
<body class="bg-light text-dark">
<div class="container-fluid p-4">
<div class="row mb-4">
<div class="col-12 d-flex justify-content-between align-items-center flex-wrap">
<div class="mb-2 mb-md-0">
<button id="startTest" class="btn btn-outline-success me-2">✅ Start Test</button>
<button id="stopTest" class="btn btn-outline-danger">❌ Stop Test</button>
</div>
<button id="showGraphs" class="btn btn-outline-info">🖥 Show Graphs</button>
</div>
</div>
<div class="row gx-4">
<div class="col-lg-9 col-md-12 mb-4">
<h4 class="fw-bold mb-3">Valve Overview</h4>
<div class="table-responsive valve-table-wrapper">
<table class="table table-bordered align-middle text-center">
<thead class="table-primary text-white">
<tr>
<th>Status</th>
<th>Node ID</th>
<th>Serial No.</th>
<th>Setpoint</th>
<th>Feedback</th>
<th>Drift</th>
</tr>
</thead>
<tbody id="valve-table-body">
<!-- JS will populate this -->
</tbody>
</table>
</div>
</div>
<div class="col-lg-3 col-md-12">
<h5 class="fw-bold mb-3">System Feedback</h5>
<div class="card mb-3">
<div class="card-header bg-primary text-white fw-bold">Pressure Sensor</div>
<ul class="list-group list-group-flush" id="pressureList">
<li class="list-group-item">Pressure 1: 0 bar</li>
<li class="list-group-item">Pressure 2: 0 bar</li>
<li class="list-group-item">Pressure 3: 0 bar</li>
<li class="list-group-item">Pressure 4: 0 bar</li>
</ul>
</div>
<div class="card mb-3">
<div class="card-header bg-primary text-white fw-bold">Flowmeter</div>
<ul class="list-group list-group-flush" id="flowList">
<li class="list-group-item">Flowmeter 1: 0 L/h</li>
<li class="list-group-item">Flowmeter 2: 0 L/h</li>
<li class="list-group-item">Flowmeter 3: 0 L/h</li>
<li class="list-group-item">Flowmeter 4: 0 L/h</li>
</ul>
</div>
<div class="card">
<div class="card-header bg-primary text-white fw-bold">Pump RPM</div>
<div class="card-body">
<h3 class="card-title text-center" id="pumpRPM">0</h3>
</div>
</div>
</div>
</div>
</div>
<script>
function fetchAllData() {
fetch("/data")
.then(res => res.json())
.then(data => {
const tbody = document.getElementById("valve-table-body");
tbody.innerHTML = "";
for (let i = 5; i <= 24; i++) {
const valve = data.valves?.[i.toString()] || {
node_id: "--", serial: "--", setpoint: "--",
feedback: "--", drift: "--", status: "UNKNOWN"
};
const row = document.createElement("tr");
row.innerHTML = `
<td><span class="status-indicator status-${valve.status?.toLowerCase() || 'unknown'}"></span></td>
<td>${valve.node_id}</td>
<td>${valve.serial ?? "--"}</td>
<td>${valve.setpoint}</td>
<td>${valve.feedback}</td>
<td>${valve.drift}</td>
`;
tbody.appendChild(row);
}
const flowEls = document.querySelectorAll("#flowList li");
Object.values(data.flow || {}).forEach((val, i) => {
if (flowEls[i]) flowEls[i].textContent = `Flowmeter ${i + 1}: ${val} L/h`;
});
const pressureEls = document.querySelectorAll("#pressureList li");
Object.values(data.pressure || {}).forEach((val, i) => {
if (pressureEls[i]) pressureEls[i].textContent = `Pressure ${i + 1}: ${val} bar`;
});
document.getElementById("pumpRPM").textContent = data.pump ?? "0";
})
.catch(err => console.error("Failed to fetch /data", err));
}
setInterval(fetchAllData, 1000);
</script>
<script>
document.getElementById("showGraphs").addEventListener("click", () => {
window.open("/graphs", "_blank");
});
</script>
</body>
</html>

View File

@ -76,7 +76,10 @@ typedef enum
NMS_ERR_NOT_INITIALIZED, /* The initialization was unsuccessful */
NMS_ERR_NOT_RUNNING, /* Module has not been started */
NMS_ERR_BUS_ERROR, /* Memory cannot be physically addressed (e.g. invalid bus address) */
NMS_ERR_NULL_POINTER
NMS_ERR_NULL_POINTER,
NMS_ERR_INVALID_MODULE,
NMS_ERR_INVALID_POINTER,
NMS_LSS_NODE_CONFIG_ERROR,
} NMSErrorEn;
#endif /* NMS_TYPES_H_INCLUDED */

263
gui.py Normal file
View File

@ -0,0 +1,263 @@
import sys
import time
import struct
import canopen
import can
from can.listener import Listener
from PyQt5.QtWidgets import (
QApplication, QWidget, QTableWidget, QTableWidgetItem, QVBoxLayout,
QHBoxLayout, QLabel, QGroupBox, QFormLayout, QPushButton, QMessageBox, QHeaderView
)
from PyQt5.QtCore import QTimer, Qt
from PyQt5.QtGui import QColor
motorBoardEdsPath = r'C:\Users\vineetagupta\Documents\NorthStar-Motor-Valve-Board-Firmware\MotorValveBoard\coappl\motorcontrollervalve.eds'
puBoardEdsPath = r'C:\Users\vineetagupta\Documents\NorthStar-Endurance-TestBench\EnduranceTestBench\coappl\enduranceTestBench.eds'
class SDOSetpointListener(Listener):
def __init__(self, parent):
self.parent = parent
def on_message_received(self, msg):
if 0x600 <= msg.arbitration_id <= 0x61F and len(msg.data) >= 8:
node_id = msg.arbitration_id - 0x600
cmd = msg.data[0] & 0xE0
index = msg.data[1] | (msg.data[2] << 8)
subindex = msg.data[3]
if index == 0x6000 and subindex == 0x01 and cmd == 0x20:
setpoint_val = msg.data[4]
self.parent.motorBoardTpdoData[node_id]['setpoint'] = setpoint_val
class NodeTableWindow(QWidget):
def __init__(self, nodes):
super().__init__()
self.setWindowTitle("Endurance Test Bench")
self.nodes = nodes
self.motorBoardTpdoData = {}
self.PuBoardData = {}
self.connected = False
self.network = None
self.num_nodes = 0
self.init_ui()
self.start_timer()
def init_ui(self):
layout = QVBoxLayout(self)
button_row = QHBoxLayout()
self.connect_btn = QPushButton("Connect to CAN", self)
self.disconnect_btn = QPushButton("Disconnect", self)
self.disconnect_btn.setEnabled(False)
self.connect_btn.clicked.connect(self.handle_connect)
self.disconnect_btn.clicked.connect(self.handle_disconnect)
button_row.addWidget(self.connect_btn)
button_row.addWidget(self.disconnect_btn)
layout.addLayout(button_row)
main_layout = QHBoxLayout()
self.table_widget = QWidget(self)
table_layout = QVBoxLayout()
table_heading = QLabel("Valve Details")
table_heading.setAlignment(Qt.AlignLeft)
table_layout.addWidget(table_heading)
self.table = QTableWidget(0, 4)
self.table.setHorizontalHeaderLabels(["Node ID", "Setpoint", "Feedback", "Status"])
self.table.horizontalHeader().setStretchLastSection(True)
self.table.horizontalHeader().setSectionResizeMode(QHeaderView.Stretch)
self.table.verticalHeader().setVisible(False)
table_layout.addWidget(self.table)
self.table_widget.setLayout(table_layout)
self.details_widget = QWidget(self)
details_layout = QVBoxLayout(self.details_widget)
pressure_group = QGroupBox("Pressure Sensor Details", self)
pressure_layout = QFormLayout(pressure_group)
self.pressure_labels = []
for i in range(1, 5):
label = QLabel("0 bar", self)
self.pressure_labels.append(label)
pressure_layout.addRow(f"Pressure Sensor {i}", label)
details_layout.addWidget(pressure_group)
flow_group = QGroupBox("Flow Meter Details", self)
flow_layout = QFormLayout(flow_group)
self.flow_rate_label = []
for i in range(1, 5):
label = QLabel("0 L/h", self)
self.flow_rate_label.append(label)
flow_layout.addRow(f"Flowmeter {i}", label)
details_layout.addWidget(flow_group)
pump_group = QGroupBox("Pump Details", self)
pump_layout = QFormLayout(pump_group)
self.pump_value_label = QLabel("0 RPM", self)
pump_layout.addRow("Speed", self.pump_value_label)
details_layout.addWidget(pump_group)
self.details_widget.setLayout(details_layout)
main_layout.addWidget(self.table_widget)
main_layout.addWidget(self.details_widget)
layout.addLayout(main_layout)
screen = QApplication.primaryScreen()
screen_geometry = screen.availableGeometry()
width = int(screen_geometry.width() * 0.4)
height = int(screen_geometry.height() * 0.7)
x = int((screen_geometry.width() - width) / 2)
y = int((screen_geometry.height() - height) / 2)
self.setGeometry(x, y, width, height)
def start_timer(self):
self.timer = QTimer()
self.timer.setInterval(500)
self.timer.timeout.connect(self.update_table)
self.timer.start()
def handle_connect(self):
try:
self.network = canopen.Network()
self.network.connect(channel='PCAN_USBBUS1', bustype='pcan', bitrate=250000)
self.nodes = {}
self.motorBoardTpdoData = {}
self.PuBoardData = {}
self.init_motor_nodes()
self.init_pu_node()
self.listener = SDOSetpointListener(self)
self.notifier = can.Notifier(self.network.bus, [self.listener])
self.connected = True
self.num_nodes = len(self.nodes)
self.table.setRowCount(self.num_nodes)
for row, node_id in enumerate(sorted(self.nodes.keys())):
item = QTableWidgetItem(str(node_id))
item.setTextAlignment(Qt.AlignCenter)
self.table.setItem(row, 0, item)
self.connect_btn.setStyleSheet("background-color: lightgreen;")
self.disconnect_btn.setEnabled(True)
QMessageBox.information(self, "Connected", "Successfully connected to CAN and initialized nodes.")
except Exception as e:
QMessageBox.critical(self, "Connection Error", f"Failed to connect:\n{e}")
self.connected = False
def handle_disconnect(self):
try:
if hasattr(self, 'notifier'):
self.notifier.stop()
if self.network:
self.network.disconnect()
self.connected = False
self.nodes.clear()
self.motorBoardTpdoData.clear()
self.PuBoardData.clear()
self.table.clearContents()
self.table.setRowCount(0)
self.connect_btn.setEnabled(True)
self.disconnect_btn.setEnabled(False)
self.connect_btn.setStyleSheet("")
QMessageBox.information(self, "Disconnected", "CAN network disconnected.")
except Exception as e:
QMessageBox.warning(self, "Disconnect Error", f"Error while disconnecting:\n{e}")
def init_motor_nodes(self):
for node_id in range(5, 27):
try:
node = canopen.RemoteNode(node_id, motorBoardEdsPath)
self.network.add_node(node)
time.sleep(0.1)
self.nodes[node_id] = node
self.motorBoardTpdoData[node_id] = {'setpoint': '-', 'feedback': '-'}
if node.nmt.state == 'OPERATIONAL':
node.tpdo.read()
node.tpdo[1].enabled = True
def make_callback(nid):
def cb(map_obj):
for var in map_obj:
if var.index == 0x6002:
self.motorBoardTpdoData[nid]['feedback'] = var.raw
return cb
node.tpdo[1].add_callback(make_callback(node_id))
except Exception as e:
print(f"Motor node {node_id} error: {e}")
def init_pu_node(self):
try:
node = canopen.RemoteNode(0x1, puBoardEdsPath)
self.network.add_node(node)
time.sleep(0.1)
self.nodes[1] = node
self.PuBoardData = {'flowmeter': {}, 'pressure': {}, 'pump': {}}
if node.nmt.state == 'OPERATIONAL':
node.tpdo.read()
# Enable all relevant TPDOs
for tpdo_id in range(4, 9): # TPDO4 to TPDO8
if tpdo_id in node.tpdo:
node.tpdo[tpdo_id].enabled = True
def make_callback():
def cb(map_obj):
for var in map_obj:
if var.index == 0x6004:
self.PuBoardData['flowmeter'][f'0x{var.subindex:02X}'] = var.raw
elif var.index == 0x6005:
self.PuBoardData['pressure'][f'0x{var.subindex:02X}'] = var.raw
elif var.index == 0x6006:
self.PuBoardData['pump'][f'0x{var.subindex:02X}'] = var.raw
return cb
node.tpdo[tpdo_id].add_callback(make_callback())
except Exception as e:
print(f"PU node error: {e}")
def update_table(self):
if not self.connected:
return
for row, node_id in enumerate(sorted(self.nodes.keys())):
node = self.nodes[node_id]
try:
status = node.nmt.state
except:
status = "UNKNOWN"
node_item = self.table.item(row, 0)
if node_item:
node_item.setBackground(
QColor("green") if status == "OPERATIONAL" else
QColor("yellow") if status == "PRE-OPERATIONAL" else
QColor("red")
)
set_val = str(self.motorBoardTpdoData.get(node_id, {}).get('setpoint', '-'))
setpoint_item = QTableWidgetItem(set_val)
setpoint_item.setTextAlignment(Qt.AlignCenter)
self.table.setItem(row, 1, setpoint_item)
fb_val = str(self.motorBoardTpdoData.get(node_id, {}).get('feedback', '-'))
feedback_item = QTableWidgetItem(fb_val)
feedback_item.setTextAlignment(Qt.AlignCenter)
self.table.setItem(row, 2, feedback_item)
status_item = QTableWidgetItem(status)
status_item.setTextAlignment(Qt.AlignCenter)
self.table.setItem(row, 3, status_item)
# Update flowmeter values
for i in range(1, 5):
value = self.PuBoardData.get("flowmeter", {}).get(f"0x{i:02X}", 0)
self.flow_rate_label[i-1].setText(f"{value} L/h")
# Update pressure sensor values
for i in range(1, 5):
value = self.PuBoardData.get("pressure", {}).get(f"0x{i:02X}", 0)
self.pressure_labels[i-1].setText(f"{value} bar")
# Update pump speed
value = self.PuBoardData.get("pump", {}).get("0x00", 0)
self.pump_value_label.setText(f"{value} RPM")
def main():
app = QApplication(sys.argv)
window = NodeTableWindow({})
window.show()
sys.exit(app.exec_())
if __name__ == "__main__":
main()

View File

@ -0,0 +1,96 @@
/*
* can_printf - printf over CAN
*
* Copyright (c) 2013-2024 emotas embedded communication GmbH
*-------------------------------------------------------------------
* $Id: can_printf.c 52765 2024-03-13 12:42:43Z hil $
*
*
*-------------------------------------------------------------------
*
*
*/
/********************************************************************/
/**
* \brief printf over CAN
*
* \file can_printf.c
*
* Requirements:
* 1) additional COB
* 2) more TX queue buffers
* 3) in gen_define.h
* #define CAN_PRINTF
* #define CO_CAN_DEBUG_SUPPORTED
* #define printf can_printf
* extern int can_printf( const char *_format, ...);
*
*
*/
/* header of standard C - libraries
---------------------------------------------------------------------------*/
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
/* header of project specific types
---------------------------------------------------------------------------*/
#include <gen_define.h>
#ifdef NO_PRINTF
#else
#ifdef CAN_PRINTF
#include <co_datatype.h>
#include <co_candebug.h>
# ifdef CO_CAN_DEBUG_SUPPORTED
# else /* CO_CAN_DEBUG_SUPPORTED */
# error "CAN_PRINTF req. CO_CAN_DEBUG_SUPPORTED!"
# endif /* CO_CAN_DEBUG_SUPPORTED */
#ifndef PRINTF_COBID
# define PRINTF_COBID 0x580
#endif
/*
* can_printf - format like printf
*
* Currently fix for 8 Byte.
*
* Note: Required Stack size!
*
*/
int can_printf( const char *_format, ...)
{
va_list _ap;
int rval;
static char buf[80] = {0};
int idx = 0;
UNSIGNED8 canLine = 0; /* currently the complete output write to a fix line */
va_start(_ap, _format);
vsnprintf(buf, 79, _format, _ap);
rval = strlen(buf);
while (rval > 8) {
coCanDebugPrint(CO_LINE, PRINTF_COBID, 8, (const UNSIGNED8 *)&buf[idx]);
rval -= 8;
idx += 8;
}
if (rval > 0) {
coCanDebugPrint(CO_LINE, PRINTF_COBID, rval, (const UNSIGNED8 *)&buf[idx]);
}
va_end(_ap);
return (rval);
}
#endif
#endif

View File

@ -0,0 +1,631 @@
/*
* codrv_canbittiming.c - CAN Bittiming tables
*
* Copyright (c) 2012-2024 emotas embedded communication GmbH
*-------------------------------------------------------------------
* $Id: codrv_canbittiming.c 54593 2024-07-08 13:01:45Z hil $
*
*
*-------------------------------------------------------------------
*
*
*/
/********************************************************************/
/**
* \brief
*
* \file
* \author emotas embedded communication GmbH
*
* This module contains different bittiming tables.
*
*/
/* header of project specific types
---------------------------------------------------------------------------*/
#include <gen_define.h>
#include <co_datatype.h>
#include <co_drv.h>
#ifdef CODRV_BIT_TABLE_EXTERN
/*
* 200 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_200MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
{ 125u, 100u, 0u, 13u, 2u }, /* ! 87.5% */
{ 250u, 50u, 0u, 13u, 2u }, /* ! 87.5% */
{ 500u, 40u, 0u, 8u, 1u }, /* ! 90% */
{ 1000u, 20u, 0u, 8u, 1u }, /* ! 90% */
{0u,0u,0u,0u,0u} /* last */
};
#endif /* CODRV_CANCLOCK_200MHZ */
/*
* 160 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_160MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 1000u, 0u, 13u, 2u }, /* 87.5% */
{ 20u, 500u, 0u, 13u, 2u }, /* 87.5% */
{ 50u, 200u, 0u, 13u, 2u }, /* 87.5% */
{ 100u, 100u, 0u, 13u, 2u }, /* 87.5% */
{ 125u, 80u, 0u, 13u, 2u }, /* 87.5% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 250u, 40u, 0u, 13u, 2u }, /* 87.5% */
{ 500u, 20u, 0u, 13u, 2u }, /* 87.5% */
{ 800u, 25u, 0u, 6u, 1u }, /* 87.5% */
{ 1000u, 10u, 0u, 13u, 2u }, /* 87.5% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_160MHZ */
/*
* 120 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_120MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 480u, 0u, 16u, 8u }, /* 68.0% */
{ 20u, 400u, 0u, 12u, 2u }, /* 86.7% */
{ 50u, 160u, 0u, 12u, 2u }, /* 86.7% */
{ 100u, 80u, 0u, 12u, 2u }, /* 86.7% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 125u, 60u, 0u, 13u, 2u }, /* 87.5% */
{ 250u, 30u, 0u, 13u, 2u }, /* 87.5% */
{ 500u, 15u, 0u, 13u, 2u }, /* 87.5% */
{ 800u, 10u, 0u, 12u, 2u }, /* 86.7% */
{ 1000u, 8u, 0u, 12u, 2u }, /* 86.7% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_120MHZ */
/*
* 100 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_100MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
{ 125u, 50u, 0u, 13u, 2u }, /* ! 87.5% */
{ 250u, 25u, 0u, 13u, 2u }, /* ! 87.5% */
{ 500u, 20u, 0u, 8u, 1u }, /* ! 90% */
{ 1000u, 10u, 0u, 8u, 1u }, /* ! 90% */
{0u,0u,0u,0u,0u} /* last */
};
#endif /* CODRV_CANCLOCK_100MHZ */
/*
* 90 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_90MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 90MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 600u, 0u, 12u, 2u }, /* !! 86.7% */
{ 20u, 300u, 0u, 12u, 2u }, /* !! 86.7% */
{ 50u, 120u, 0u, 12u, 2u }, /* !! 86.7% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 125u, 45u, 0u, 13u, 2u }, /* !! 87.5% */
{ 250u, 24u, 0u, 12u, 2u }, /* !! 86.7% */
{ 500u, 12u, 0u, 12u, 2u }, /* !! 86.7% */
{ 1000u, 6u, 0u, 12u, 2u }, /* !! 86.7% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_90MHZ */
/*
* 80 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_80MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 500u, 0u, 13u, 2u }, /* 87.5% */
{ 20u, 250u, 0u, 13u, 2u }, /* 87.5% */
{ 50u, 100u, 0u, 13u, 2u }, /* 87.5% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 100u, 50u, 0u, 13u, 2u }, /* 87.5% */
{ 125u, 40u, 0u, 13u, 2u }, /* 87.5% */
{ 250u, 20u, 0u, 13u, 2u }, /* 87.5% */
{ 500u, 10u, 0u, 13u, 2u }, /* 87.5% */
{ 800u, 10u, 0u, 8u, 1u }, /* 90.0% */
{ 1000u, 5u, 0u, 13u, 2u }, /* 87.5% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_80MHZ */
#ifdef CODRV_CANCLOCK_75MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 75MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 20u, 250u, 0u, 12u, 2u }, /* 86.7% */
{ 50u, 100u, 0u, 12u, 2u }, /* 86.7% */
# endif
{ 100u, 50u, 0u, 12u, 2u }, /* 86.7% */
{ 125u, 40u, 0u, 12u, 2u }, /* 86.7% */
{ 250u, 20u, 0u, 12u, 2u }, /* 86.7% */
{ 500u, 10u, 0u, 12u, 2u }, /* 86.7% */
{ 1000u, 5u, 0u, 12u, 2u }, /* 86.7% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif
/*
* 72 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_72MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 72MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 450u, 0u, 13u, 2u },
{ 20u, 225u, 0u, 13u, 2u },
{ 50u, 90u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 100u, 45u, 0u, 13u, 2u },
{ 125u, 36u, 0u, 13u, 2u },
{ 250u, 18u, 0u, 13u, 2u },
{ 500u, 9u, 0u, 13u, 2u },
{ 800u, 6u, 0u, 12u, 2u }, /* 86.7% */
{ 1000u, 9u, 0u, 6u, 1u }, /* 8tq 87.5% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_72MHZ */
/*
* 70 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_70MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 70MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 20u, 250u, 3u, 8u, 2u }, /* !! 85,7% */
{ 50u, 70u, 8u, 8u, 3u }, /* !! 85% */
# endif
{ 100u, 35u, 8u, 8u, 3u }, /* !! 85% */
{ 125u, 35u, 5u, 8u, 2u },
{ 250u, 14u, 8u, 8u, 3u }, /* !! 85% */
{ 500u, 7u, 8u, 8u, 3u }, /* !! 85% */
{ 1000u, 5u, 3u, 8u, 2u }, /* !! 85,7% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_70MHZ */
/*
* 64 MHz table
*/
#ifdef CODRV_CANCLOCK_64MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 64MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 256u, 0u, 16u, 8u }, /* 68.0% */
{ 20u, 200u, 0u, 13u, 2u },
{ 50u, 80u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 100u, 40u, 0u, 13u, 2u },
{ 125u, 32u, 0u, 13u, 2u },
{ 250u, 16u, 0u, 13u, 2u },
{ 500u, 8u, 0u, 13u, 2u },
{ 800u, 5u, 0u, 13u, 2u },
{ 1000u, 4u, 0u, 13u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_64MHZ */
/*
* 60 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_60MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 60MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 375u, 0u, 13u, 2u },
{ 20u, 200u, 0u, 12u, 2u }, /* 86.7% */
{ 50u, 75u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 100u, 40u, 0u, 12u, 2u }, /* 86.7% */
{ 125u, 30u, 0u, 13u, 2u },
{ 250u, 15u, 0u, 13u, 2u },
{ 500u, 8u, 0u, 12u, 2u }, /* 86.7% */
{ 800u, 5u, 0u, 12u, 2u }, /* 86.7% */
{ 1000u, 4u, 0u, 12u, 2u }, /* 86.7% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_60MHZ */
/*
* 54 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_54MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 54MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 20u, 150u, 0u, 15u, 2u }, /* !! 88.9% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 60u, 0u, 15u, 2u }, /* !! 88.9% */
{ 100u, 30u, 0u, 15u, 2u }, /* !! 88.9% */
{ 125u, 27u, 0u, 13u, 2u },
{ 250u, 12u, 0u, 15u, 2u }, /* !! 88.9% */
{ 500u, 6u, 0u, 15u, 2u }, /* !! 88.9%*/
{ 1000u, 3u, 0u, 15u, 2u }, /* !! 88.9% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_54MHZ */
/*
* 50 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_50MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 50MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 250u, 0u, 16u, 3u }, /* !! 85% */
{ 20u, 125u, 0u, 16u, 3u }, /* !! 85% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 50u, 0u, 16u, 3u }, /* !! 85% */
{ 100u, 25u, 0u, 16u, 3u }, /* !! 85% */
{ 125u, 25u, 0u, 13u, 2u },
{ 250u, 10u, 0u, 16u, 3u }, /* !! 85% */
{ 500u, 5u, 0u, 16u, 3u }, /* !! */
{ 1000u, 5u, 0u, 7u, 2u }, /* !! 80% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_50MHZ */
/*
* 48 MHz table
*/
#ifdef CODRV_CANCLOCK_48MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 48MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 300u, 0u, 13u, 2u },
{ 20u, 150u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 60u, 0u, 13u, 2u },
{ 100u, 30u, 0u, 13u, 2u },
{ 125u, 24u, 0u, 13u, 2u },
{ 250u, 12u, 0u, 13u, 2u },
{ 500u, 6u, 0u, 13u, 2u },
{ 1000u, 3u, 0u, 13u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_48MHZ */
/*
* 45 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_45MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 45MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 300u, 0u, 12u, 2u }, /* 86.7% */
{ 20u, 150u, 0u, 12u, 2u }, /* 86.7% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 60u, 0u, 12u, 2u }, /* 86.7% */
{ 100u, 30u, 0u, 12u, 2u }, /* 86.7% */
{ 125u, 24u, 0u, 12u, 2u }, /* 86.7% */
{ 250u, 12u, 0u, 12u, 2u }, /* 86.7% */
{ 500u, 6u, 0u, 12u, 2u }, /* 86.7% */
{ 1000u, 3u, 0u, 12u, 2u }, /* 86.7% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_45MHZ */
/*
* 42 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_42MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 42MHz table, prescaler 10bit (max 1024) */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 280u, 0u, 12u, 2u },
{ 20u, 140u, 0u, 12u, 2u }, /* 86,7% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 56u, 0u, 12u, 2u },
{ 100u, 28u, 0u, 12u, 2u },
{ 125u, 21u, 0u, 13u, 2u },
{ 250u, 12u, 0u, 11u, 2u },
{ 500u, 6u, 0u, 11u, 2u },
{ 1000u, 3u, 0u, 11u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_42MHZ */
/*
* 40 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_40MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 40MHz table, prescaler 10bit (max 1024) */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 250u, 0u, 13u, 2u },
{ 20u, 125u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 50u, 0u, 13u, 2u },
{ 100u, 25u, 0u, 13u, 2u },
{ 125u, 20u, 0u, 13u, 2u },
{ 250u, 10u, 0u, 13u, 2u },
{ 500u, 5u, 0u, 13u, 2u },
{ 1000u, 5u, 0u, 6u, 1u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_40MHZ */
/*
* 36 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_36MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 36MHz table, prescaler 10bit (max 1024) */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 225u, 0u, 13u, 2u },
{ 20u, 120u, 0u, 12u, 2u }, /* 86,7% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 45u, 0u, 13u, 2u }, /* 85% */
{ 100u, 18u, 0u, 16u, 3u }, /* 85% */
{ 125u, 18u, 0u, 13u, 2u },
{ 250u, 9u, 0u, 13u, 2u },
{ 500u, 9u, 0u, 6u, 1u }, /* only 8tq */
{ 800u, 3u, 0u, 12u, 2u },
{ 1000u, 2u, 0u, 14u, 3u }, /* 83.3% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_36MHZ */
/*
* 35 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_35MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 35MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u,175u, 8u, 8u, 3u }, /* 85% */
{ 20u,125u, 3u, 8u, 2u }, /* 85,7% */
# endif
{ 50u, 35u, 8u, 8u, 3u }, /* 85% */
{ 100u, 25u, 3u, 8u, 2u }, /* 85,7% */
{ 125u, 14u, 8u, 8u, 3u }, /* 85% */
{ 250u, 7u, 8u, 8u, 3u }, /* 85% */
{ 500u, 5u, 3u, 8u, 2u }, /* 85,7% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_35MHZ */
/*
* 32 MHz table
*/
#ifdef CODRV_CANCLOCK_32MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 32MHz table, prescaler 10bit (max 1024) */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u,200u, 0, 13u, 2u },
{ 20u,100u, 0, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 40u, 0, 13u, 2u },
{ 100u, 20u, 0, 13u, 2u },
{ 125u, 16u, 0, 13u, 2u },
{ 250u, 8u, 0, 13u, 2u },
{ 500u, 4u, 0, 13u, 2u },
{ 800u, 5u, 0, 6u, 1u },
{ 1000u, 2u, 0, 13u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_32MHZ */
/*
* 30 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_30MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 30MHz table, prescaler 10bit (max 1024) */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u,200u, 0u, 12u, 2u },
{ 20u,100u, 0u, 12u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 40u, 0u, 12u, 2u },
{ 100u, 20u, 0u, 12u, 2u },
{ 125u, 16u, 0u, 12u, 2u },
{ 250u, 8u, 0u, 12u, 2u },
{ 500u, 4u, 0u, 12u, 2u },
{ 1000u, 2u, 0u, 12u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_30MHZ */
/*
* 25 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_25MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 25MHz table, prescaler 10bit (max 1024) */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 125u, 0u, 16u, 3u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 20u, 50u, 0u, 16u, 8u },
{ 50u, 25u, 0u, 16u, 3u },
{ 100u, 10u, 0u, 16u, 8u },
{ 125u, 10u, 0u, 16u, 3u },
{ 250u, 5u, 0u, 16u, 3u },
{ 500u, 2u, 0u, 16u, 8u },
{ 1000u, 1u, 0u, 16u, 8u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_25MHZ */
#ifdef CODRV_CANCLOCK_24MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* e.g. 24MHz table, prescaler 10bit (max 1024)
* own values you can find on www.bittiming.can-wiki.info
*/
/* brate, pre, prop, seg1, seg2 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 150u, 0u, 13u, 2u },
{ 20u, 75u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 50u, 30u, 0u, 13u, 2u },
{ 100u, 15u, 0u, 13u, 2u },
{ 125u, 12u, 0u, 13u, 2u },
{ 250u, 6u, 0u, 13u, 2u },
{ 500u, 3u, 0u, 13u, 2u },
{ 1000u, 2u, 0u, 9u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_24MHZ */
/*
* 20 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_20MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 20MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 125u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 20u, 50u, 0u, 16u, 3u }, /* !! 85% */
{ 50u, 25u, 0u, 13u, 2u },
{ 100u, 10u, 0u, 16u, 3u }, /* !! 85% */
{ 125u, 10u, 0u, 13u, 2u },
{ 250u, 5u, 0u, 13u, 2u },
{ 500u, 2u, 0u, 16u, 3u }, /* !! 85% */
{ 1000u, 1u, 0u, 16u, 3u }, /* !! 85% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_20MHZ */
/*
* 18 MHz table
*
* Samplepoint is not on 87.5%.
*/
#ifdef CODRV_CANCLOCK_18MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 18MHz table, prescaler 10bit (max 1024) */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u, 100u, 0u, 15u, 2u }, /* 88.9% */
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 20u, 50u, 0u, 15u, 2u }, /* 88.9% */
{ 50u, 18u, 0u, 16u, 3u }, /* 85.0% */
{ 100u, 12u, 0u, 12u, 2u }, /* 86.7% */
{ 125u, 9u, 0u, 13u, 2u },
{ 250u, 4u, 0u, 15u, 2u }, /* 88.9% */
{ 500u, 2u, 0u, 15u, 2u }, /* 88.9% */
{ 1000u, 1u, 0u, 15u, 2u }, /* 88.9% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_18MHZ */
/*
* 16 MHz table
*/
#ifdef CODRV_CANCLOCK_16MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 16MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
{ 10u,100u, 0u, 13u, 2u },
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 20u, 50u, 0u, 13u, 2u },
{ 50u, 20u, 0u, 13u, 2u },
{ 100u, 10u, 0u, 13u, 2u },
{ 125u, 8u, 0u, 13u, 2u },
{ 250u, 4u, 0u, 13u, 2u },
{ 500u, 2u, 0u, 13u, 2u },
{ 800u, 1u, 0u, 16u, 3u },
{ 1000u, 1u, 0u, 13u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_16MHZ */
/*
* 12 MHz table
*/
#ifdef CODRV_CANCLOCK_12MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 12MHz table, prescaler 7bit (max 127) + BRPE 4bit == 1024 */
# ifdef CODRV_CANCLOCK_PRE_10BIT
# endif /* CODRV_CANCLOCK_PRE_10BIT */
{ 10u, 75u, 0u, 13u, 2u },
{ 20u, 40u, 0u, 12u, 2u }, /* 86.7% */
{ 50u, 15u, 0u, 13u, 2u },
{ 100u, 8u, 0u, 12u, 2u }, /* 86.7% */
{ 125u, 6u, 0u, 13u, 2u },
{ 250u, 3u, 0u, 13u, 2u },
{ 500u, 2u, 0u, 9u, 2u }, /* 83.3% */
{ 800u, 1u, 0u, 12u, 2u }, /* 86.7% */
{ 1000u, 1u, 0u, 9u, 2u }, /* 83.3% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif /* CODRV_CANCLOCK_12MHZ */
#ifdef CODRV_CANCLOCK_8MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 8MHz table, prescaler 6bit (max 64) + BRPE 4bit == 1024 */
{ 10u, 50u, 0u, 13u, 2u },
{ 20u, 25u, 0u, 13u, 2u },
{ 50u, 10u, 0u, 13u, 2u },
{ 100u, 5u, 0u, 13u, 2u },
{ 125u, 4u, 0u, 13u, 2u },
{ 250u, 2u, 0u, 13u, 2u },
{ 500u, 1u, 0u, 13u, 2u },
{ 800u, 1u, 3u, 4u, 2u }, /* 80% */
{ 1000u, 1u, 3u, 2u, 1u }, /* 75% */
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif
#ifdef CODRV_CANCLOCK_4MHZ
CO_CONST CODRV_BTR_T codrvCanBittimingTable[] = {
/* 4MHz table */
{ 10u, 20u, 0u, 16u, 3u },
{ 20u, 10u, 0u, 16u, 3u },
{ 50u, 4u, 0u, 16u, 3u },
{ 100u, 2u, 0u, 16u, 3u },
{ 125u, 2u, 0u, 13u, 2u },
{ 250u, 1u, 0u, 13u, 2u },
{ 0u, 0u, 0u, 0u, 0u } /* last */
};
#endif
#endif /* CODRV_BIT_TABLE_EXTERN */

View File

@ -0,0 +1,210 @@
/*
* error state handler
*
* Copyright (c) 2012-2023 emotas embedded communication GmbH
*-------------------------------------------------------------------
* $Id: codrv_error.c 47801 2023-07-06 14:39:17Z ro $
*
*
*-------------------------------------------------------------------
*
*
*/
/********************************************************************/
/**
* \file
* \brief error state handling
*
*/
/* header of standard C - libraries
---------------------------------------------------------------------------*/
#include <stddef.h>
/* header of project specific types
---------------------------------------------------------------------------*/
#include <gen_define.h>
#include <co_datatype.h>
#include <co_commtask.h>
#include <co_drv.h>
#include "codrv_error.h"
/* constant definitions
---------------------------------------------------------------------------*/
/* local defined data types
---------------------------------------------------------------------------*/
/* list of external used functions, if not in headers
---------------------------------------------------------------------------*/
/* list of global defined functions
---------------------------------------------------------------------------*/
/* list of local defined functions
---------------------------------------------------------------------------*/
/* external variables
---------------------------------------------------------------------------*/
/* global variables
---------------------------------------------------------------------------*/
static CAN_ERROR_FLAGS_T canErrorFlags[CO_LINE_ARRAY_DECL];
/* local defined variables
---------------------------------------------------------------------------*/
/***************************************************************************/
/**
* \brief codrvCanErrorgetFlags - Reference to the error flags
*
* \retval
* pointer to error flags
*
*/
CAN_ERROR_FLAGS_T * codrvCanErrorGetFlags(
CO_LINE_TYPE CO_LINE /**< can line */
)
{
return(&canErrorFlags[CO_LINE]);
}
/***************************************************************************/
/**
* \brief codrvCanErrorInit - init Error variables
*
*/
void codrvCanErrorInit(
CO_LINE_TYPE CO_LINE /**< can line */
)
{
CAN_ERROR_FLAGS_T * pError;
pError = codrvCanErrorGetFlags(CO_LINE);
pError->canErrorRxOverrun = CO_FALSE;
pError->canErrorPassive = CO_FALSE;
pError->canErrorActive = CO_FALSE;
pError->canErrorBusoff = CO_FALSE;
pError->drvErrorGeneric = CO_FALSE;
pError->canOldState = Error_Offline; /* last signaled state */
}
/***********************************************************************/
/**
* codrvCanErrorInformStack - inform the stack about changes
*
* Call outside of interrupts!
* Typical call in codrvCanDriverHandler().
*
*/
RET_T codrvCanErrorInformStack(
CO_LINE_TYPE CO_LINE /**< can line */
)
{
CAN_ERROR_FLAGS_T * pError;
pError = codrvCanErrorGetFlags(CO_LINE);
if (pError->canErrorRxOverrun == CO_TRUE) {
/* CAN Overrun */
pError->canErrorRxOverrun = CO_FALSE;
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_CAN_OVERRUN);
}
if (pError->drvErrorGeneric == CO_TRUE) {
/* general driver error */
pError->drvErrorGeneric = CO_FALSE;
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_DRV_ERROR);
}
/* signal CAN Error changed events
* (Active <-> Passive -> Busoff -> Active)
*/
if ((pError->canNewState == Error_Busoff)
|| (pError->canErrorBusoff == CO_TRUE))
{
if (pError->canOldState == Error_Active) {
/* Passive event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_PASSIVE);
}
if (pError->canOldState != Error_Busoff) {
/* Busoff event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_BUS_OFF);
}
}
if ((pError->canOldState == Error_Busoff)
|| (pError->canOldState == Error_Offline)
|| (pError->canErrorBusoff == CO_TRUE))
{
if (pError->canNewState == Error_Passive) {
/* Active event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_ACTIVE);
/* Passive event*/
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_PASSIVE);
}
}
if ((pError->canOldState == Error_Active)
&& (pError->canNewState == Error_Passive)
&& (pError->canErrorBusoff == CO_FALSE))
{
/* Passive event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_PASSIVE);
}
if ((pError->canOldState == Error_Active)
&& (pError->canNewState == Error_Active))
{
if (pError->canErrorBusoff == CO_TRUE) {
/* Active event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_ACTIVE);
} else
if (pError->canErrorPassive == CO_TRUE) {
/* Passive event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_PASSIVE);
/* Active event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_ACTIVE);
} else {
/* nothing */
}
}
/* if ((pError->canOldState == Error_Passive)
|| (pError->canOldState == Error_Busoff)
|| (pError->canOldState == Error_Offline)) */
if (pError->canOldState != Error_Active)
{
if (pError->canNewState == Error_Active) {
/* Active event */
coCommStateEvent(CO_LINE, CO_COMM_STATE_EVENT_ACTIVE);
}
}
pError->canErrorPassive = CO_FALSE;
pError->canErrorActive = CO_FALSE;
pError->canErrorBusoff = CO_FALSE;
pError->canOldState = pError->canNewState;
return(RET_OK);
}

View File

@ -0,0 +1,57 @@
/*
* codrv_error.h
*
* Copyright (c) 2012-2023 emotas embedded communication GmbH
*-------------------------------------------------------------------
* SVN $Id: codrv_error.h 51612 2023-12-19 17:23:36Z ro $
*
*
*-------------------------------------------------------------------
*
*
*/
/********************************************************************/
/**
* \file
* \brief can error handling
*
*/
#ifndef CODRV_ERROR_H
#define CODRV_ERROR_H 1
/** CAN controller state */
typedef enum {
Error_Offline, /**< disabled */
Error_Active, /**< Error Active */
Error_Passive, /**< Error Passive */
Error_Busoff /**< Error bus off */
} CAN_ERROR_STATES_T;
/** CAN state event collection structure */
typedef struct {
BOOL_T canErrorRxOverrun; /**< CAN controller overrun */
BOOL_T canErrorPassive; /**< CAN Passive event occured */
BOOL_T canErrorActive; /**< CAN active event occured */
BOOL_T canErrorBusoff; /**< CAN busoff event occured */
BOOL_T drvErrorGeneric; /**< CAN for generic errors */
CAN_ERROR_STATES_T canOldState; /**< last signaled state */
CAN_ERROR_STATES_T canNewState; /**< current state */
} CAN_ERROR_FLAGS_T;
/* externals
*--------------------------------------------------------------------------*/
/* function prototypes
*--------------------------------------------------------------------------*/
CAN_ERROR_FLAGS_T * codrvCanErrorGetFlags(CO_LINE_DECL);
void codrvCanErrorInit(CO_LINE_DECL);
RET_T codrvCanErrorInformStack(CO_LINE_DECL);
#endif /* CODRV_ERROR_H */

View File

@ -0,0 +1,318 @@
/*
* cpu_linux.c - contains driver for linux
*
* Copyright (c) 2012-2023 emotas embedded communication GmbH
*-------------------------------------------------------------------
* $Id: cpu_linux.c 54592 2024-07-08 13:01:02Z hil $
*
*
*-------------------------------------------------------------------
*
*
*/
#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__)
/********************************************************************/
/**
* \file
* \brief cpu functionality for linux system
*
* LINUX_SIGNAL_TIMER
* signal 34 interrupt functions like usleep() or sleep()
*
* LINUX_THREAD_TIMER
* compile with -pthread
* Please note, that the Thread Timer accuracy is depend from the cpu load.
* In our tests a 1 second Stack timer jitter between 0.78s and 1.24s.
*/
/* header of standard C - libraries
---------------------------------------------------------------------------*/
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <signal.h>
#include <time.h>
#include <sys/time.h>
#include <pthread.h>
/* header of project specific types
---------------------------------------------------------------------------*/
#include <gen_define.h>
#include <co_datatype.h>
#include <co_timer.h>
#include <co_drv.h>
/* constant definitions
---------------------------------------------------------------------------*/
/* set default */
#if defined(LINUX_THREAD_TIMER) || defined(THREAD_SPAWN)
#else /* defined(LINUX_THREAD_TIMER) || defined(THREAD_SPAWN) */
# define LINUX_SIGNAL_TIMER 1
#endif /* defined(LINUX_THREAD_TIMER) || defined(THREAD_SPAWN) */
#define SIG SIGRTMIN
#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \
} while (0)
/* local defined data types
---------------------------------------------------------------------------*/
/* list of external used functions, if not in headers
---------------------------------------------------------------------------*/
/* list of global defined functions
---------------------------------------------------------------------------*/
void codrvHardwareInit(void);
/* list of local defined functions
---------------------------------------------------------------------------*/
#ifdef LINUX_SIGNAL_TIMER
static void timerInt (int sig, siginfo_t *si, void *uc);
#endif /* LINUX_SIGNAL_TIMER */
#ifdef THREAD_SPAWN
static void timerIntSpawnedThread(sigval_t sival);
#endif /* THREAD_SPAWN */
/* external variables
---------------------------------------------------------------------------*/
/* global variables
---------------------------------------------------------------------------*/
/* local defined variables
---------------------------------------------------------------------------*/
/***************************************************************************/
/**
* \brief codrvHardwareInit - hardware initialization
*
* This function initialize the hardware, incl. Clock and CAN hardware.
*/
void codrvHardwareInit(void)
{
/* normally nothing to do */
}
/***************************************************************************/
/**
* \brief codrvCanEnableInterrupt - enable the CAN interrupt
*
*/
void codrvCanEnableInterrupt(
CO_LINE_TYPE CO_LINE /**< can line */
)
{
/* enable CAN interrupts */
(void)(CO_LINE);
}
/***************************************************************************/
/**
* \brief codrvCanDisableInterrupt - disable the CAN interrupt
*
*/
void codrvCanDisableInterrupt(
CO_LINE_TYPE CO_LINE /**< can line */
)
{
/* disable CAN interrupts */
(void)(CO_LINE);
}
#ifdef LINUX_SIGNAL_TIMER
/***************************************************************************/
/**
* \brief codrvTimerSetup - init Timer
*
* \param
* \results
* nothing
*/
RET_T codrvTimerSetup(
UNSIGNED32 timerInterval
)
{
timer_t timerid;
struct sigevent sev;
struct sigaction sa;
struct itimerspec its;
/* Establish handler for timer signal */
printf("Establishing handler for signal %d\n", SIG);
sa.sa_flags = SA_SIGINFO;
sa.sa_sigaction = timerInt;
sigemptyset(&sa.sa_mask);
if (sigaction(SIG, &sa, NULL) == -1) {
return(RET_INTERNAL_ERROR);
}
/* Create the timer */
sev.sigev_notify = SIGEV_SIGNAL;
sev.sigev_signo = SIG;
sev.sigev_value.sival_ptr = &timerid;
if (timer_create(CLOCK_REALTIME, &sev, &timerid) == -1) {
return(RET_INTERNAL_ERROR);
}
printf("timer ID is 0x%lx\n", (long) timerid);
/* Start the timer (value is in usec */
its.it_value.tv_sec = timerInterval / 1000000;
its.it_value.tv_nsec = (timerInterval % 1000000) * 1000;
its.it_interval.tv_sec = its.it_value.tv_sec;
its.it_interval.tv_nsec = its.it_value.tv_nsec;
if (timer_settime(timerid, 0, &its, NULL) == -1) {
return(RET_INTERNAL_ERROR);
}
return(RET_OK);
}
/***************************************************************************/
/**
* \internal
*
* \brief timerInt - timer interrupt
*
* \param
* \results
* nothing
*/
void timerInt (
int sig,
siginfo_t *si,
void *uc
)
{
(void)sig;
(void)si;
(void)uc;
// printf("Caught signal %d\n", sig);
coTimerTick();
}
#endif /* LINUX_SIGNAL_TIMER */
#ifdef LINUX_THREAD_TIMER
void *coTimerThreadFn(void *x_void_ptr);
/***************************************************************************/
/**
* \brief codrvTimerSetup - init Timer
*
* \param
* \results
* nothing
*/
RET_T codrvTimerSetup(
UNSIGNED32 timerInterval
)
{
static __useconds_t interval = 0;
interval = timerInterval;
pthread_t inc_x_thread = 0;
if (inc_x_thread != 0) {
printf("ERROR: resetting the CANopen timre not (yet) supported\n");
return(RET_INTERNAL_ERROR);
}
pthread_create(&inc_x_thread, NULL, coTimerThreadFn, &interval);
return(RET_OK);
}
/* thread timer callback */
void *coTimerThreadFn(void *x_void_ptr)
{
struct timeval tv;
static uint64_t l_time_usec_last=0;
__useconds_t interval = *(__useconds_t*)x_void_ptr;
while(1) {
gettimeofday(&tv, NULL);
uint64_t l_time_usec = (uint64_t)(tv.tv_sec) * (uint64_t)1000000ul + (uint64_t)(tv.tv_usec);
if (l_time_usec_last == 0) {
/* initialization */
l_time_usec_last = l_time_usec;
}
if (l_time_usec_last > l_time_usec) {
/* time decrease - was system time changed? */
l_time_usec_last = l_time_usec;
coTimerTick();
} else
if ((l_time_usec - l_time_usec_last) / (uint64_t)interval > 10u) {
/* too many time - was system time changed? */
l_time_usec_last = l_time_usec;
coTimerTick();
}
while (l_time_usec > (l_time_usec_last + (uint64_t)interval)) {
coTimerTick();
l_time_usec_last += (uint64_t)interval;
}
usleep(interval);
}
return(x_void_ptr);
}
#endif /* LINUX_THREAD_TIMER */
#ifdef THREAD_SPAWN
RET_T codrvTimerSetup(
UNSIGNED32 timerInterval
)
{
timer_t timerid;
struct sigevent sev;
struct itimerspec its;
/* Create the timer */
sev.sigev_notify = SIGEV_THREAD;
sev.sigev_signo = 0;
sev.sigev_value.sival_int = 0;
sev.sigev_notify_function = timerIntSpawnedThread;
sev.sigev_notify_attributes = 0;
if (timer_create(CLOCK_MONOTONIC, &sev, &timerid) == -1) {
return(RET_INTERNAL_ERROR);
}
printf("timer ID is 0x%lx\n", (long) timerid);
/* Start the timer (value is in usec */
its.it_value.tv_sec = timerInterval / 1000000;
its.it_value.tv_nsec = (timerInterval % 1000000) * 1000;
its.it_interval.tv_sec = its.it_value.tv_sec;
its.it_interval.tv_nsec = its.it_value.tv_nsec;
if (timer_settime(timerid, 0, &its, NULL) == -1) {
return(RET_INTERNAL_ERROR);
}
return(RET_OK);
}
static void timerIntSpawnedThread(
sigval_t sival
)
{
coTimerTick();
}
#endif /* THREAD_SPAWN */
#endif /* defined(linux) || defined(__linux) || defined(__linux__) || defined(__gnu_linux__) */

View File

@ -0,0 +1,40 @@
STM32H7 hardware depend part
==========================
Please set the device dependend define in the device designer.
CODRV_MCAN_CFG_VER_1
CODRV_MCAN_STM32_H7
CODRV_MCAN_CFG_VER_2
CODRV_MCAN_STM32_L5
CODRV_MCAN_STM32_G4
CODRV_MCAN_CFG_VER_3
CODRV_MCAN_STM32_MP1
codrv_mcan - CAN driver
codrv_canbittiming - additional bittimings
codrv_error - error handling
There are different examples for hardware initialization.
Compile and adapt only one of it!
cpu_stm32h7xx* - hardware initialization
cpu_stm32h7xx_atollic8 - STM32H743, Atollic8, ST HAL, CAN1
Use of additional bittimings:
=============================
- set CODRV_BIT_TABLE_EXTERN
depend of the Peripherie clock
- set CODRV_CANCLOCK_80MHZ
(please check the src included tables)
Debug functionality
===================
can_printf.c - send printf information over CAN
printf.js - script for CDE to see the printf information

Some files were not shown because too many files have changed in this diff Show More