08-11-2008 11:02 PM
08-12-2008 01:37 AM
Hi Ritesh,
what do you mean. If you read your data it should be in binary format. Where is the difference between binary and text for you?
Mike
08-12-2008 10:44 AM - edited 08-12-2008 10:45 AM
11-15-2012 10:05 PM
Boom!, Baby. That solved my issue too.
Cheers.
11-17-2012 10:01 AM
Oops! No it didn't.
Lab VIEW 2012 (if that makes a dif)
I'm using the VISA Read function to take ADC readings in from a microcontroller. The VISA Read function outputs the data as a string. Easy to convert the string to U8, either with the conversion function or type cast function, and works great except for a tiny corner case when the ADC reading is zero. The VISA Read function treats the 8-bit zero reading as a null character and strips it out.
Apparently, since this is done by the VISA Read function as it's building the string, type casting and or converting the output string from the VISA Read function doesn't "bring the zeros back".
I've tried setting the VISA property "Discard NUL Characters" to false, and that didn't seem to help.
My current work around is just to never have the micro send a zero ADC reading.
Anyway, I'm a Lab VIEW noob, so while this isn't essential to my project, I remain curious about how to send Lab VIEW serial data that isn't automatically considered characters, thrown into a string with all the zeros stripped out.
11-17-2012 04:58 PM
@Who_Knew wrote:
Oops! No it didn't.
. The VISA Read function treats the 8-bit zero reading as a null character and strips it out.
No. VISA Read does not strip out null characters. There is a property node you can set for the com port that can cause null values to be stripped out. So if you have set that somewhere, it could do it. But the default value for that property is false.
11-18-2012 08:55 AM
Thanks for letting me know I'm wrong about this. Since what I'm experiencing is different from what you claim, perhaps you could provide an example showing how it doesn't remove nulls? Then, not only would I know I had it wrong, I'd see how to do it right too. Thanks!
11-18-2012 06:06 PM - edited 11-18-2012 06:07 PM
Here is how you can see what the current setting is. Then how to set it so it doesn't discard nulls.
11-18-2012 06:23 PM
Awesome. I went through the properties and found that one. Set it to false, but it didn't seem to help. I'll try it again. At least I can report back what difference it makes if any. Thanks.
11-18-2012 11:11 PM
You may want to check if your microcontroller is handling it properly. Try using another serial program to see what it is doing with Null characters. (Usually we'd suggest Hyperterminal to check on the operation of a serial port, but it isn't going to be able to show you a non-printable character like a Null character. So look for another terminal program that can show you what comes in as Hex.)