So as an update. i gave up. i never got it to work. The unilogic software never read the XML file correctly whatever i tried. I am still not sure what exactly is the problem but it is definitely a problem with the unitronics materials. Unitronics weren't very helpful either.
I switch to Ethernet/IP. got that to work but funnily enough not with again a weird issue. when loading in the KRC EDS file to configure the PLC as scanner. The software automatically used the max number of bytes defined for the in and outputs (505 and 509). which you can't change after. this is a problem because unilogic only support up to 505 bytes, so the program won't compile. in this case i could configure the scanner manually, but all together this hasn't been a great experience with the unitronics materials.