09-16-2013 06:05 AM - edited 09-16-2013 06:08 AM
Hi,
Normally, this not the first time I use serial connection to control instrument.Strangely, this time I found that the read buffer contains as much byte as I spend time.I mean:if I put 1 second betwween write and read collect 200 bytes,if I put 3s I collect maybe 550 bytes.As you see in the VI, the read buffer contain the needed information(here the temperature) but among a lot of other information.If I change to true the enable termination char, I get just a troncated part of the buffer and always does not contain the desired information.
How can I fix this problem.I thought about taking a subset of the buffer string but this requires to know the first and the last position. In my case, it is not easy as this depend on the time of read ( more I spend time to read more I get information).
Thanks,
09-16-2013 07:59 AM - edited 09-16-2013 08:01 AM
Are you going to get just one temperature point each time you read the instrument and everything else is just numeric? If so, just use a regular expression to extract your temperature string:
Cameron
09-16-2013 08:08 AM
The problem is that it not just a temperature, according to the command, I collect several data in the same time: viscosity, density, date...
09-16-2013 08:14 AM
If your temperature string is formatted like you show in your upload, and it is the only string that is formatted in that way, the regex should work fine.
Cameron
09-16-2013 08:47 AM
The upload is just a sample of commande and as I said the buffer read can be much more complicated with dates, table, unites, error messages...
09-16-2013 11:26 AM
I don't see the problem here if the other data is not formatted exactly like the temperature data you illustrated. If other data were formatted exactly the same, how could you tell it is not temperature data? Might your temperature data be formatted some other way occasionally? If so, you have not given us the whole problem.
What is your difficulty here?
Cameron