Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:12 01 Aug 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Pipe functionality

Author Message
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 01:43am 18 Oct 2020
Copy link to clipboard 
Print this post

Can anyone suggest a way in which I can 'pipe' the console output to a string variable?

Eg. if I want to send the output of an OPTION LIST command to a variable?

I know I can capture it with teraterm or similar but I would like to be able to do it internally in MMBasic.

Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1132
Posted: 04:01am 18 Oct 2020
Copy link to clipboard 
Print this post

I was thinking similar.

If we knew where the serial transmit buffer was in memory, we could peek into it immediately after "OPTION LIST"
Visit Vegipete's *Mite Library for cool programs.
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1427
Posted: 04:17pm 18 Oct 2020
Copy link to clipboard 
Print this post

That would be a really nice feature.
Micromites and Maximites! - Beginning Maximite
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10310
Posted: 04:22pm 18 Oct 2020
Copy link to clipboard 
Print this post

Use MM.INFO(OPTION option). If any options that make sense are missing I'll add them
 
panky

Guru

Joined: 02/10/2012
Location: Australia
Posts: 1114
Posted: 12:09am 19 Oct 2020
Copy link to clipboard 
Print this post

Thanks Peter,

I was thinking of a more general usage. When I am developing a program, one of the tools I use to debug the program is to intersperse PRINT variable statements at strategic points so I can see what is going wrong

This works fine when connected to a PC - the console output shows these as well as error messages without screwing up the graphics display. In a standalone situation however, this is hard to achieve (I have used the method where I create a log file and dump the progress/error statements into that but it is messy and time consuming).

I was hoping there may be an easy method already available of diverting the console output to either a string/longstring or file for analysis on a temporary basis -  a bit like TRACE ON/TRACE OFF (and, in fact this would allow TRACE ON output to be collected for analysis).

Thanks for a great program and all the support you give,
Doug.
... almost all of the Maximites, the MicromMites, the MM Extremes, the ArmMites, the PicoMite and loving it!
 
MustardMan

Senior Member

Joined: 30/08/2019
Location: Australia
Posts: 175
Posted: 01:58am 19 Nov 2020
Copy link to clipboard 
Print this post

A few weeks ago I came across this video (about 20 minutes long) while looking for something else: Realtime debugging using serial decode

Although I've been doing embedded for more than two decades, it talks about an idea that I'd never even thought of: how to extract data from an embedded system without having to resort to pushing stuff to a console.

Sure, the data might not be as convenient as a nicely formatted string on a terminal emulator, but you can get the data out real-time if need be, and for debugging that can be a life saver.

I really don't like pushing videos, but this one was a real gem!

Cheers,
Edited 2020-11-19 13:33 by MustardMan
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025