dcooper33
Lifetime Supporting Member + Moderator
Hey Guys,
I've got an array of strings in an L75 processor that take the shape of something like this:
MyString[01] = '012345.678'
I'm needing to pull the data minus the '.' character.
MyResult = '012345678'
It's always the 7th character in the string. And then keep the result as a string with any preceeding zeroes still included.
There's plenty of good examples in C, vb, java online of how to do this, but I haven't found any for RSLogix.
I was thinking a STOD then back to DTOS might work, but haven't tried that yet. Wanted to see if you guys had ever done anything similar.
Thanks,
Dustin
EDIT: Just bench-tested this, and see that STOD drops everything after the '.'
While a STOR tested on a '133993.001' yields '133993.0'.
Thought that might be a quick and easy way to do it, but looks like I'll have to stick to string manipulation...
I've got an array of strings in an L75 processor that take the shape of something like this:
MyString[01] = '012345.678'
I'm needing to pull the data minus the '.' character.
MyResult = '012345678'
It's always the 7th character in the string. And then keep the result as a string with any preceeding zeroes still included.
There's plenty of good examples in C, vb, java online of how to do this, but I haven't found any for RSLogix.
I was thinking a STOD then back to DTOS might work, but haven't tried that yet. Wanted to see if you guys had ever done anything similar.
Thanks,
Dustin
EDIT: Just bench-tested this, and see that STOD drops everything after the '.'
While a STOR tested on a '133993.001' yields '133993.0'.
Thought that might be a quick and easy way to do it, but looks like I'll have to stick to string manipulation...
Last edited: