I2C SPI USB CAN eSPI Cable Testing View All Quick Start Guides User Manuals Software Downloads Knowledge Base Videos Case Studies App Notes White Papers Sales Support About Us
Products Blog Sales Support Contact Search
How Do I Send a Command for the Komodo CAN Duo Interface to Wait for a Reply Message?
Rena Ayeras

Question from the Customer:

I’m using the Komodo CAN Duo Interface with the Komodo GUI Software I have a question about pause commands – is there a way to "wait for CAN reply message" in the batch script mode? I see a "send" command, but no associated "receive" command.

Response from Technical Support:

Thanks for your question! There are two methods for programming the Komodo interface: batch scripts and Komodo Software API.

Batch Script Overview

The Batch Mode (provided with Komodo GUI Software) is designed for creating and executing batch scripts for sending arbitrary CAN packets. The Batch Mode editor uses Python syntax; local variables can be defined, control structures can be used, and comments starting with a hash character (#) can be inserted as well. An example of the dialog is shown below.

Komodo GUI batch dialog Komodo GUI batch dialog

For more information, please refer to the section Batch Mode in the Komodo GUI Software User Manual.  Also, you can view all the Batch Mode commands through the Batch Mode panel of the Komodo GUI application.

For more advanced scripts, we recommend using the Komodo Software API.

Komodo Software API Advantages

The Komodo Software API supports many programming languages, including Python. Examples are provided that can be used as-is or modified for your specifications.

For pausing the script, "wait for CAN reply message", you can use the command km_sleep_ms, which provides the desired wait in the specified milliseconds.

Sleep (km_sleep_ms)

u32 km_sleep_ms (u32 milliseconds);

Sleep for given amount of time.Arguments

milliseconds   number of milliseconds to sleepReturn Value

This function returns the number of milliseconds slept.Specific Error Codes

None.Details

This function provides a convenient cross-platform function to sleep the current thread using standard operating system functions.The accuracy of this function depends on the operating system scheduler. This function will return the number of milliseconds that were actually slept.

For more information, please refer to the API Documentation section in the Komodo CAN Interface User Manual.

Additional resources that you may find helpful include the following:

If you have more questions or want additional information about Total Phase tools, please email us your questions.  You can also request a demo that is specific to your application.