MFC GUI-setting COMPort and read hex data from pic (ASCII)
I want to setup my MFC-based dialogue "IDD_LOADCELL" with serial communication so that when that dialogue is pop up, the data from PIC (external device) which is in hex file format is display on the edit control box on the dialogue. The variable name of the edit control box is "m_loadP "and "m_loadT1". type of variable for both are string. I want to get the code for the COMPort setting and reading the data from pic and finally display it on the edit control box created on the dialogue
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Well, you have to read/understand how serial communications work in Windows.
Then implementing something similar to Serial Port I/O would be a good start!
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Its there any class developed specifically for COMPort function setup in MFC application wizard? or I have to develop my own code wothout depending on any classes?
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Did you read the Serial Port I/O essay?
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
yes. I have read it. Why?
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Quote:
Originally Posted by
newborn2
yes. I have read it. Why?
What "why"?
Just add the classes from this essay to your project...
Note that you also will need to properly set the DCB and Timeouts, See SetCommState function, SetCommTimeouts function
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
I'm still confusing about DCB setting... is it like a variable that need to add up in the front line of the name of the COMPort configuration? example like m_dcb.Baudrate..m_dcb.Parity..? what is the usage? I have see a lot of COMPort configuration wwithout the DCB term... Is it specialize for reading hex file?
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Please, read the documentation in MSDN!
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
I know that it is device control block... but still confusing... I need a more understanding explanation...
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
HuH... when I see the Kernel.lib and Kernel.dll... I noticed that i heve try this before.. when I debugging my code..they cannot define both... how I want to include both (Kernel.lib and Kernel.dl)
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Are they not included by default? :confused:
Besides, please read About Communications Resources in MSDN.
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
thank you for linking me step by step to the necessary topic.. is it the About Communications Resources is the first step for the program that I want to develop? I just want to make sure that I was not overlook... I need time to understand this... I will ask later if I'm facing another problem regarding this topic..