View previous topic :: View next topic |
Author |
Message |
wolfie840ca
Joined: 15 Mar 2018 Posts: 10
|
How to clear the screen in the CCS Serial Monitor |
Posted: Sat May 05, 2018 7:55 am |
|
|
Hi there. Does anyone know how to send (perhaps) some escape sequences from a set of printf statements to the CCS serial port to clear the screen, set the cursor to a specific line, etc? |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Sat May 05, 2018 9:21 am |
|
|
I believe the character you are looking for is '\f' _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
wolfie840ca
Joined: 15 Mar 2018 Posts: 10
|
|
Posted: Sat May 05, 2018 11:38 am |
|
|
I tried '\f' and "\f". The screen still does not clear. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sat May 05, 2018 1:20 pm |
|
|
This is what I use to clear and home the cursor.
Code: | printf("\033[2J");
printf("\033[H"); |
BTW, I have to add about 150ms after to give the terminal time to respond. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
wolfie840ca
Joined: 15 Mar 2018 Posts: 10
|
|
Posted: Sat May 05, 2018 1:57 pm |
|
|
I tried the suggestion you posted. It did not work. Where did you get this information anyways? |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Sat May 05, 2018 2:24 pm |
|
|
They are Esc sequences for the VT100 terminal. Available lots of places online.
I have used these lots of times with no issues except when I omitted the delay early on.
I use these for the CCS Serial port monitor and other transmissions to serial displays. _________________ Google and Forum Search are some of your best tools!!!! |
|
|
wolfie840ca
Joined: 15 Mar 2018 Posts: 10
|
|
Posted: Sat May 05, 2018 3:50 pm |
|
|
I tried the following puts and printf which did not work:
#define ASCII_ESC 27
void clear_terminal_screen()
{
//printf("In Clear Terminal Screen\r\n");
puts( "\033[2J" );
puts( "\033[H" );
//printf( "%c[2J", ASCII_ESC );
//printf( "%c[H", ASCII_ESC );
delay_ms(500);
} |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Sat May 05, 2018 6:20 pm |
|
|
The commands ( aka escape sequences ) to control a 'screen' depend upon what the 'screen' is.
The VT100 was a common terminal made by DEC ,something like 4 decades ago....sigh. I still have a pocket card here.
Nowadays a PC can emulate a VT100, through a 'terminal program' so we'd need to know what the 'screen' is you have. Whoever is the mfr of it should have a list of commands, etc. on how to use it. If you're using a PC terminal program, it may 'emulate' a dozen of more 'screens' and some may not follow or use the VT100 'pseudo standard' escape sequences. |
|
|
wolfie840ca
Joined: 15 Mar 2018 Posts: 10
|
|
Posted: Sat May 05, 2018 7:34 pm |
|
|
I am using the standard CCS Serial Input/Output Monitor that is part of their IDE. There are no options in the Configuration menu to check what terminal it emulates. I am very familiar with the VT-100 terminals from Digital. I will send CCS a ticket to the Tech Support to see if they have more infos on that topic.
Thank you all for your help. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
|
|
Posted: Sun May 06, 2018 8:33 am |
|
|
SIOW, is not a terminal emulator program.
It is a serial 'history display' program.
It doesn't have just a window which can be cleared, it shows everything received. You can go back tens of thousands of characters by just scrolling the display back.
It's whole aim is to allow you to go back and look at what was sent to you.
Hence it doesn't have 'terminal' commands.
If you want to use terminal commands, use a terminal emulator. PuTTY, TTYEmulator etc.. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9245 Location: Greensville,Ontario
|
|
Posted: Sun May 06, 2018 10:41 am |
|
|
Another terminal program is RealTerm. I've used it for years and has never failed me... |
|
|
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
|
|
Posted: Sun May 06, 2018 10:49 am |
|
|
Code: | fprintf (stream,"\f"); |
Has always worked for me in hyperterminal
Use it the same way as you would use \n or \r _________________ CCS PCM 5.078 & CCS PCH 5.093 |
|
|
wolfie840ca
Joined: 15 Mar 2018 Posts: 10
|
|
Posted: Sun May 06, 2018 11:13 am |
|
|
Ttelmah pointed out to me that "Serial Monitor is a serial 'history display' program." and not a terminal emulator. I tried using HyperTerminal and the ESC [2J escape sequence cleared the screen. Thanks a lot to everyone who tried to help me.
PROBLEM IS SOLVED.
Sylvain |
|
|
wolfie840ca
Joined: 15 Mar 2018 Posts: 10
|
|
Posted: Wed May 09, 2018 6:52 am |
|
|
CCSInfo tech Support told me that their Serial Monitor used to have VT-100 escape sequence capabilities but they took this functionality out. They sent me a version that has VT-100 functionality built-in and it works.
Also as many of you suggested, using Hyperterminal also works.
Thank you all. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
|
|
Posted: Wed May 09, 2018 7:30 am |
|
|
Actually that is really silly. Though it is nice to be able to look at the 'raw' data. there really ought to be an option to enable 'terminal mode' especially if they have the basic code already written. Suggest this to them. |
|
|
|