[help] -custom analyzer development

when development a custom anaylzyer for saleae, there are two question:

  1. is there any method to connect the ‘sample number’ of the analyzer side and the ''time line spot" of the saleae gui. for example, when dev the analyzer, we call mCLK.GetSampleNumber() to get the source sample posion, but where is it at the saleae GUI?

  2. how to output debug message to the console of launching saleae.exe?
    i currentlly output debug message using OutputDebugString() in Windows. but i see

Environment
  Executable path: E:\Program\Logic2\Logic.exe
  Executable directory: E:\Program\Logic2
  Original working directory: E:\Work\Firmware\saleae\2024\SLE44xxAnalyzer\build
  Current working directory: E:\Program\Logic2
  Process ID: 15756
Crash reporting enabled. Machine ID: a9b9bbb5-7aec-4738-9039-66be701a073f
[2024-08-15 19:46:41.465108] [C] [tid   4456] [main] [saleae_log.cpp:296] Global logging level is set to: debug
... ...

when i launch saleae.exe from a console. i think, this maybe a more useful channel to show debug message when dev a cusom analyzer.

any suggestion?

Re #1: See the GetTimeString() helper function from the SampleAnalyzer API docs on GitHub. This function will calculate the timestamp for a given sample point (as a string) based on the GetTriggerSample() and the GetSampleRate() functions. Note: this provides a result only as a text string, not as a numeric value.

Re #2: I’m not sure if you can output directly to console; you can see the SampleAnalyzer readme.md file for some other debugging suggestions. For High-Level Analyzers (HLAs), you can output python print() statements to the in-app terminal view, as per the HLA Debugging Tips on Saleae’s support pages.

Unfortunately for your request, I think the command-line console output might be used by Saleae to provide their own internal debug & logging information for the Logic application itself – at least that’s what I’m inferring based on a response in another thread discussing STDOUT and STDERR with the Python API.

Meanwhile, did you try sending to stdout or stderr (using fprintf() from <cstdio>) and/or to std::cout or std::cerr (via <iostream>)? Otherwise, hopefully Saleae can comment on best practice recommendations and whether your requested feature is actually supported :slight_smile: