FabioPD - 2020-03-12

Hello

I have read all online documentation , I create the xml file
and the library for the AM2315 with an empty project (i don't know how to use SVN in codesys) .

I tried this code in my library instance in my project (PLC_PRG)

TeH: AM2315FB;


TeH.usiAddress:= 0 ;
TeH.TimeSchedule:= T#200MS;
TeH();

TeH.AfterReadInputs();

and the main code of lib is:

SUPER^();

CASE _iState OF
0:
IF usiAddress = 0 THEN
usiAddress := 16#5C;
END_IF
IF SUPER^.init() THEN
_iState := 5;
END_IF

5:
Timer.pt := TimeSchedule;
_iState := 10;
intState:= 10;
xTempValid := FALSE;
xHumidityValid:=FALSE;

END_CASE

BUt doesn't _iState is always 0 ...may be SUPER^.init() is not working? Why ? Have I to add something to my I2c bus Device or is enough using the library?
Thanks