TestBench.tools
GitHub

LS XGT / XGK Address Converter

Split XGK addresses into word and hex bit, bit and word devices alike.

Device areas

P M K F L S — bit devices

D R Z — word devices

Bit devices carry the bit as their last digit; word devices take a dotted bit. Either way the bit is hexadecimal.

Canonical
P00105
Device
P — I/O relay (bit device)
Word number (decimal)
10
Bit
5 (written 5 in hex)
Bit from start of area
165
Word address
P0010
Next 8 consecutive bits — rolls into the next word after F

P00105 · P00106 · P00107 · P00108 · P00109 · P0010A · P0010B · P0010C

This tool splits an LS ELECTRIC XGK/XGB device address into its word and bit. Bit devices such as P and M carry the bit as their last digit in hexadecimal, so P00105 is word 10, bit 5; word devices such as D take a dotted hex bit, so D0011.A is word 11, bit 10. Enter either form and it returns the split, the flat bit position and the plain word address.

How it works

XGK writes a bit address by gluing the bit onto the end of the word number, and that last digit is hexadecimal. It reads naturally once you know it — P0000F is the sixteenth bit of the first word — but it makes two mistakes easy. The first is reading P00105 as “point 105” rather than word 10 bit 5. The second is expecting decimal to keep going: after P00009 the next bit is P0000A, not P00010, which is already the next word.

Word devices work the other way round: the number stays decimal and a dot introduces the bit, still in hexadecimal. Mixing the two forms is what the controller rejects — a bit device does not take a dot, and a word device does not absorb the bit into its digits. The tool applies the classification from the manual's device area table, so the error you get names the rule rather than just refusing the input.

Worked example

P00105 → word 10, bit 5 (hex 5)
P0000F → word 0, bit 15 · flat bit 15
P00010 → word 1, bit 0 · flat bit 16
D0011.A → D word 11, bit 10 (hex A)
P0000.1 → rejected — bit devices do not take a dot

Device areas and syntax

ParameterValueNotes
PI/O relaybit device
MAuxiliary relaybit device
KKeep relaybit device
FSpecial relaybit device
L / SLink / Step control relaybit device
DData registerword device
R / ZFile / Index registerword device
Bit device formword + last hex digitP2047F = word 2047 bit 15
Word device formdecimal word . hex bitD0011.A = word 11 bit 10

Source: LS ELECTRIC, XGK/XGB Instructions and Programming V2.2 — §2.2 data types and §2.3 Device Area.

FAQ

What does P00105 mean?

Word 10, bit 5 of the I/O relay area. On a bit device the last digit is the bit and it is written in hexadecimal, while everything before it is the word number in decimal. So P00105 splits as word 0010 and bit 5.

Why does P0000F exist but P00016 does not?

Because the bit digit is hexadecimal and a word holds sixteen bits, numbered 0 to F. P0000F is bit 15 of word 0. Writing P00016 does not give you bit 16 — there is no such bit; it reads as word 1, bit 6.

How do I address a bit of a data register?

With a dot: D0011.A is bit 10 of D word 11. D is a word device, so its bit is selected by a dot rather than by an extra digit, but the bit number is hexadecimal in both cases — the manual's own example is D0011.A for bit 10.

Which devices are bit devices and which are word devices?

The manual classifies P, M, K, F, L and S — plus the T and C contacts — as bit devices, addressed without a dot. D, R, U, Z and the T and C present values are word devices, where a dot selects the bit. The tool applies the right rule per device.

Where do these rules come from?

From LS ELECTRIC's XGK/XGB Instructions and Programming manual, version 2.2: section 2.2 states that a bit device's lowest place is marked in hexadecimal, and that for a word device the device number is decimal while the bit number is hexadecimal; section 2.3 lists which devices are which.

Is anything uploaded?

No. Addresses are parsed locally in your browser.

Related tools