I guess the first question is how is the Atom connected to the PC? If you are using something like the ABB board and using the 9 pin RS232 connector that is connected to it, then you are not using the hardware serial port, you are using a bit bang serial port (S_IN and S_OUT).
So you might try changing your code on the atom to
serout S_OUT, i9600, [dec zahl]
What do your connections to the BA(?) look like… how are you connecting to the PC?
Using hserial (hardware serial), If you are using an ABB and the DB-9 connector on it to talk to the PC then that is the root of the problem. The hardware serial lines on the BA pro are not the DB-9 connector, and second the PC likes to drive the DTR signal active which will hold the BA in reset. To use the DB-9 you have to use the bit-banged half-duplex serial routines and S_IN / S_OUT as the port pins.
EddieB and kurte,
thanks for quick response. I am using the Basic Atom (not pro), Mini ABB and connection with RS232-9pin.
I don´t know what means to use “bit-banged half-duplex serial routines and S_IN / S_OUT as the port pins”.
Would you please explane?
I tried to change my code on the atom to “serout S_OUT, i9600, [dec zahl]”, but it still doesn´t work.
Not super familliar with the BA vs. the BAP but generally speaking there are two types of serial routines, hardware and software. Hardware uses the built in UART in the microcontroller. Software uses timing loops and i/o pins to synthesize serial output… this is frequently called bit banging. The advantage of a software serial output is you can generally use any i/o pin, vs. hardware serial is restricted to only those dedicated pins on the microcontroller. Downside to software serial is it is a blocking routine that prevents pretty much anything else from happening so that it can meet the timing requirements to “create” the serial output. Hardware serial on the other hand only needs attention when a byte has been sent or received and can even be arranged to use interrupts and buffers. On the BAP (again not sure about the BA but I suspect it is the same) the DB-9 connector is NOT connected to the hardware serial lines so you need to use the software routines… the syntax for which kurte has supplied.
Have you tried your program using the terminal window in the basic micro IDE rather than your custom program? I would almost bet that your serial communication module initializes the DTR handshake to active, this is pretty much the norm on PCs, which will hold the BA (or BAP) in reset. The terminal window in the IDE knows about the DTR line so you can test your BA codes ability to send data out the S_OUT pin using that, then once you know the hardware and your BA software works focus on your VB program.
In your MSComm initialization try adding a
.Handshaking = comNone
.DTREnable = False
although I am not certain which is the correct DTR polarity so you may need to try both False and True on the DTREnable line and see if you can get the output into your program.