12-04-2010 09:30 AM
Hey guys,
Below, I'm loading values from the front panel of a programmable power meter via rs232.
The problem is, the power meter sends this info as a string of voltage, current and power, as you can see below in the first image into he box titled 'request - this is the data received back from the meter'.
I was really hoping to be able to receive an integer value for the power (the 0.81 number), I've had go at using scan string but really stuck with where to actually start with it.
I would really appreciate it if one of you guys could direct me towards to how I should use the scan string to only get the value of power out of the string.
Thanks in advance
Dan
12-04-2010 09:50 AM
See attached example..
May be it will be helpful.
12-04-2010 10:50 AM
Thank you so much for your response, I now have the power being ouput as an integer!
I would be ever so grateful if you could help me a little bit more,
i have now found that the input string is not always complete, sometimes it ends at U=(a value) and does not contain the data for the current or the power.
Naturally, this causes an error with the data not being in the expected format as defined by the search string function if I am using a loop to continously monitor the power.
Is there a simple way of getting Labview to just wait for a complete string rather than stop the loop due to the error?
Thankyou again for your help
Dan
12-04-2010 02:31 PM - edited 12-04-2010 02:32 PM
Yeah, read from the port and if you don't have enough data, read some more and append it to the string you read the last time. Use a loop with shift registers to propagate the the previous string and concatenate string to append to it.
A
12-06-2010 09:01 AM
Have you looked into using the termination character of your device that you are reading from.
Most devices will end a message with a return or new line.
Set the termination character read mode of your comport to match that of your device.