|
Which kind of device are you communicating with ? USB doesn't work like a serial port: you don't have access directly to the port but instead you get the handle of a driver. This driver is shipped with the device you want to communicate with and manages all the communication with the device.
To get the handle of the driver, simply call CreateFile supplying the correct driver name, then you should be able to use ReadFile and WriteFile. You can also do some more specific stuff by calling DeviceIOControl (in which you can pass some specific IO code which is dependent of your driver).
So, if you want more help, you'll need to give a lot more information (which device do you try to access, if you have documentation with it, ...).
|
|
|
|
|
can anybody help me make a program that can do any of these numerical method?
moss,newton method, secant method, taylor-maclauren,bisection method,gaussian elimination, gauss-seindal,lagrange method.
thanks guys!!
|
|
|
|
|
homework?
don't tell me that you don't find the way to implement the secant-method or bisection method !
You have only to implement the algorithm:
ask for a function f(x) and for the borders x1 and x2.
check that sign(f(x1)) != sign(f(x2)) .
Then compute x3 inside the interval (x1, x2). This according on the algorithm, in bisection case x3=(x1+x2)/2,....in secant method it's only the point where the line from (x1,f(x1)) to (x2,f(x2)) intercept the x-axe.
then choose the new interval (or x1-x3 or x3-x2) according on where is the root.
Then start again on the new interval.
Do this 10000...000 times and stop it. Or stop when the interval is "too small".
That's it.
Russell
|
|
|
|
|
thanks russell!
it a project actually..
|
|
|
|
|
ok, you convinced me.;)
Then you won this link[^].
(the routines are in C, not in C++. but it is easy to translate they)
Russell
|
|
|
|
|
thanks for the link that's really helpful.
|
|
|
|
|
mitsui58 wrote: can anybody help me make a program that can do any of these numerical method?
Yes, I'm sure someone can.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
you can use the GNU scientific library.
It will give your the needed method.
|
|
|
|
|
Can any one suggest me some ways to monitor the cts pin of the serial port using DCB.
S.Yamini
|
|
|
|
|
i have worked very enough with serial port(RS 232).
but never heard of the cts pin and dcb.
atleast for my information please educate me regarding those.
then i will try to solve if it in my perview.
thanku.
|
|
|
|
|
I am using vc++ 6.0 for serial port communication. dcb is structure defines the control setting for a serial communications device.
I have to monitor the cts (Clear to send)pin of the serial port.
S.Yamini
|
|
|
|
|
I use PCOMM library for sending and receiving data using serial port.
functions are like
sio_ioctl(); to define the port settings.
sio_read();
sio_write();
soi_iqueue();to find weather any data is there in the port.
may be i can help you if you are also using these libraries and functions.
|
|
|
|
|
yaminisridaran wrote: Can any one suggest me some ways to monitor the cts pin of the serial port using DCB.
i think u need to set fOutxCtsFlow flag of the DCB to TRUE to monitor the CTS signal.
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
I have set fOutxCtsFlow to true but it is always true even if the voltage level in cts pin changes.
S.Yamini
|
|
|
|
|
|
I already using GetCommState.
My Code
CString strPort;
strPort.Format("COM%d:",1);
m_hPort=CreateFile(strPort,GENERIC_READ|GENERIC_WRITE,0,NULL,OPEN_EXISTING,0,NULL);
if(m_hPort==INVALID_HANDLE_VALUE)
{
return false;
}
GetCommState(m_hPort,&dcb);
BOOL res;
dcb.fOutxCtsFlow=true;
res=SetCommState(m_hPort,&dcb);
// Configure serial port
GetCommState(m_hPort,&dcb);
if(dcb.fOutxCtsFlow==TRUE)
TRACE("TURNED OFF");
else if(dcb.fOutxCtsFlow==FALSE)
{
TRACE("TURNED ON");
}
dcb.fOutxCtsFlow is always true even the voltage level changes
S.Yamini
|
|
|
|
|
Did you read my message ? Where do I speak about GetCommState ? I even gave you the link to the documentation, did you have a look at them ?
|
|
|
|
|
Hey guys,
I develop applications using MFC and Visual C++ 6 and I am working on a particular application that needs to access data over the internet.
Can I do this using the MFC Framework or am I better just biting the bullet and get myself up to speed with Visual C# 2005?
Best Regards
Danny Nowlan
|
|
|
|
|
|
|
Yeah thats right,;) Hi Alok how are you?
I think its better I use of my name and also without any sig very simple.
|
|
|
|
|
|
can anyone tell me what is INT_PTR ?
thanks
|
|
|
|
|
A signed integral type that is the same size as a pointer. So 4 bytes in Win32, 8 bytes in Win64.
|
|
|
|
|
same size as a pointer, but its not a pointer. correct ?
|
|
|
|