Skip to content

Cc 17 windows systec vendor#102

Open
parasxos wants to merge 63 commits intomasterfrom
CC-17_Windows-systec-vendor
Open

Cc 17 windows systec vendor#102
parasxos wants to merge 63 commits intomasterfrom
CC-17_Windows-systec-vendor

Conversation

@parasxos
Copy link
Copy Markdown

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds Windows support for the Systec USB-CANmodul vendor to the CAN module library. It introduces a new vendor implementation that uses the Systec Windows DLL (USBCAN64.lib/dll) to communicate with Systec USB-CAN hardware on Windows platforms, complementing the existing Linux SocketCAN Systec implementation.

Changes:

  • Added Windows-specific Systec vendor implementation with receive thread handling
  • Integrated Systec vendor into device factory with Windows platform guards
  • Configured CMake build system to include Systec headers and libraries on Windows

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 19 comments.

Show a summary per file
File Description
src/main/CanVendorSystec.cpp Core implementation of Windows Systec vendor with USB-CAN API integration
src/include/CanVendorSystec.h Header defining CanVendorSystec class with Windows threading primitives
src/main/CanDevice.cpp Added conditional compilation to register Systec vendor on Windows
CMakeLists.txt Added Systec source files to Windows build configuration
cmake/systec.cmake CMake configuration for Systec USB-CANmodul library paths

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@luismiguensfernandez
Copy link
Copy Markdown
Member

Dear @parasxos ,

Currently, the project no longer compiles. Besides all the noise from the copilot (with a significant amount of them being relevant), I see two big points (I did not enter into details of the implementation yet):

  • To join the thread, you seem to be using WaitForSingleObject, which is Windows-specific, but at the same time, you use the standard library (e.g., std::mutex). Is there any constraint from Systec that forces you to use the Windows API, I think it is cleaner to use the standard library always.
  • I see no testing at all. Please create some testing. You could base your implementation on the existing Anagate tests: (https://github.com/quasar-team/CanModule/blob/master/test/python/test_anagate.py) and remove/add everything you consider relevant.
  • We will need a mini-PC and a Systec device to perform the tests automatically; I will need to check in the lab, as we could reuse one, if it supports Windows 11, but we still need a device dedicated to the pipeline, for example: https://phytools.com/products/sys-tec-usb-canmodul2-dual-can-opto-isolated, As far as I know, we only have a small PEAK around the lab.
  • We were in discussions with Anagate to provide a .lib that we could compile statically, and not a placeholder for an external DLL, as Ben and I would like to avoid the need to redistribute DLLs with the OPC Servers. Do you know if that is possible with Systec? In Linux, we already link statically, so we don't need to redistribute any anagate*.so
  • Out of curiosity, who is requesting Systec on Windows --- last time I asked, I was met with absolute silence, and Ben never included Systec/Windows support in any of the OPC UA Servers

Thanks and regards,

Luis

@jsouter
Copy link
Copy Markdown

jsouter commented Feb 27, 2026

Currently, the project no longer compiles.

I have some changes on my local environment which provide the necessary header and library paths to compile, but with the expectation that USBCAN-modul Utility Disk is already installed, I am looking into ways to install it through cmake though I haven't yet figured out how to do this non-graphically.

Is there any constraint from Systec that forces you to use the Windows API, I think it is cleaner to use the standard library always.

I agree and will investigate, largely this code is adapted from an older branch of CanModule

  • We were in discussions with Anagate to provide a .lib that we could compile statically, and not a placeholder for an external DLL, as Ben and I would like to avoid the need to redistribute DLLs with the OPC Servers. Do you know if that is possible with Systec? In Linux, we already link statically, so we don't need to redistribute any anagate*.so

I'm not aware of a version of the utility that comes with a static build but I will look into it

@jsouter jsouter force-pushed the CC-17_Windows-systec-vendor branch from 86b7d2a to 14dcce4 Compare March 17, 2026 10:01
@jsouter jsouter force-pushed the CC-17_Windows-systec-vendor branch from 14dcce4 to 8d1624b Compare March 17, 2026 12:31
Copy link
Copy Markdown
Member

@luismiguensfernandez luismiguensfernandez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for your changes. I scan a bit, and I have some comments

file(COPY "${anagate_SOURCE_DIR}/Win64/AnaGateCan64.dll"
DESTINATION "${CMAKE_BINARY_DIR}/Release")

if ("${CANMODULE_BUILD_SYSTEC_WINDOWS}" STREQUAL ON)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is systec planned to be supported also in the power supplies and/or several OPC Servers? or is it only a single-case? The answer will tell us if having a variable to activate that part of the build is good or bad idea.

# reason="This test module is only for Windows environments.",
# )

pytestmark = pytest.mark.skipif(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If your activities are planned to be merged into the master, we will need to set up the machine and a 2-port system in our lab.

@jsouter jsouter force-pushed the CC-17_Windows-systec-vendor branch 2 times, most recently from ab8e721 to 9362dba Compare April 8, 2026 12:03
@jsouter jsouter force-pushed the CC-17_Windows-systec-vendor branch from 4d93302 to b53784c Compare April 8, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants