get_xpaths_from_xml: Get XML xpath info

Description Usage Arguments Examples

Description

Get info on all the xpaths for a single device from the xml file. Data is organized into a data.frame

Usage

1
get_xpaths_from_xml(file_path_xml, device_name, mtconnect_version = NULL)

Arguments

file_path_xml

Path to the XML file

device_name

Name of the device in the xml. List of all the devices and their names can be got using the get_device_info_from_xml function

mtconnect_version

Specify MTConnect Version manually. If not specified, it is inferred automatically from the data.

Examples

1
2
3
4
file_path_xml = "testdata/dataExtraction/test_devices.xml"
device_name = "test_device"
xpath_info = get_xpaths_from_xml(system.file(file_path_xml, package = "mtconnectR"), device_name)
print(xpath_info)

Example output

               id                       name          type  category  subType
1          X_6467                       Xabs      POSITION    SAMPLE   ACTUAL
2          X_6468                    Xtravel      POSITION CONDITION     <NA>
3          X_6469                      Xload          LOAD    SAMPLE     <NA>
4          Y_6471                       Yabs      POSITION    SAMPLE   ACTUAL
5          Y_6472                    Ytravel      POSITION CONDITION     <NA>
6          Y_6473                      Yload          LOAD    SAMPLE     <NA>
7 controller_6500 pallet-1-fixture-positions       PART_ID     EVENT     <NA>
8       path_6513                       Sovr SPINDLE_SPEED    SAMPLE OVERRIDE
9       path_6521                  Frapidovr PATH_FEEDRATE    SAMPLE OVERRIDE
                                                    xpath
1               test_device<Device>:Xabs<POSITION-ACTUAL>
2                   test_device<Device>:Xtravel<POSITION>
3                         test_device<Device>:Xload<LOAD>
4               test_device<Device>:Yabs<POSITION-ACTUAL>
5                   test_device<Device>:Ytravel<POSITION>
6                         test_device<Device>:Yload<LOAD>
7 test_device<Device>:pallet-1-fixture-positions<PART_ID>
8        test_device<Device>:Sovr<SPINDLE_SPEED-OVERRIDE>
9   test_device<Device>:Frapidovr<PATH_FEEDRATE-OVERRIDE>

mtconnectR documentation built on May 1, 2019, 10:38 p.m.