Matlab Simulink/LQ_Target_1500S_V4_0_grt_Output/LQ_ODK/src_odk_helpers/ODK_CpuReadData.cpp
bool CODK_CpuReadData::CheckS7DTL(const ODK_DTL& dtl)
{
	// year
    if (1970 > dtl.Year  ||  2262 < dtl.Year)
    {
        return false;
    }
    // month
    if (1 > dtl.Month  ||  12 < dtl.Month)
    {
        return false;
    }
    // day
    if (1 > dtl.Day  ||  31 < dtl.Day)
    {
        return false;
    }
    // weekday
    if (1 > dtl.Weekday  ||  7 < dtl.Weekday)
    {
        return false;
    }
    // hour
    if (23 < dtl.Hour)
    {
        return false;
    }
    // minute
    if (59 < dtl.Minute)
    {
        return false;
    }
    // second
    if (59 < dtl.Second)
    {
        return false;
    }
    // nanosecond
    if (999999999 < dtl.Nanosecond)
    {
        return false;
    }

    return true;
}
// return true, when DTL is in valid range
// (static)
return true, when DTL is in valid range
(static)
return true when DTL is in valid range ( static )
bool CODK_CpuReadData::CheckS7DTL(const ODK_DTL& dtl)
{
    if (1970 > dtl.Year  ||  2262 < dtl.Year)
    {
        return false;
    }
    if (1 > dtl.Month  ||  12 < dtl.Month)
    {
        return false;
    }
    if (1 > dtl.Day  ||  31 < dtl.Day)
    {
        return false;
    }
    if (1 > dtl.Weekday  ||  7 < dtl.Weekday)
    {
        return false;
    }
    if (23 < dtl.Hour)
    {
        return false;
    }
    if (59 < dtl.Minute)
    {
        return false;
    }
    if (59 < dtl.Second)
    {
        return false;
    }
    if (999999999 < dtl.Nanosecond)
    {
        return false;
    }
    return true;
}
bool CODK_CpuReadData :: CheckS7DTL ( const ODK_DTL & dtl ) { if ( 1970 > dtl . Year || 2262 < dtl . Year ) { return false ; } if ( 1 > dtl . Month || 12 < dtl . Month ) { return false ; } if ( 1 > dtl . Day || 31 < dtl . Day ) { return false ; } if ( 1 > dtl . Weekday || 7 < dtl . Weekday ) { return false ; } if ( 23 < dtl . Hour ) { return false ; } if ( 59 < dtl . Minute ) { return false ; } if ( 59 < dtl . Second ) { return false ; } if ( 999999999 < dtl . Nanosecond ) { return false ; } return true ; }
return true, when DTL is in valid range
(static)
return true when DTL is in valid range ( static )
// year // month // day // weekday // hour // minute // second // nanosecond