Wierd Issue converting a String to a integer file (PLC5)

wlemst88

Member
Join Date
Apr 2003
Posts
39
Hey all,

I've encountered something weird today that I can't explain.

I have a variable in a string file, call it ST15:18. I need to convert this value to an integer file. So I do a copy from the string to a N37:60, with a length of 5. N37:60 is the length, fine. But if the varible in the string is less than 10 (ie only one number) then the value in the integer shows up with a "2" concatonated onto it. For example, if ST15:18 holds a 52, then I copy it over to N37:60, and N37:61 holds the ASCII value for 52. But if ST15:18 holds an 8 (or anything else less than 10) then N37:61 holds the ASCII value for 82 (instead of 8). Anyone know why this is? I got around the problem by concatonating a 0 before the 8, and then the copy works fine. But I don't understand!

Wes
 
Because that converts the value to the original value, rather than the integer representaion of the ASCII value.

So for example "13" in the string would be "13" in the N37:61 rather than "12595"
 

Similar Topics

Hi! I have a strange problem I can't come up with a solution to. I have a TONR in my program set at 7 minutes. When the timer reaches 7 minutes...
Replies
7
Views
2,330
I have a compact logix 5000 that has multiple PID loops. I feed a real value to the PID Process variable. I have a scale of 0-100 for the PV and...
Replies
3
Views
5,554
Have a machine that has a Mitsubishi fx32u-32m plc and a ABB Power Supply in the machine that is part number CP-E 24/0.75 It is a 120vac powered...
Replies
6
Views
3,471
At the site I am at I am converting several 90-30 plcs to RX3i. While I am here, the customer had me look at a problem with one of the 90-30...
Replies
18
Views
8,558
Hi All.. We have a little problem at the plant I work at... we have been in contact with techconnect and not really achieved much so far.. just...
Replies
9
Views
3,315
Back
Top Bottom