Applies To: |
|
Summary: |
I want to equate a Process Analyst cursor
value to a tag. How do I achieve this? |
Solution: |
This can be done through the use of cicode: _ObjectCallMethod(hTrendCursor , "GetValue", hPen, asLocal, Time2, milli, value); The difficulty is that you need to input the TrendCursor and the Pen, which are different objects into the same function. INT FUNCTION PA_cursor_value(INT PaneNo = 1, INT PenNo = 1, INT CursorNo = 1)
OBJECT hPA; OBJECT hCursors; OBJECT hTrendCursor; OBJECT hPanes; OBJECT hPane; OBJECT hPens; OBJECT hPen;
INT asLocal = 0; REAL Time2; INT milli; STRING value;
//GET PROCESS ANALYST OBJECT hPA = ObjectByName("CSV_PA"); //Change for name of your PA Object
//SELECT DESIRED PEN hPanes = _ObjectGetProperty(hPA,"Panes"); //Gets all Panes hPane = _ObjectCallMethod(hPanes,"get_Item",PaneNo); //Selects Desired pane hPens = _ObjectGetProperty(hPane,"Pens"); //Gets all Pens hPen = _ObjectCallMethod(hPens,"get_Item",PenNo); //Selects Desired Pen
//SELECT DESIRED TRENDCURSOR hCursors = _ObjectGetProperty(hPA,"Cursors"); hTrendCursor = _ObjectCallMethod(hCursors,"get_Item",Cursor No);//Get desired cursor
//GET CURSOR VALUE BASED ON PEN AND CURSOR _ObjectCallMethod(hTrendCursor , "GetValue", hPen, asLocal, Time2, milli, value);
RETURN StrToint(Value); //You may want to return as a real
END |
Keywords: |
Cursor, Process Analyst |
Related Links
Attachments