×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

sIEMENS s7 STRING cONVERSION

sIEMENS s7 STRING cONVERSION

sIEMENS s7 STRING cONVERSION

(OP)
Hi All,
I'm currently busy on a project where i must take a number of char type objects and convert them to a decimal number for comparison reasons.

i tried the standars Step 7 STRNG to INT conversion with no good values.

I understand the string concept like followoing.
Variable type STRING[5]
STRING[ABCDE]

byte 0    Max No of Char
byte 1    Actual amount in String
byte 2    A
byte 3    B
byte 4    C
byte 5    D
byte 6    E

Is there any tip or trick to getting this conversion going
I would really appreciate any help.

If there are any requests i'll post my code on this topic.

Kind Regards

Rheinhardt

--Off all the things i've lost , i miss my mind the most--

RE: sIEMENS s7 STRING cONVERSION

Can you just subtract 48 from the data and multiply?

For example the string you are receivinge is "1234"
So you would take byte 1 "1" (ASCII 49) - 48 = 1 x 1000
then add byte 2          "2" (ASCII 50) - 48 = 2 x 100

and so forth.

Is this an ST program?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources