From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-14-2014 12:25 AM
Hello,
I have a VI that I want to be constantly reading in numbers (that are in ASCII format) with VISA. The data coming in separates its variables with X's. I'm not sure if I'm trying to use the char termination correctly, but I had the idea that it would stop reading in (at the X in this case) and only have the number going out to the read buffer.
Here's the article on NI that I read about it.
http://www.ni.com/white-paper/4256/en/
Unfortunately I'm still getting a whole bunch of variables surrounded by X's in the read buffer when I run the VI. Any help on getting just the numbers separately would be much appreciated.
Solved! Go to Solution.
10-14-2014 12:53 AM
10-14-2014 02:23 AM - edited 10-14-2014 02:24 AM
Hi JL,
coercion dots always mark dangerous conversions done automatically. You need to know why they appear and how they may influence your desired result…
Try this one:
("Failsafe" as long as LabVIEW doesn't support Unicode by default…)
10-14-2014 02:45 AM
Thanks you two, all appears to be working now. I ended up using the second solution just in case (thanks for the tip), and even though X's still append the strings, when converted to a dbl numeric they seem to be lost. So I'm probably not going to bother with trying to get rid of them for now.
Again, thank you.
10-14-2014 02:49 AM - edited 10-14-2014 02:52 AM
Hi JL,
why is there a coercion dot at VISARead input? (It doesn't hurt you here, but anyway…)
Why is there a coercion dot at your numeric indicator? Why do you use a DBL indicator for an integer value? Or other way around: why do you convert to an integer when you want to use DBL floats later on?
even though X's still append the strings
Well, even when you define "X" as termchar it is still part of the received data…
10-14-2014 11:44 AM
Oh I didn't realize I could avoid a lot of the unecessary conversions, or even what the red dots meant. Is this better?
10-14-2014 11:49 AM
10-14-2014 01:27 PM - edited 10-14-2014 01:27 PM
Alright, I connected an U8 integer directly to represent the X. Thanks for the tip!