LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with reading touchscreen signal

Hi All,

 

I have a 5-wire touchscreen connected to a myRio 1900 and looking for some help to get properly read the touchscreen signal using the FPGA functionality of the myRio. I am trying to get it to read one coordinate at the moment and have attached my current VI.

Basically the digital output blocks serve to set the electrode voltages and the analog input block serves to return the voltage value at the point of contact, but it is coming out as an integer, so how do I change this value from an integer to a DBL?

Thanks.

0 Kudos
Message 1 of 2
(2,288 Views)

I don't have a myRIO at hand, but your question shows you do not understand how analog to digital conversion works.  I'm going to over-simplify it for you.  The key word in A/D is digital -- a voltage (analog) is sent through circuitry that renders it as, say, a 12-bit number (A/D converters usually specify number of bits of precision).  12-bit numbers are integers, so at a fundamental level, A/D converters return integers (a 12-bit converter will give you numbers from -2048 to 2047, or 0 to 4095, depending on whether it outputs signed or unsigned quantities).

 

Suppose you had a 12-bit A/D that returned a signed number and you knew that it took voltages from -5 to +5 volts.  If you want to know the voltage, you would take the A/D number (say, 200), divide it by the range (4096) and multiply by the voltage range (10).  An easy way to remember it is to balance units -- 200 "A/D Counts" * (10 v / 4096 Counts) = 200 * 10 / 4096 v, or about 0.5 v. 

 

Bob Schor

and add in the voltage offset (-5v).  So (200/4096)*10 - 5 = 

0 Kudos
Message 2 of 2
(2,238 Views)