Using kinetis Design Studio ,Processor Expert , how to do serial communication from LabWindows ?
I am creating a GUI in LabWindows which will be sending & receiving characters via the serial port with Kinetis K10 processor. Unfortunately unable to do so. could anyone please suggest a way to solve the issue ?
Thanks in advance.
Kinetis Processor Expert Code :
in main.c
/* this is used when receiving data , currently commented out*********/
//volatile bool DataReceivedFlg = FALSE;
//unsigned char InpData[10];
/******** to send a character**********/
unsigned char OutData[] = "1";
LDD_TError Error;
LDD_TDeviceData *MySerialPtr;
int main(void)
{
PE_low_level_init();
MySerialPtr = AS1_Init(NULL);
for(;;) {
Error = AS1_SendBlock(MySerialPtr, OutData, sizeof(OutData));
WAIT1_Waitms(100);
}
LabWindows Code:
bytes_read = ComRd(comport,buf,2);
CopyString (tbox_read_data, 0, buf, 0, bytes_read);
SetCtrlVal (panelHandle, PANEL_TBOX_READ, tbox_read_data);
every time "buf" is empty .
Hi Alice ,
Sorry for the trouble, but could you please tell me if the code snippet for sending the character I have used is correct . I wanted to know if there is any other way to do so.
Thanks in advance.
Harsha.
Hello ,
Yes, there is no error in your sending code.
I rememberd you said it can work well :
About the usage of Serail_LDD, there are demo code you can refer to:
Hope it helps
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello K HARSHA,
Sorry I don't know the Labwindows well.
While I recommend you firstly use a serial terminal (Putty or others )
to check whether the send data can work well.
Hope it helps
Have a great day,
TIC
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------