extract_param_from_xpath: Extract different parts of a xpath

Description Usage Arguments Examples

Description

Returns a single parameter extracted from the xpath vector. It could be Data Item Name or Data Item type or name of the Device. If the character vector is not in xpath format, the original name is returned and a warning is given

Usage

1
2
extract_param_from_xpath(strName, param = "DIName", removeExtended = F,
  show_warnings = T)

Arguments

strName

is the xpath string

param

is the parameter to be extracted. Can be "DIName", "DIType" or "Device"

removeExtended

if True, then the x: prefix is removed from extended JSON class Types

show_warnings

if false, silences the warnings

Examples

1
2
3
4
5
6
7
8
9
xpaths = c("timestamp",
 "nist_testbed_Mazak_QT_1<Device>:avail<AVAILABILITY>",
 "nist_testbed_Mazak_QT_1<Device>:execution<EXECUTION>",
 "nist_testbed_Mazak_QT_1<Device>:Fovr<x:PATH_FEEDRATE-OVERRIDE>")

extract_param_from_xpath(xpaths, "DIName")
extract_param_from_xpath(xpaths, "DIType")
extract_param_from_xpath(xpaths, "DIType", TRUE)
extract_param_from_xpath(xpaths, "Device")

systeminsights/mtconnectR documentation built on July 3, 2019, 1:37 p.m.