LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Way to plot only numbers when my VISA read will give spaces and ">" characters?

If anyone can help it would be much appreaciated.  Im running a MMR K20 Temp controller, Im trying to read the temperature off of it.  The command to ask for the temperature gives a return of "234.43K
>"

It gives back a space or newline and the character ">"

So everytime I try to plot the temperature it first gives me the correct reading, then it plots the other characters which ends up being "0" so I get a plot that looks like a triangle wave.

I know I can use the match pattern vi, but the problem is, the machine doesnt return the temperature readings and the extra characters all at once.  On the first pass it will give the temperature.  On the second pass it will give the new line and the >, so even when i use the match pattern, it still gives a 0. 

Is there a way to work around that problem?

Can I scan to see if its numeric and only plot it when its a numeric value?

Thanks again. NI message board is always helpful.
0 Kudos
Message 1 of 3
(2,453 Views)
My guess is that you have set the VISA Configure Serial Port with Enable Termination Character set to true (or unwired which is the same thing) and left the default termination character to the default as well. The default termination character is xA or the newline character. That is why you have to read twice. Instead, you can wire a false to the Enable Termination Character and do VISA Bytes at Serial Port to determine how many bytes to read. Then you will get everything in a single read and you can use the match pattern or Scan From String.
0 Kudos
Message 2 of 3
(2,452 Views)
Thanks Dennis, I will try it out.
0 Kudos
Message 3 of 3
(2,447 Views)