IsArrayValue

TwinCAT TIA
Local File and directory access JSON reader ActiveJsonDocuments A JSON document

ns=2;s=DEPRAG Smart/Local/FileAndDirectoryAccess/Json/ActiveJsonDocuments/0/IsArrayValue

The command checks whether the value of the specified element contains an array.

Parameters:

Returns:

    IsArrayValue
    A variable of the OpcMethodReturnValueBoolean type. The Result property contains the command-specific return values.
      Result
      A boolean variable that indicates whether the element contains an array value.

Examples:

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

Beckhoff parameter:

    bJsonIsArrayValue
    A boolean variable that can be used to trigger the execution of the IsArrayValue command.
    OutputDataJsonIsArrayValue
    An instance of the "ST_BoolOutputData" structure into which the return value of the IsArrayValue method is written.
    hrJsonIsArrayValue
    This can be used to monitor the execution of the command. Error codes have the type "HRESULT".
    fbJson
    An instance of the "FB_Json" function block supplied with the DEPRAG Smart library.
    MemberPath
    A STRING(255) variable specifying the path of the JSON element in the JSON file.
    ClientId
    A STRING(255) variable that uniquely identifies the JSON document in the ActiveJsonDocuments list.
    ConnectionHandle
    "ConnectionHandle" received when establishing a connection between DEPRAG Smart Server and your OPC UA client.


VAR
   bJsonIsArrayValue   : BOOL;
   OutputDataJsonIsArrayValue   : ST_BoolOutputData;
   hrJsonIsArrayValue  : HRESULT;

   fbJson : FB_Json;
END_VAR

hrJsonIsArrayValue := fbJson.IsArrayValue(
       bExecute    := bJsonIsArrayValue,   
       ConnectionHandle := depragSmartConnection.ConnectionHandle, 
       MemberPath   := 'Data.Array',  
       ClientId   := '0',
       OutputData   => OutputDataJsonIsArrayValue);
IF hrJsonIsArrayValue <> S_FALSE THEN 
  bJsonIsArrayValue := 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".