As @Mishyoshi suggests you need to have a way to get the length of the string as you dynamically extend it.
You can do this by sending a command that gets the last module to respond, however that implies that each module knows when there is a downstream partner connected.
In conventional RS232 land you'd do this with CTS/RTS so you know there is a client connected to the output port. Since this involves extra wires I'm sure you'd want to avoid it as a solution.
As a simple protocol without any inter module connection test you could send a command to which each module responds with its ID number, so for one out command character you'd get say a one character reply from each module ...so for 4 modules south of the master you'd get four characters in sequence back to the master.
Send the command on a regular basis and you'd have a viable schema. Here you have each module separately identified (if you have unique module ID numbers, which is a good idea IMO) with the character order telling you it's position in the string.
The downside here is that when the out command reaches the end of the module string you have to use a timeout value to know the end of the string was reached.
If you want to reduce the number of character replies involved or don't have ID numbers for modules, one thought is to use a current detector on the Vin power line. Draw say a fixed number of mA (your downstream MCU may be enough) and assume that if current is drawn there is a southside client connected. The last module now knows if there is another module connected, and if there is not, it sends a reply character. So the command out gets a single character reply from the query command.
To get a string count the modules would have to increment the count for the return character as it passes through each module on the way back to the master. Each module records the count value as it's own position number in the string. So modules have a count value from the south end starting at 1.
While on the subject of Vin, I'd suggest it would be better to use a much higher supply voltage (say 48 V DC) to reduce the current flowing down the wires. You will have voltage drop to contend with in both Vin and Gnd so increasing the voltage reduces this problem.
If you are using RS232 Tx/RX then your baud rate needs to reflect the distance between modules, with 10m I'd suggest no more that 9600 baud ...this gives you a character space of about 1 ms and you'd need to decide if this is fast enough fro your application.