ASCII to INT

Ian762

Member
Join Date
Aug 2013
Location
Clearwater
Posts
31
I have an element of a UDT that is of the data type STRING128.

I need to parse the ASCII data in each element of the STRING 128 array into 3 INT's.


In the attached screen shot, I need to manipulate the data so that my 3 INT's will have the following values.


INT1 = 90
INT2 = 0084
INT3 = 5601

Thanks
Ian

ASCIIconvert.jpg
 
I would use MID three times to extract and create three strings holding the desired characters. The use STOD three timeds to convert from ASCII to DINT. If you really need the final values to be INT then MOV the converted values into the desired INT tags.
 
Thanks for your help!

I had to copy the STRING128 data into a buffer of STRING data type because the MID instruction wouldn't work with the STRING128 data type, but after that I was able to move the data how I needed it.
 

Similar Topics

Im trying to use a MSG instruction to get the serial numbers of all addon cards and display the serials on a HMI interface. I have the logic done...
Replies
2
Views
553
HI Guys So i am trying to write a real SINt or DINT value into a string tag. If in string browser I write it manually, no problem. But how can I...
Replies
8
Views
5,954
Hi guys I have a barcode scannes which gives me some numbers (SINT) that I want to convert into ASCII, so that I can see that ASCII char insted...
Replies
6
Views
2,788
Hey, i've been working on getting some add-on instructions defaulted in the company i work in. i am currently trying to create a string which...
Replies
7
Views
3,047
(Using Studio5000) Hi all, little bit about what's going on: I'm doing this program for my dad, I've never worked on a PLC until I started doing...
Replies
0
Views
1,730
Back
Top Bottom