LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

comment convertir la fonction to_number on labwindows

Bonjour,

j'ai un algorithme qui comporte la fonction to_number :

intCheckSum = to_number(substr(strNumSerie, 1, 1), '9'); 

j’ai trouvé cette fonction on labview, mais je n’arrive pas à le traduire on CVI.

Merci pour votre aide

0 Kudos
Message 1 of 6
(3,081 Views)

There are a lot of conversion functions in CVI (as in every C compiler): some of them are grouped in ANSI C Library >> General utilities >> String to Arithmetic expression (functions like atoi, atof...). Alternatively you can scan number from string with sscanf (ANSI C library >> Input/Output >> Formatted Input/Output) or Scan (Formatting and I/O Library).

CVI and LabVIEW are very different: for the first one some time spent looking into libraries or checking some good C programming manual would help Smiley Wink



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 6
(3,074 Views)

bonjour,

il ne s'agit pas d’une simple conversion d’une chaine à un entier, la fonction to_number on le trouve en labview, PL/SQL…..

ci-joint quelques explications de cette fonction :

 

 to_number.JPG

 

lien utile pour plus d'info:

http://www.dba-ora.fr/article-to_number-102614909.html

CDT

0 Kudos
Message 3 of 6
(3,062 Views)

moumou,

 

1. I'm sorry but I don't speak French: I'll keep on in English and rely on automatic translations to understand your posts unless you write them in English too

 

2. I don't understand if you are looking for a CVI function or for an explanation of a SQL statement. While I cannot help you for the latter, I suggest you to study Scan () function from the Formatting and I/O Library, which comes plenty of explanations and examples. As an alternative in standard ANSI C language you can use sscanf (), documentation for which can be found in any C reference book

 

If you can provide an example of the string to extract data from, we can try suggesting you some idea.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 6
(3,044 Views)

Bonjour moumou,

 

J'ai trouvé quelques examples pour les fonctions «Scan».  Regarde ces examples et dites-moi si ce n'est pas l'idée correcte.

 

 

Daniel Dorroh
National Instruments
0 Kudos
Message 5 of 6
(3,037 Views)

...and this link works Smiley Wink

0 Kudos
Message 6 of 6
(3,031 Views)