[?]: ASCII and string

RSLinx, RSLogix, RSView, LogixPro ...
Post Reply
jetuaime81
Posts: 13
Joined: Tue Aug 30, 2011 3:48 pm

[?]: ASCII and string

Post by jetuaime81 » Thu Aug 15, 2013 8:19 am

Hi,

I would like to know suppose I recieve 123456 in ascii format from application and is transferred to PLC DINT file N123, N124, N125 (2 digits each; 12 in N123, 34 in N124, 56 in N125). How can I make this number show as 123456 decimal and '123456' string in the plc (i tried DTOS but it shows decimal value of the ascii)

The data I am recieving is only integer values (0 to 9 in ascii) but cannot be changed as the application is protected. I want to know for CLX and PLC5. Help appreciated. Thanks

dehell
Posts: 104
Joined: Sat Jun 13, 2009 12:25 pm
Location: Europe

Re: ASCII and string

Post by dehell » Thu Aug 15, 2013 11:13 am

Hello,
I have already built such routine to convert int to string (for contrologix)
You can find below the link for download the routine.
To use this routine you have to add a tag in controller tag:
Name : DECIMAL
Type : String
Value : '0123456789'
https://mega.co.nz/#!VRQGGL5A!SDEUYTiOo ... 64tXZ2H-PE

For you application, you have to concat the 3 partial strings into 1 final string.
You can also convert string to Dint (CLX only...)

You can modify this code for PLC5
Best regard

jetuaime81
Posts: 13
Joined: Tue Aug 30, 2011 3:48 pm

Re: [?]: ASCII and string

Post by jetuaime81 » Thu Aug 15, 2013 2:39 pm

Thank you dehell...i will test it in 2 days...help appreciated.

jetuaime81
Posts: 13
Joined: Tue Aug 30, 2011 3:48 pm

Re: [?]: ASCII and string

Post by jetuaime81 » Fri Aug 16, 2013 7:17 am

I get error when I try to import "failed to import .L5X. The specified L5X does not contain a Routine export". My version is 20. I think you are using 16. Could this be the reason for this error?

dehell
Posts: 104
Joined: Sat Jun 13, 2009 12:25 pm
Location: Europe

Re: [?]: ASCII and string

Post by dehell » Fri Aug 16, 2013 12:50 pm

Hello,
Yes this routine have been created with RSlogix 5000 V16...
You can find below the pdf file of the routine
https://mega.co.nz/#!EURGhLIR!STqOJjWcG ... l0mCR2a8jY

Post Reply