Support Question of the Week: What are the Available Software API Examples for the Komodo CAN Duo Interface and How Can I Execute Commands on Different Threads?
I'm starting to use the KomodoTM Duo Interface. I need to create some programs to run tests on prototype devices for a CAN bus. I have a couple of questions:
- Do you have any Komodo software examples in C#?
- Can the commands km_can_read and km_can_write be simultaneously executed from different threads?
Thanks for your questions! Software examples can be downloaded from KomodoTM Software API. C#, as well as C Python, .NET, VB.NET, and VB6 are also supported. C# program examples include the following:
- detect: Detect Komodo devices attached to the system.
- async: Use the asynchronous interface to send packets on CAN channel A.
- gpio: Perform simple GPIO operations with a Komodo interface, including monitoring the pins for voltage changes.
- loopback: A demonstration to to open ports, acquire features, write and read data. This example requires that CAN channels A and B are connected together with a properly-terminated cable. Please note: this example only applies to the Komodo CAN Duo Interface; it will not work with the Komodo CAN Solo interface.
- monitor: Monitor CAN bus and GPIO activity. This program prints out timestamps, status messages, errors messages, and data.
- request: Request data from specified CAN ID and prints the received data.
Figure 1: Komodo CAN Duo Interface
Since the Komodo CAN Duo interface has two virtual ports, the commands km_can_read and km_can_write can definitely be executed simultaneously from different threads. To execute km_can_read and km_can_write from the same port, the following actions will be required:
- Synchronization
- Wrap each Komodo API call with a thread-safe locking mechanism before and after invocation.
For details about threading, please refer to section 3.8.3 of the Komodo Interface User Manual. For details about using Komodo Software API, please refer to section 5 of the Komodo Interface User Manual.
For additional information, please refer to the following documents:
We hope this answers your question. If you have other questions about our Komodo Interface analyzers or other Total Phase products, feel free to email us at sales@totalphase.com or submit a request for technical support.