Replace a Single digit in a string

Cjohnson9127

Member
Join Date
Mar 2018
Location
US
Posts
10
I am attempting to replace a single digit in string in studio 5000. I need to take the 23rd digit and change it from a 1 to a 5 while the rest of the information remains the same. Is it best to use an "Insert" Instruction here, or will that shift the rest of the original string over and just add my information rather than replace the original 23rd digit?
 
You can move a new value into MyString.Data[23]. If you expand the string in the Controller Tags (monitor window), you will see that a string is made up of a length and an array of SINT's for the characters.
 

Similar Topics

We have a Beckhoff CP6201 PC and an EK1100 module communicating with it via EtherCAT in one of our machines. Due to problems with the PC, I want...
Replies
0
Views
68
Panelview 2711-K5A8. Customer has 6 of these in service connected to SLC 504’s. One has a bad backlight and I need a solution to replace it...
Replies
11
Views
2,251
I’ve got some devices that are triggered by shorting pins to common. There is 24 volts on each pin and right now I am using a relay output card...
Replies
8
Views
2,553
I can't replace cpu S400 416-3XR05-0AB0 BY 416-3ER05-0AB0 in PCS7 Project when using replace object to keep the original configuration in the...
Replies
4
Views
1,499
How can I achieve the same functionality in Studio 5000? Image 001.png for the old RSLogix500 program Image 002.png for conversion to Studio...
Replies
6
Views
2,516
Back
Top Bottom