GetMousePositionOfLastClick

TwinCAT TIA
Local Mouse functions

ns=2;s=DEPRAG Smart/Local/MouseFunctions/GetMousePositionOfLastClick

Returns the position of the mouse when a mouse button was last pressed. The prerequisite for this is that the detection of the position was previously activated via the "StartDetectingMouseClick" function.

Returns:

    GetMousePositionOfLastClick
    A variable of type OpcMethodReturnValueMousePositionObject. The Result property contains the command-specific return values.
      Result
      The position of the mouse at the last press of a mouse button.
        XPosition
        The X-position of the mouse at the last mouse button press.
        (Origin (0) upper left edge of the screen).
        YPosition
        The Y-position of the mouse at the last mouse button press.
        (Origin (0) upper left edge of the screen).

Examples:

In addition to the parameters already explained, the following variables must be created / transferred for the implementation in TwinCAT 3:

Beckhoff parameter:

    bMouseFunctionsGetMousePositionOfLastClick
    A boolean variable that can be used to trigger the execution of the GetMousePositionOfLastClick command.
    OutputDataMouseFunctionsGetMousePositionOfLastClick
    An instance of the "ST_GetMousePosOutputData" structure into which the return value of the GetMousePositionOfLastClick method is written.
    hrMouseFunctionsGetMousePositionOfLastClick
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    fbMouseFunctions
    An instance of the "FB_MouseFunctions" function block supplied with the DEPRAG Smart library.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
       bMouseFunctionsGetMousePositionOfLastClick   : BOOL;
       OutputDataMouseFunctionsGetMousePositionOfLastClick : ST_GetMousePosOutputData;
       hrMouseFunctionsGetMousePositionOfLastClick   : HRESULT;

       fbMouseFunctions  : FB_MouseFunctions;
END_VAR

hrMouseFunctionsGetMousePositionOfLastClick := fbMouseFunctions.GetMousePositionOfLastClick(
             bExecute    := bMouseFunctionsGetMousePositionOfLastClick,   
             ConnectionHandle := depragSmartConnection.ConnectionHandle, 
             OutputData   => OutputDataMouseFunctionsGetMousePositionOfLastClick);
IF hrMouseFunctionsGetMousePositionOfLastClick <> S_FALSE THEN 
      bMouseFunctionsGetMousePositionOfLastClick := FALSE;
END_IF
                                                    

For examples and explanations regarding the calls of nodes via Siemens TIA Portal please refer to the sub-menu "Siemens TIA Portal" in section "Getting Started".