CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

How to clear the screen in the CCS Serial Monitor
Goto page 1, 2  Next
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
wolfie840ca



Joined: 15 Mar 2018
Posts: 10

View user's profile Send private message Send e-mail

How to clear the screen in the CCS Serial Monitor
PostPosted: Sat May 05, 2018 7:55 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat May 05, 2018 9:21 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Sat May 05, 2018 11:38 am     Reply with quote

I tried '\f' and "\f". The screen still does not clear.
dyeatman



Joined: 06 Sep 2003
Posts: 1910
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat May 05, 2018 1:20 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Sat May 05, 2018 1:57 pm     Reply with quote

I tried the suggestion you posted. It did not work. Where did you get this information anyways?
dyeatman



Joined: 06 Sep 2003
Posts: 1910
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat May 05, 2018 2:24 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Sat May 05, 2018 3:50 pm     Reply with quote

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: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat May 05, 2018 6:20 pm     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Sat May 05, 2018 7:34 pm     Reply with quote

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: 19195

View user's profile Send private message

PostPosted: Sun May 06, 2018 8:33 am     Reply with quote

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: 9081
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun May 06, 2018 10:41 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun May 06, 2018 10:49 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Sun May 06, 2018 11:13 am     Reply with quote

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

View user's profile Send private message Send e-mail

PostPosted: Wed May 09, 2018 6:52 am     Reply with quote

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: 19195

View user's profile Send private message

PostPosted: Wed May 09, 2018 7:30 am     Reply with quote

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. Smile
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group