sounds like your code to address the serial port file is the problem
when addressing a port you must send
1} a single char
2} an array of chars
if you need to send more than one char
then you must
1} group your array to a buffer
2} open the port
3} send the array
provided the mcu firmware is set up to
wait for port
read one byte
wait for next byte etc....
you must add a loop with a timeout branch
the time out is a counter driven event
look for examples at
http://www.8052.com/
sounds like you need to use a port monitor app like
portmon its a good software shows you whats going on
a tip is to get a pci video card plug it in connect a second monitor and run this on that
this is what i do to debug ports
even use three monitors and a two head agp card
http://www.softpedia.com/get/Tweak/Network-Tweak/Portmon.shtml
take time to do it yourself
youll soon see your error
and dont hammer your head
sometimes a rest give's clarity
best solve this problem with heinsight and time shift