Save Strings in a Matrix

For an Aplication we need to Save String-Toople or a Matrix 2x3 with Strings.

The Programm is so organised, that the Cobot get MSG from a Socket server , they looks like " PC1 Cobot Go-to-Position" or “Smartphone Cobutt grap the Bottle”

After getting the msg, the cobot do the stuff that is explain with the Word 3 and the following words. For example “Go-to-Position” and “grap the Bottle”.
But it is important, that the Cobot knows from wich divice the request cames. When “PC1” send the request “fill me” it is another task then “Smartphone” send “fill me”. so the cobot need to handle more than one divice at the same time and need to save the requests. (all requests came over only one Socket-pipe, and if both divices send 2 msg´s at the same time, it needed to save both inside of the Cobot)

the maximum of sametime-devices is 3. but wich devises are in use is not clear at the startingpoint of the Cobot.

my Idear was the following Programm:

Function to split string in Seperate Words, so they only need to save in a Matrix:

def split3param:
i=0
Array = [" ", " ", " "]
len = str_len(msg)
while i<3 or len != " “:
if i ==2:
Array[2] = msg
else:
space = str_find(” ", msg)
Array[i]= str_sub(msg, 0, space-1)
msg = str_sub(msg, space+1, len)
end
i++
return Array
end

The Problem: Matrix and Arrays can not handle type String, so i have a little problem to manage all unknown devices and all posible requests. ( there is a Devicepool from roundabout 20 diffrent devices in this moment) and the request have in this moment 5 diffrent posibillyties.
so i came to 100-cases if i need to know all posibilitys…