Jump to content

Please help, Convert this string format to number


Recommended Posts

I send some command via RS232 to my machine and the machine sent me back with a number "40" display in normal display in my attatched picture. I tried to use the string convert to num tools but there is nothing happen.

I wondering with it, then I try displaying the string in different way as in attached, code display and hex display.

I want to get the string "40" to change it to number, how can I get it? please help

90974344.gif

Thank you in advance.

post-15170-0-68335500-1333432524.gif

Link to comment

Not totally sure I have understood your question correctly by string convert to number tools do you mean Scan From String ?

Scans the input string and converts the string according to format string.

Use this function when you know the exact format of the input. The input can be string, path, enumerated type, time stamp, or numeric data. Alternatively, you can use the Scan From File function to scan text from a file. The connector pane displays the default data types for this polymorphic function.

Would help if you showed you block diagram

Link to comment

Not totally sure I have understood your question correctly by string convert to number tools do you mean Scan From String ?

Scans the input string and converts the string according to format string.

Use this function when you know the exact format of the input. The input can be string, path, enumerated type, time stamp, or numeric data. Alternatively, you can use the Scan From File function to scan text from a file. The connector pane displays the default data types for this polymorphic function.

Would help if you showed you block diagram

Thank you. I have already done with it. with this solution.

post-15170-0-26923700-1333441473.png

Link to comment

There is a vi in the examples called Extract Numbers.vi. It's perfect for this application. It takes a string as an input and converts it to an array of numbers. Then you simply index the array to extract the number you need. It's really useful when your string contains more than one number.

post-7727-0-35208400-1333461979.png

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.