[?]: ASCII and string

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

[?]: ASCII and string

Post by jetuaime81 »

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 »

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 »

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 »

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 »

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