CoolTerm automated Arduino serial data auto capturing

If you have specific questions or problems with any of my Freeware applications, post them here.
Post Reply
kerboxy
Posts: 2
Joined: Thu Nov 07, 2024 2:28 pm

CoolTerm automated Arduino serial data auto capturing

Post by kerboxy »

Hello,

I'm really feared to ask that question here, but I tried and searched hard before I generated my first topic EVER!

Here my problem:
A physical pressure test device for material testing is started with a physical button on the Arduino and stops after the test cycle.
The test cycle can be restarted by pushing the button again.

During the test cycle time [ms] and pressure [Pa] data is generated and sent serial. It can be received, displayed as text or graph and saved easily with CoolTerm.

My plan was start and end auto capturing with inital words/characters at the beginning and at the end of the serial data stream. Additional the captured data shall be directly saved with timestaped.txt file.
Data from each test cycle shall be saved in an separate file.

In CoolTerm/Options/File Capture seems everything prepared for my plan but I really don't get it to run.

May someone can help me.....

Thanks
User avatar
roger
Site Admin
Posts: 485
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: CoolTerm automated Arduino serial data auto capturing

Post by roger »

Hi,

capturing data to file has to be started (and stopped) manually via the GUI. Optionally, you can have the capture automatically start when you load your settings.

There currently isn't an option to trigger the start or stop of a capture based on the contents of the received data.

However, CoolTerm is scriptable. You could possible write a script (e.g. Python) that monitors the received data and start a capture that way.

I hope this helps.

Roger
kerboxy
Posts: 2
Joined: Thu Nov 07, 2024 2:28 pm

Re: CoolTerm automated Arduino serial data auto capturing

Post by kerboxy »

Hello Roger!
Thanks for the answer. No idea how to catch that with a script, I will try.
best regards
Kerb
User avatar
roger
Site Admin
Posts: 485
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: CoolTerm automated Arduino serial data auto capturing

Post by roger »

You can use the LookAhead scripting command to peek what's in the receive buffer and see if the trigger word to start the capture is present. Then there is another command you can the CaptureStart command to start your file capture. You will have to implement your Arduino such that there is a certain amount of time between the command to trigger the start of the capture and when the data to be captured begins. By the time your script can see what's been received with LookAhead, it would have already been written to an active capture. Thus, if the data immediately follows the trigger word, you would miss part of the data before it starts being capture to file. But if the script runs in a somewhat tight loop, and checks the receive buffer frequently, 1 or 2 seconds delay between trigger word and data should suffice.

To stop the capture based on another trigger word should be straight forward too. Simply look for that trigger word in the received data and stop the capture with the the CaptureStop command. The trigger word will be part of what's been capture to file. There is no way around that, unless your script removes it from the file.

I hope this makes sense.

Meanwhile, I'm working on a concept for a future release that might solve your problem without having to resort to scripting.
User avatar
roger
Site Admin
Posts: 485
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: CoolTerm automated Arduino serial data auto capturing

Post by roger »

kerboxy wrote: Sat Nov 09, 2024 9:34 am Hello Roger!
Thanks for the answer. No idea how to catch that with a script, I will try.
best regards
Kerb
Hi Kerb,

have you had any luck with this?

Meanwhile, I have a preliminary concept that might work for what you need. Please let me know if you're interested in testing it.

Roger
Post Reply