Converting Ascii Data recieved form Channel O on PLC5

Holmzy

Member
Join Date
Jan 2006
Location
Cambridge Ontario
Posts
26
I am trying to take data recieved through Channel 0 on a PLC5
as an Ascii string then convert it to a decimal number in the PLC

The string is made up of a combiation of numbers and letters.


example: 123CFRES1E301234

after I recieve it I need to break it down into 5 parts

123C
FR
ES
1E30
1234

I have had some luck with the extracting into the separate
strings but have not had any luck converting to integer.

The parts that have a letter do not convert.

I am using Rslogics 5 and the PLC is a PLC5/40
 
we need more details ...

please give us some examples to work with ...

123C = 1234
FR = 44
ES = 128
1E30 = 4321
1234 = 8888

or something along those lines ... now I'm reasonably sure that "FR" probably doesn't need to be converted into an integer (or does it?) ... but it would be very helpful if you could specify exactly what output you require for each of the chunks that DO need to be converted ... and will each of the chunks ALWAYS be the same length? ... and will ANY of the converted numbers EVER need to be negative values? ...

basic idea: if you'll give us the details, then we can probably write a routine which will do the conversion ... but in order to "bench test" the routine, we'll need specified input examples - and specified output examples ... that way we can be sure that we're hitting the target ... with that in mind, the more examples that you provide, the more likely that whatever we come up with will work with all of your inputs ...
 
Last edited:
Ron:

Actually all values eventually need to be binary

123C= 5 digit binary ( 16,8,4,2,1)Model
FF = 3 digit binary ( 4,2,1) Style
ES = 3 digit binary ( 4,2,1) type
1E30= 5 digit binary ( 16,8,4,2,1)Colour
1234= 5 digit binary ( 16,8,4,2,1)sequence number

They need to be placed is integer files that once came for push buttons
 
Last edited:

Similar Topics

Hello all, We need to convert ASCII data into Real Raw data, here we use Trimble GPS and need to get the position data. We use SCADAPack 357...
Replies
4
Views
2,839
We are pulling time through Modbus from 3 reg. the data we are getting back to the PLC is 12593 for hours, 13105 for minutes, and 8240 for...
Replies
3
Views
1,187
Have an unusual one here, guys... I have a remote machine that is sending my 1769-L33ER five 16-bit integers that represent 10 ASCII characters...
Replies
4
Views
2,228
Is there a way to convert these integers (17476,16688,13110,12598) to Ascii character (DDA03616)? 17476 = 4444hex = DD on ascii chart 16688 =...
Replies
7
Views
6,737
Hey guys, I hope you can help me. Not sure if I am totally missing something here but is there an easy way to convert an integer into ASCII in...
Replies
4
Views
8,529
Back
Top Bottom