Sunday, November 4, 2012

Cicode- SCADA


/* Spawns a task to run the GoPulse() until complete. This pulses a tag. This function will spawn a fresh task each time.Errors will cause a h/w alarm however PulseLastError() and PulseLastErrorTag()are available to get more information.*/

FUNCTION Pulser(STRING sTAGNAME, STRING sCLUSTER = "")
    INT hTask;
    INT lastErrorCode;
   
    ErrSet(1);
   
    hTask = TaskNew("GoPulse","^"" + sTAGNAME + "^",^"" + sCLUSTER + "^"",0,sCLUSTER);
    IF (hTask < 0) THEN
        // Unable to create task (at task limit ?)
        lastErrorCode   = IsError();
        ErrSetHw(2, lastErrorCode, 0);
        ErrLog("Error using system cicode Pulser() function: Tag '" + sTAGNAME + "' Cicode error " + IntToStr(lastErrorCode));
    END
    ErrSet(0);
END

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.