LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Length Error! Help with Keyence Micrometer output

Solved!
Go to solution

I'm connected to a Keyence LS7600 Micrometer, and I'm able to send commands to the micrometer, as well as receive structred outputes.  For example:

 

 

Command:  M0,1

Return:  ER,M0,20

 

 

 ER meas error,  M0 is my output command, and 20 means DATA LENGTH ERROR.

 

 

I'm using a very basic VISA program which is connecting to the Keyence through my Serial Port. 

 

 

So when the Keyence Micrometer tries to send the data I've requested, it apparently cannot do it because it encounters a Data Length Error.  I know this is a problem with my labview software because I can output these values successfully using a Hyperterminal connection.

 

 

The data SHOULD return looking like this:  M0,+25.2531    

 

That's 12 bits right?  Can anyone think of why labview won't accept this string? 

0 Kudos
Message 1 of 16
(4,592 Views)

Are the parameters right for the RS232 communications? I am not familier with that micrometer but I used Keyence products and their DLL for USB driver. They worked fine for me but of course it is a different story since that was in the software layer. Maybe you can post the VI so other people can check?

0 Kudos
Message 2 of 16
(4,585 Views)

JMed wrote:

I'm connected to a Keyence LS7600 Micrometer, and I'm able to send commands to the micrometer, as well as receive structred outputes.  For example:

 

 

Command:  M0,1

Return:  ER,M0,20

 

 

 ER meas error,  M0 is my output command, and 20 means DATA LENGTH ERROR.

 

 

I'm using a very basic VISA program which is connecting to the Keyence through my Serial Port. 

 

 

So when the Keyence Micrometer tries to send the data I've requested, it apparently cannot do it because it encounters a Data Length Error.  I know this is a problem with my labview software because I can output these values successfully using a Hyperterminal connection.

 

 

The data SHOULD return looking like this:  M0,+25.2531    

 

That's 12 bits right?  Can anyone think of why labview won't accept this string? 


 

LabVIEW is accepting the string just fine.  It is giving you what is coming back from the instrument.  That message is coming from the instrument.  You'll have to look up in the Keyence manual or contact them to get some help in figuring out why they are returning the error.

 

One thing I would check is what termination characters are you are sending.  Do you need carriage return, line feed, or CR/LF?

 

 

Message 3 of 16
(4,580 Views)

Turns out it was indeed an issue with the carrage return.  I appended my output string with a carrage return constant, and the output command was then processed correctly I received a string in return!

 

 

 

Now I have a new problem 😛   Forgive me for the newb question,  but I need to convert this string:

 

M1,+25.3561

 

 

into a decimal number.  I've already used "String Subset" and currently I have a string that looks like:

 

25.35621

 

But I now want to turn that into a floating point data.  I've tried using "Decimal String to Number" but that only gives me the integeer 25.

 

Is there any way to take a string such as "25.35621" and convert it into a floating point number?

 

 

 

All help is much appreciated!

0 Kudos
Message 4 of 16
(4,578 Views)
Use Fractional String to Number.  Decimal string (and I think the name is somewhat confusing) only returns integers.
Message 5 of 16
(4,566 Views)

Thanks Ravens Fan,

 

That pretty much solved the problem.  I can now get a decimal number but it only goes to 4 decimal places! 

 

The original data:  25.03451

 

My data after Fractional String to Number:  25.0345

 

 

 

Since this is a precision device, I really need that extra decimal.  Sorry if this is just a way obvious question, I'm okay with labview just not great 🙂

0 Kudos
Message 6 of 16
(4,564 Views)
Solution
Accepted by topic author JMed

Check the display format on the indicator you are looking at for the number.  There default format is 6 significant digits, which is exactly what you are saying.

 

The entire number is there in the orange wire, just your indicator isn't set to show them all to you.

Message 7 of 16
(4,559 Views)

I actually need 7 significant digits.... Not 6.

 

 

My indicator seems fine, plenty of space for 7 digits, but I'm wondering if LabVIEW can't do 7 digits?  Hard to believe, but maybe?

0 Kudos
Message 8 of 16
(4,549 Views)
Nevermind, I figured out how to add more significant digits.  Thanks man, your help was what led me to finding it!
0 Kudos
Message 9 of 16
(4,547 Views)

Dear Sir

 

I am Chavanun The student of Pathumwan Institute of Technology Thailand.

 

I found the same problem and I don't know how to FIX it T_T

 

untitled.JPG

 

Please help me 

Thanks you

0 Kudos
Message 10 of 16
(4,206 Views)