oscat.lib > oscat.lib fuer Step 7

SDT_TO_TOD problem - cast is missing

(1/1)

c3p0:
Hi,

It seems that the SDT_TO_TOD function is missing a cast. To function properly the .SECOND part of the SDT-structure must be converted to a DINT. The compiler apparently realizes that the other parts must be converted (since they are multiplied by numbers larger than what an INT can hold)...

The correct conversion would be:

SDT_TO_TOD := DINT_TO_TOD(DTI.HOUR * 3600000 + DTI.MINUTE * 60000 + INT_TO_DINT(DTI.SECOND) * 1000 + DTI.MS);

dalbi:
Hi c3p0,

thank you!  ;)

Greetings Daniel

Navigation

[0] Themen-Index

Zur normalen Ansicht wechseln