successful. ByteCount will be equal to nBytes if write is successful
(nBytes = strlen(buf) in code).
"Ryan Neuhart" <ryan@bihrle.com> wrote in message
news:5oUWg.33628$iA5.24715@dukeread11...
Right, I only initialize once. Sorry for the confusion on my part. I am
running this through a simulation environment. Initially I had the time
step set to 0.02 sec, but realized that this may be too fast for the
serial connection. However, I get the same result when setting the time
step to as slow as 2.0 secs. Each step I write the following to the
serial port:
I don't see anything obvious, but a couple of questions:
OutputVoltage = DesiredRPM * (1/183.9);
sprintf(buf,":CHAN1:VOLT %g",OutputVoltage);
g_SupTalk.Write(buf, strlen(buf));
What type is OutputVoltage?
If you sprintf() it with %g and no formatting delimiters,
will it fit into buf? At any rate, what type of resolution
are you looking for?
where "buf" has been declared as:
char buf[50];
and g_SupTalk is an instance of the class that is used
and the following is the Write function:
int CCommTalk::Write(const char *pBuf, int nBytes) {
DWORD ByteCount;
CheckDelay();
What does CheckDelay() do?
if (!WriteFile(m_hCommPort, pBuf ,nBytes, &ByteCount, NULL))
return 0;
return ByteCount;
}
Does this function always return a value?
How many bytes?