Add Historical Record
Request URL
URL1:
[Host Server]/api/v2/box/{boxId}/hdataitems
URL2:
[Host Server]/api/v2/hdataitems/?boxNo={boxNo}
Query Parameters
Field Type Description Host Server string See Explanation of terms boxId Long Find it in Get FGate list interface: boxRegs->box->id boxNo string Serial number of FGate Method
PUT
Headers
Field Type Description Authorization string "Bearer " + Access Token obtained from the login interface Body
Collection of historical records for multiple channels, with the following attributes:
Field Type Description name string Name of Datalog Entry period int Sampling Cycle, unit: s, range: 1-86400 channels array Channel Collection, individual attributes are as follow hasctrl bool Whether to enable. If enabled, enable configuration needs to be set. ctrl object Enable Configuration Attributes Channel Individual Attributes:
Field Type Description name string Channel Name unit string Channel Unit desc string Channel Description intDigits int Channel Integer fracDigits int Channel Decimal Part devAlias string Device Driver Alias station int PLC Communication Station Number dataType int Data type, see Appendix Two for details. Binary, hexadecimal, and string types are not supported. regId int Register ID, used in conjunction with ioWidth to determine a unique register. ioWidth int Register Bit Width, used in conjunction with regId to determine a unique register. regName string Register Name, which can uniquely identify a register. Either of the above two parameters can be selected addr int PLC main address subAddr int PLC sub-address addrBlk int PLC DB block address valueTransform jobject Numeric Operation Settings executeOnEdge boolean Enable Edge Execution, numeric operation must be configured when enabled. Value operation settings detailed table
Field Type Description maxValue int Upper Limit of Value minValue int Lower Limit of Value scaleMaxValue int Upper Limit of Scale scaleMinValue int Lower Limit of Scale gain int Gain offset int Offset type int 1: Proportional Conversion, 2: Scaling Enable Configuration Attributes
Field Type Description ctrlType int Enable Option: 0 for Disable, 1 for Enable. devAlias string PLC Alias (device alias in remote download). station int Station Number dataType int Data type, see Appendix Two for details. regId int Register ID, used in conjunction with ioWidth to determine a unique register. ioWidth int Register Bit Width, used in conjunction with regId to determine a unique register. regName string Register Name, which can uniquely identify a register. Either of the above two parameters can be selected addr int PLC main address subAddr int PLC sub-address addrBlk int PLC DB block address Successful Response
Return the UID primary key of the added historical record entry.
Return Code
Field Description 200 Request Successfully 401 Access Token Expired 404 The interface doesn't exist,please check URL. 400 Error message in the HTTP header[X-FBox-Code], see Appendix Three for details. 429 Access the interface so frequently. See 429 Status code Postman example is as follows:
- Please see the example in the following image.