Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

float representation compatibility

Hello,
 
I m experiencing an issue with the float representation in Labview 8.0. Actually I am trying to control the motion of 2 steppers motors via the RS232 serial interface. And the command I must send to the motion controller looks like that: "1PA2.567" where "1" is the axis number, "PA" the command and "2.567" the targeted position in mm. The problem I have is the float a represented with a "," and not a "." in Labview 8.0, so the command I send is "1PA2,567" and of course this not work very well. So my question is quite simple: is there any option somewhere I can turn the float representation to the desired one (a point instead of a comma)? I have of course used the "find and replace" VI to replace the comma with a point in the string I send but it should have a clean solution...
 
Thanks in advance for answering me,
 
Eric
0 Kudos
Message 1 of 6
(3,475 Views)
Hello Eric,
 
I think the best way to solve your problem is changing the Regional Languages and Options of Windows >> Regional Options >> Customize and under the tab "Number" change the decimal symbol from ',' to '.' .
 
Otherwise there is no other solution except which you employ (using a sring and replace the ',' by an '.' .
 
Best Regards,
 
Julien Roland - District Sales Manager
NI Belgium - Technical Support

Don't forget to rate a good answer
0 Kudos
Message 2 of 6
(3,456 Views)
You could also use %.; in your format specifier to force it to use the '.' instead of the ','.  Take a look at this discussion in the LabVIEW forum.
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 3 of 6
(3,451 Views)

The problem you experience is generated by the default setting of LabVIEW to use a localised decimal point.

If you switch that off in the options you have a normal system. Everybody in Europe is having problems with this one.
Our American friends simply were too friendly when they defaulted this option to use a localised decimal point
and afterwards invented a lot of software with %. to use a localised decimal point togetehr with a normal decimal point.
I have seen only one instrument that had the option to change the decimal point and we decided to never use that.

success, you are not alone in this struggle

greetings from the Netherlands
0 Kudos
Message 4 of 6
(3,447 Views)

I had already tried to force the format with "%." but it changed nothing. So I have changed the Regional Settings and it worked... Thank you very much for answering me.

Eric

0 Kudos
Message 5 of 6
(3,450 Views)
Are you sure you had the format string correct?  It works correctly on my system using LabVIEW 7.1 and windows XP SP2.  The format string should look like this for a single floating point number:
%.; %f

 It's even an option if you right click on the Format Into String.vi and select Edit Format String.
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 6 of 6
(3,438 Views)