-
May 22nd, 2014, 12:34 PM
#1
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
-
May 22nd, 2014, 12:52 PM
#2
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!
Victor Nijegorodov
-
May 22nd, 2014, 01:18 PM
#3
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?
-
May 22nd, 2014, 01:28 PM
#4
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Did you read the Serial Port I/O essay?
Victor Nijegorodov
-
May 22nd, 2014, 01:45 PM
#5
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
yes. I have read it. Why?
-
May 22nd, 2014, 02:38 PM
#6
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
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
Victor Nijegorodov
-
May 23rd, 2014, 02:55 AM
#7
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?
-
May 23rd, 2014, 02:57 AM
#8
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Please, read the documentation in MSDN!
Victor Nijegorodov
-
May 23rd, 2014, 02:59 AM
#9
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...
-
May 23rd, 2014, 03:03 AM
#10
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)
-
May 23rd, 2014, 03:08 AM
#11
Re: MFC GUI-setting COMPort and read hex data from pic (ASCII)
Are they not included by default?
Besides, please read About Communications Resources in MSDN.
Victor Nijegorodov
-
May 23rd, 2014, 03:55 AM
#12
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..
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|