07-02-2009 11:43 AM
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?
Solved! Go to Solution.
07-02-2009 12:32 PM
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?
07-02-2009 01:22 PM
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?
07-02-2009 01:26 PM
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!
07-02-2009 01:38 PM
07-02-2009 01:54 PM
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 🙂
07-02-2009 02:04 PM
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.
07-02-2009 03:00 PM
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?
07-02-2009 03:01 PM
11-23-2010 10:21 PM
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
Please help me
Thanks you