10-13-2016 06:23 AM
Hi! I am trying to get data from an AR 200-100 laser. I tried using the analog inputs and connect it to a MyDAQ. This worked, but there is a lot of noise. I then tried to connect the laser with a serial cable. See the attachment file. I am able to read the data on a graph with no noise. The issue that the values are pretty off compared when I was using the analog inputs. With analog when the laser was 5 cm away from an object, then it would show about 5 volts on the graph. With serial it shows 20,00. I could convert the data by using numerics, but it doesn't seem right when data isn't even showing any decimals.
Solved! Go to Solution.
10-13-2016 06:45 AM
10-13-2016 06:57 AM
Hi Sam. Yes I have read the manual for the laser. The ratio of the laser is:
0-10V
0-101,6mm
That means it should display 10V when the laser is 10,16cm away from the object. This looks good when using the analog inputs, but with a lot of noise. Would be nice to get rid of the noise with the serial cable.
I attached a picture of my program so that you can atleast see how it looks like.
10-13-2016 07:01 AM
10-13-2016 07:20 AM
Hi Sam. The two commas were just something I tried to see if there was any difference. I usually have only one comma in the delimiter. I believe it is 15.00 (desimal). I haven't worked with strings in LabVIEW before and I believe that my conversion from string to data type might be a problem. First of I want the program to display the desimal values. For example showing 15,645V instead of rounding up the numbers to 15,00.
10-13-2016 07:28 AM
@Sam_Sharp wrote:What does the serial data coming out of the laser look like?
We need to know the format of the data from the laser (what comes from the Visa Read). What does the string look like?
10-13-2016 07:37 AM
Hi Sam sorry. I wasn't sure of what you were asking, but I see now from the manual that there are two data formats from the laser: binary or ASCII. Here's the manual for the laser: http://www.disensors.com/downloads/products/AP600%20Laser%20user%20manual_1094.pdf
The serial data formats are shown at page 17.
Thanks
10-13-2016 08:08 AM
1) Let me fix that link for you: http://www.disensors.com/downloads/products/AP600%20Laser%20user%20manual_1094.pdf
2) Since you are only getting 1 measurement at a time, just use the Fract/Exp String To Number function to get your value. There is an input on the top for "Use System Decimal Point". You will want to wire a FALSE constant to that since you apparently use the comma as the decimal point instead of the period that the instrument does.
10-13-2016 08:13 AM
And one more thing about your architecture. Constantly opening and closing the serial port is BAD. Configure the serial port before the loop and close it after the loop. This will allow data to keep coming in between your reads and make sure you actually get full messages.
06-30-2017 07:41 AM
Hi again, sorry for bringing this back up..
What is written above did solve my problem for some time ago, but I am now unavailable to make the serial communication work for some reason. I am trying to read the voltage level from the laser through the serial connection and I want to see the voltage level on a waveform chart. See the attachment file. I would be grateful of any solutions.
Thanks in advance!
Kristian