Re: Serial Communication in Visual C++




"Ryan Neuhart" <ryan@xxxxxxxxxx> wrote in message
news:5oUWg.33628$iA5.24715@xxxxxxxxxxxxx
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:

OutputVoltage = DesiredRPM * (1/183.9);
sprintf(buf,":CHAN1:VOLT %g",OutputVoltage);
g_SupTalk.Write(buf, strlen(buf));

Reply copied from tools newsgroup since the discussion seems to be here:

Perhaps you need to send a carriage return character after the command so
the device knows it's the end of the command.... or something like that.

You can use PortMon from www.sysinternals.com to compare the traffic from
your app with Hyperterminal and/or Matlab.


.


Loading