The ArchFX Cloud has an extensive API that can be used to download any data, including machine sensor and connector data. This article describes a simple way to use this API from the Browser to download this data.
ArchFX Cloud uses the concept of DataViews to group different data into a combined table. A DataView is equivalent to a worksheet in an Excel spreadsheet. For something as simple as OEE or LU calculations, this DataView may only have a single column with the machine "product_ready" signal, which represents when a unit is built by the given machine.
When machines are grouped into a factory line or factory area, the concept of DataViews is still used to output data for all machines in that line or area. In this case, an additional column is added to represent the machine that is outputting the data.
For OEE and LU calculations, the following DataView names are available:
- Lines have an oee-line-view which groups all data in 15min buckets (to reduce the amount of data returned)
- Areas have an oee-area-view which groups all data in 15min buckets (to reduce the amount of data returned)
- Machines have an oee-view which groups all data in 15min buckets (to reduce the amount of data returned)
Given a DataView name, you can access the data using the following URL:
- sub-domain is the specific server subdomain associated with your company, or "arch" if you are using the general purpose Arch Server.
- view is one of the DataView names described above.
- arch_id is the ID for the Area, Line or Machine you want to get data from. You can get this ID from the multiple places. Usually referred to as "Arch ID", "Slug" or as part of the page URL (e.g. "domain/org/org-name/machine/d--0000-0001-0000-1234" where the Machine Arch ID is "d--0000-0001-0000-1234"). The Machine Arch ID always starts with "d--" while the Area start with "pa--" and the Line with "pl--".
- start is the start time for the time range you want to get data for. This time is in UTC and requires a string in the form of "2020-01-01T10:00:00Z".
- end is the end time for the time range you want to get data for. This time is in UTC and requires a string in the form of "2020-01-01T10:00:00Z".
- format is the return payload format. The options are "csv" (default) or "json" or "txt". Note that this is an API call, intended to be called from a script, so it was not intended to be used from a browser. The "json" and "txt" formats always work from a browser, but depending on your browser, the "csv" may work in different ways (for example, Google Chrome will not show any error messages). If you want to download a CSV from the browser, it is recommended you use "format=txt" and then use the browser's "Save As" menu option to save as a "your-filename.csv".
The CSV will be formatted with the following columns
- row contains the timestamp for the reading (or if grouped, the time of the grouping)
- device represents the Machine Arch ID. You can copy and paste this ID to any of the search bars in archfx.io or app.archfx.io to get information about that machine. Or you can also use the <subdomain>.archfx.io/api/v1/machine/ API to get a list of machines in your Organization.
- The rest of the columns represent data for that target based on the given area, line or machine type and the DataView you use.
The following is an example of a what you get on an SMT Line with a PnP and AOI connector.
This same API call can be called from a script or using a utility like "curl". See How to authenticate via the API to learn how to get the required JWT token to access this API call.