PGW2x.100

Description of the device
Wherever the process pressure has to be indicated locally and, at the same time, centralised, web-based remote monitoring is required, this IIoT-capable measuring instrument finds its use. The all welded and robust Bourdon tube measuring system produces a pointer rotation proportional to the pressure. The process pressure is indicated continuously by the pointer on the dial. The measuring electronics convert the pointer rotation into an electronic signal, which is further transmitted via the radio module and the antenna. Battery-operated radio transmission via LoRa® („long range“) is based on LPWAN technology (“low power wide area network”) to enable high transmission ranges and long battery life. The IIoT-capable model PGW2x.100 pressure gauge fulfils safety-related requirements of the relevant standards and regulations for the on-site display of the operating pressure of pressure vessels, as well as the requirements of the Radio Equipment Directive for data communication. In particular, the LoRaWAN® network (“long range wide area network”) enables the complete end-to-end encryption with bidirectional communication for safe IIoT applications. WIKA manufactures and qualifies the pressure gauge in accordance with the requirements of the EN 837-1 European standard in the “S3” safety version. The safety version is made up of a non-splintering window, a solid baffle wall between measuring system and dial and a blow-out back.
For more information see product site.
PGW23.100.11 Parser Quick Start
Parser API
All functions are pure (no global mutation) except adjustMeasuringRange which updates internal range configuration for subsequent decodes.
Types:
Input types:
interface UplinkInput {
fPort: number // LoRaWAN FPort
bytes: number[] // Raw payload as array of unsigned bytes (0-255)
recvTime?: string // Optional ISO timestamp (if your LNS provides it)
}
interface HexUplinkInput {
fPort: number // LoRaWAN FPort
bytes: string // Raw payload as hex-encoded string (case-insensitive, even length)
recvTime?: string // Optional ISO timestamp (if your LNS provides it)
}Return type (shared by all decode helpers):
type Result = {
data: Record<string, any> // Parsed key/value pairs
warnings?: string[] // Non-fatal anomalies
} | {
errors: string[] // Fatal or structural issues only
}To understand the data field, take a look at the examples and the schema definition.
Supported channels to identify different sensors by:
// Is used in the returned data
type ChannelName = 'pressure' | 'device temperature' | 'battery voltage'Channels that support adjusting the measurement range:
type AdjustableChannelName = 'pressure'Channel Configuration:
| Channel Name | Default Min | Default Max | Unit | Configurable |
|---|---|---|---|---|
pressure | 0 | 10 | bar/psi/MPa | Yes |
device temperature | -40 | 60 | °C/°F | No |
battery voltage | 0 | 5 | V | No |
*Unit depends on device configuration. Check device specifications or identification frames for actual unit and range.
decodeUplink(input)
function decodeUplink(input: UplinkInput): ResultdecodeHexString(hexInput)
function decodeHexString(hexInput: HexUplinkInput): DecodeResultbytes must have even length; case-insensitive.
adjustMeasuringRange(channel, range)
// Will throw on invalid channel name or if the channel disallows range updates
function adjustMeasuringRange(
channelName: AdjustableChannelName,
range: {
start: number
end: number
}
): voidApplies to future decodes only.
adjustRoundingDecimals(decimals)
// Smartly adjust number of decimals for rounded values
// Impacts all numeric values in all outputs
// Default is 4
function adjustRoundingDecimals(decimals: number): voidApplies to future decodes only.
encodeDownlink(input)
interface DownlinkInput {
protocol: 'TULIP2'
input: {
deviceAction: 'configuration'
configurationId?: number
byteLimit?: number
mainConfiguration?: {
measuringRate: number
publicationFactorWhenNoAlarm: number
publicationFactorWhenAlarm: number
}
channel0?: false | true | {
alarms?: {
deadBand: number
lowThreshold?: number
highThreshold?: number
lowThresholdWithDelay?: { value: number, delay: number }
highThresholdWithDelay?: { value: number, delay: number }
risingSlope?: number
fallingSlope?: number
}
}
channel1?: false | true
} | {
deviceAction: 'resetToFactory'
} | {
deviceAction: 'resetBatteryIndicator'
configurationId?: number
}
}
// encode a single downlink frame
function encodeDownlink(input: DownlinkInput): {
bytes: number[] // Encoded downlink payload as array of unsigned bytes (0-255)
fPort: number // LoRaWAN FPort to use
warnings?: string[] // Non-fatal anomalies
} | {
errors: string[] // Fatal or structural issues only
}Validates the input and encodes it into a single downlink frame. It uses the same range configuration as used for decoding. If the documentation refers to percentage values, use the real world values. (e.g. 20% deadband with 0-10 bar range is 2 bar (0.2 * 10)).
To understand the input structure, refer to the downlink examples.
encodeMultipleDownlinks(input)
// Same input type as encodeDownlink()
// encodes the given configuration in one or more downlink frames depending on byte size
function encodeMultipleDownlinks(
input: DownlinkInput
): {
frames: number[][] // Encoded downlink payloads as arrays of unsigned bytes (0-255)
fPort: number // LoRaWAN FPort to use
warnings?: string[] // Non-fatal anomalies
} | {
errors: string[] // Fatal or structural issues only
}To understand the input structure, refer to the downlink examples.
Verifying Measurement Ranges
Critical: The default pressure range may not match your device. Always verify the actual range from one of these sources:
- Device specifications from your purchase order or datasheet
- Identification frames sent by the device
Using incorrect ranges will result in incorrect measurement values in all data messages.
TULIP2 Identification Frames
For this device, identification messages (message type 7/0x07) report pressure and device temperature ranges:
Example TULIP2 identification frame:
{
"data": {
"messageType": 7,
"configurationId": 1,
"deviceInformation": {
"measurementRangeStartPressure": 0,
"measurementRangeEndPressure": 10,
"measurementRangeStartDeviceTemperature": -40,
"measurementRangeEndDeviceTemperature": 60,
"pressureUnitName": "bar",
"deviceTemperatureUnitName": "°C"
}
}
}Use the pressure range values to configure the parser before decoding and encoding TULIP2 values.
Quick Start
- Check your device's actual pressure range from purchase configuration, device specifications, or identification frames (see above)
- Add configuration code below at the bottom of your parser file
- Add wrapper function if your network server is non-compliant: e.g.
function decode(input) { return decodeUplink(input) }
Configuration code (add at bottom of parser file):
// Replace 0 and 10 with your device's actual pressure range
adjustMeasuringRange('pressure', { start: 0, end: 10 })NPM Module Inclusion
| Device | Included | Factory function |
|---|---|---|
| PGW23 | ✔️ | PGW23Parser |
