EICS
Member
Excuse my inexperience with cicode, I have a citect issue I need to make "Global" where the line below is shown in bold in the below function SPDisplayTagInfo().
FM_D2FIB4_MBSP_NEW; ! <------- Make Global here
The function works and is what i want but instead of"FM_D2FIB4_MBSP_NEW" tag i need to associate with value of the first variable passed, i know this is simple but is got me stumped. just about to leave site an will probably clear my mental blank on the drive home.
FUNCTION
SPDisplayTagInfo() ! This function is called on page opening of !6fibSP
STRING sVtags; ! Variable tag name
STRING sComment; ! Comment field of the variable tag
STRING sZeroScale; ! Eng. zero scale of variable tag
STRING sFullScale; ! Eng. full scale of variable tag
STRING sEngUnits; ! Eng. units of variable tag
STRING sValidRng; ! Valid range of the variable tag
STRING sGlobalMin; ! "Global" Fiberiser Minimum Speed Value
STRING sGlobalMax; ! "Global" Fiberiser Maximum Speed Value
INT iExistValue; ! "INTEGER" type - Existing Setpoint Value
REAL rRealExistValue; ! "REAL" type - Existing setpoint value
REAL rPCExistValue; ! % of Existing setpoint value
sVtags = AssInfoEx(1,0); ! the first variable tag (e.g. FM_D2FIB4_MBSP_NEW)
iExistValue = FM_D2FIB4_MBSP_NEW; ! <------- Make Global here for all positions
rRealExistValue = IntToReal(iExistValue);
rPCExistValue = rRealExistValue * 0.90;
sComment = DspInfoField(0,sVtags,"Comment"); ! the comment of the first variable tag
sZeroScale = rPCExistValue:####; ! the New "Zero Value" (90% of the Existing value)
! sZeroScale = FM_SPIN_MIN_ALLOW_SPEED; ! the "Zero Value" (Global Minimum Value)
sFullScale = FM_SPIN_MAX_ALLOW_SPEED; ! the "Full Value"
sEngUnits = DspInfoField(0,sVtags,"Eng_Units"); ! the "Engineering Unit" of the first variable tag
IF sEngUnits = "RPM" THEN; ! IF the Tag is Speed "RPM" then give the range
sValidRng = sZeroScale +" To "+ sFullScale; ! The Engineering Range of the first variable tag
ELSE
sValidRng = "Error" + " " + sEngUnits; !
END ! IF Statement END
PageSetStr(1,sComment); ! Display Tag Comment
PageSetStr(2,sValidRng); ! Display Tags' valid range.
END ! SPDisplayTagInfo END
FM_D2FIB4_MBSP_NEW; ! <------- Make Global here
The function works and is what i want but instead of"FM_D2FIB4_MBSP_NEW" tag i need to associate with value of the first variable passed, i know this is simple but is got me stumped. just about to leave site an will probably clear my mental blank on the drive home.
FUNCTION
SPDisplayTagInfo() ! This function is called on page opening of !6fibSP
STRING sVtags; ! Variable tag name
STRING sComment; ! Comment field of the variable tag
STRING sZeroScale; ! Eng. zero scale of variable tag
STRING sFullScale; ! Eng. full scale of variable tag
STRING sEngUnits; ! Eng. units of variable tag
STRING sValidRng; ! Valid range of the variable tag
STRING sGlobalMin; ! "Global" Fiberiser Minimum Speed Value
STRING sGlobalMax; ! "Global" Fiberiser Maximum Speed Value
INT iExistValue; ! "INTEGER" type - Existing Setpoint Value
REAL rRealExistValue; ! "REAL" type - Existing setpoint value
REAL rPCExistValue; ! % of Existing setpoint value
sVtags = AssInfoEx(1,0); ! the first variable tag (e.g. FM_D2FIB4_MBSP_NEW)
iExistValue = FM_D2FIB4_MBSP_NEW; ! <------- Make Global here for all positions
rRealExistValue = IntToReal(iExistValue);
rPCExistValue = rRealExistValue * 0.90;
sComment = DspInfoField(0,sVtags,"Comment"); ! the comment of the first variable tag
sZeroScale = rPCExistValue:####; ! the New "Zero Value" (90% of the Existing value)
! sZeroScale = FM_SPIN_MIN_ALLOW_SPEED; ! the "Zero Value" (Global Minimum Value)
sFullScale = FM_SPIN_MAX_ALLOW_SPEED; ! the "Full Value"
sEngUnits = DspInfoField(0,sVtags,"Eng_Units"); ! the "Engineering Unit" of the first variable tag
IF sEngUnits = "RPM" THEN; ! IF the Tag is Speed "RPM" then give the range
sValidRng = sZeroScale +" To "+ sFullScale; ! The Engineering Range of the first variable tag
ELSE
sValidRng = "Error" + " " + sEngUnits; !
END ! IF Statement END
PageSetStr(1,sComment); ! Display Tag Comment
PageSetStr(2,sValidRng); ! Display Tags' valid range.
END ! SPDisplayTagInfo END
Last edited: