LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Instrument with serial cable to graph

Solved!
Go to solution

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. 

0 Kudos
Message 1 of 11
(4,528 Views)
I can't open your VI as I only have LV2014, but have you read the manual/documentation for the laser to see if there is some scaling of the values required?

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 11
(4,519 Views)

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.

0 Kudos
Message 3 of 11
(4,515 Views)
What does the serial data coming out of the laser look like? If you are receiving "15,00" - is that 15.00 (decimal) or is that two numbers separated by a comma. Why did you use two commas as your delimiter for the spreadsheet string to array?

In any case - if the values you are getting from the analogue measurement and the serial measurement don't match, you probably need to take it up with the device manufacturer.

LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 4 of 11
(4,513 Views)

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. 

0 Kudos
Message 5 of 11
(4,505 Views)

@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?


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 6 of 11
(4,501 Views)

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

0 Kudos
Message 7 of 11
(4,495 Views)
Solution
Accepted by topic author kristaje

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(4,491 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 11
(4,487 Views)

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

0 Kudos
Message 10 of 11
(3,958 Views)