//	M571 : Text transmission at the current time every 1 second (event-driven not used)

define	port = 4,
		fEnd = _FALSE;

function main()
{
	define	dat[8];

	_Cls();
	_PrintF("Send text at the current time every second.\n");
	_BtnOpen(0, "End");

	_ComCreate	   (port);
	_ComOpen	   (port, 115200, 8, 0, 1);
	while (!fEnd) {
		_ComSendText(port, $_StrCat($_DateAndTime(), "\n"));
		_msWait(1000);
	}
	_ComDelete (port);
}

function _OnButton(BtnNo)
{
	fEnd = _TRUE;
}
