actually i am trying to establish communication between serial port and a power sensor which is of ophir make. now after learning from example i have established communication. i write SP(send power) then sensor transmit the value of power and i read it. now problem is that
1) i want to monitor power continuously because once i read the value again i have to transmit SP command for the new value. how should i transmit SP Command to serial port so that it always give me power value.
2) now i want to plot these value on the chart with data logging. how can i do this.
Use a loop to request the power, wait to allow the instrument to repond, and then read. This loop can keep running until you tell it to stop.
What language are you using? In LabVIEW, I would tell you to use a Producer/Consumer to send the data from the instrument read loop to another loop that does nothing but log the data. You can just use a chart directly for plotting.