whats the correct way for addressing AI/DI/AO/DO in programming for sake correct configuration hardware?
For example if in automation builder for one analog input in one analog module we consider AI8, then in codesys programmin is it enough we write AI8?
Is it true?
Yes, that is enough.
In your case, after you enter your variable AI8 in Control Builder for the analog input channel, then you can find your variable AI8 in codesys in Global Variables folder (depends on hardware configuration).
Note - after enter of any variable to I/O channel, the codesys project (application) have to be updated in order see the I/O variables there
This follows for All Global Variables you create too.
Just Write the TAG acc to your wish and ENTER.
There may be case that you dont directly find your TAG in Global Variable list(where in reality it is available there)
At that time, GO ONLINE ( either simulation or Live) and then again select Global Variables. All the variables will be found then.