The output of the for loop is configured as last value. So, you'll get (wait for it...) the last value.
Change it to indexing. That will give you an array. Use Concatenate Strings to convert the array to string.
Number to Hexadecimal String does the same as the Format Into Sting, but it works on arrays. So you don't need the for loop. You'd still need the Concatenate Strings.
You can lose the array size, the auto indexing on the input array will automatically loop over all elements.
Basically this is the small part of my program, basically i am transmitting a string from one com port and receive it on another com port, then i provide the selection buttons to get the transmitted string in hex,binary,decimal or Ascii. I use the same string indicator for all data formats and case structure for selection. when i select the tunnel for indexing mode the connection error occurred... whats the solution for that ??the picture of VI is attached
And just a hint:
Handling those Booleans, ASCII, Hex, Decimal, Binary, will be a hole lot easier if you refactored them to a radio button (Raw, ASCII Hex, .ASCII Decimal, ASCII binary). Raw, Hex, Decimal and Binary are mutually exclusive. The radio button will be an enum, so you only need to implement 4 cases in one case structure. That will make 80% of that code redundant.
the picture of VI is attached
And that's a big problem. Pictures of VIs omit a lot of information, not the least of which is "What Version of LabVIEW is the Poster using?". If you are using LabVIEW 2016 or higher, there is a "solution" to your Post Title, passing values out after each iteration of For loop. So either Post your Code (attach a VI) or reply saying "I'm using LabVIEW xxxx".