How exactly is an enigma simulation software supposed to encrypt alphabets? EDIT: The model I'm trying to make is "Enigma 1". I learned initially about it from a book called "Code Book" and then looked at it in detail from its wikipedia page. The rotor wiring and other details from https://en.wikipedia.org/wiki/Enigma_rotor_details

I am trying to make an enigma machine simulating software. I know how the machine works but am having trouble trying to understand what my code's logic should be BEFORE the alphabets get to the reflectors.

Suppose 1, 2 and 3 represent each rotor's settings in an enigma machine (they're what I got from wikipedia):

  abcdefghijklmnopQrstuvwxyz
1:ekmflgdqvzntowyhxuspaibrcj

  abcdEfghijklmnopqrstuvwxyz
2:ajdksiruxblhwtmcqgznpyfvoe

  abcdefghijklmnopqrstuVwxyz
3:bdfhjlcprtxvznyeiwgakmusqo


And suppose the message is "A". Here's what I think should happen: From the first rotor, the message could have become "E" but because the rotors spin by one unit before the encryption, it is encrypted to the next letter in the setting: "K".
Now to find what happens in the second rotor, we need to see the 11th letter in the setting (or the letter below K) which is "L".
Similarly for the final rotor, we see the 12th letter (below "L") which is "V" and that from my understanding should be what is transferred to the reflector and then back.

Though my software is complete with ring settings, plugboard and all the other stuff and it can decrypt it's own encrypted messages the way it is supposed to, the ciphertext is never the same as what online enigma simulators produce for the same settings, nor can it decrypt original messages even if I know all the settings. If you go here:
http://people.physik.hu-berlin.de/~palloks/js/enigma/enigma-u_v20_en.html
click "show monitor" button and type "a" you will see that before it reaches the reflector, it is translated as "H". So clearly I'm doing something wrong.

Can somebody please help me out?
I guess you already figured it out but my guess is that you forgot to move the first rotor 1 step before starting the encryption. That also impacts what letter it arrives to on next rotor and so on.

The complete path is

KBD-A&gt;SB&gt;A - A&gt;ETW&gt;A - B&gt;(1)R3&gt;K - J&gt;(2)R2&gt;B - B&gt;(3)R1&gt;D - D&gt;UKW&gt;H 
  - H&gt;(3)R1&gt;D - D&gt;(2)R2&gt;C - D&gt;(1)R3&gt;G - F&gt;ETW&gt;F - F&gt;SB&gt;F-light


Keyboard A arrives to plugboard (Steckerbrett) as A, leaves the plugboard as A, arrives to Entry wheel as A, leaves as A, arrives to the first rotor at level B, gets rewired to K and so on.
Typing 3 more "A" gives

 A&gt;SB&gt;A - A&gt;ETW&gt;A - C&gt;(1)R3&gt;M - K&gt;(2)R2&gt;L - L&gt;(3)R1&gt;V - V&gt;UKW&gt;W
       - W&gt;(3)R1&gt;R - R&gt;(2)R2&gt;G - I&gt;(1)R3&gt;V - T&gt;ETW&gt;T - T&gt;SB&gt;T  :T

 A&gt;SB&gt;A - A&gt;ETW&gt;A - D&gt;(1)R3&gt;F - C&gt;(2)R2&gt;D - D&gt;(3)R1&gt;H - H&gt;UKW&gt;D
    - D&gt;(3)R1&gt;B - B&gt;(2)R2&gt;J - M&gt;(1)R3&gt;C - Z&gt;ETW&gt;Z - Z&gt;SB&gt;Z  :Z

 A&gt;SB&gt;A - A&gt;ETW&gt;A - E&gt;(1)R3&gt;L - H&gt;(2)R2&gt;U - U&gt;(3)R1&gt;K - K&gt;UKW&gt;N
    - N&gt;(3)R1&gt;N - N&gt;(2)R2&gt;T - X&gt;(1)R3&gt;Q - M&gt;ETW&gt;M - M&gt;SB&gt;M  :M