Explainer
What byte swap does on a 1734-232ASC feeding an SLC 500
Short answer
Byte swap on the 1734-232ASC reverses the order of the two bytes inside each 16-bit word. The module packs the first serial character it receives into the low byte of each word, while the SLC 500 reads a word high byte first, so ASCII 1234 lands in the M-file as 2143. Enable the module's Byte Swap mode for the receive direction, or swap the bytes in your own copy logic, never both.

On this page
Byte swap on a 1734-232ASC reverses the order of the two bytes inside each 16-bit word the module moves between its RS-232 port and the DeviceNet words your SLC 500 maps into an M-file. It exists because the module packs the first character it receives into the low byte of each word, while the SLC copy into an integer or string file reads each word high byte first, so four characters typed as 1234 arrive in the M-file reading 2143. One deliberate conversion fixes the order, the module's Byte Swap mode or your own byte-swap copy logic, never both, and the sections below show byte by byte why that works and which side to convert in each case.
What byte swap reverses, and what it cannot fix #
The Byte Swap mode in the 1734-232ASC changes exactly one thing: the order of the two bytes within each 16-bit word the module exchanges with the DeviceNet master. The POINT I/O ASCII module user manual (publication 1734-UM009) documents the mode and states that it is set for transmit and receive independently, so the receive path, the transmit path or both can be swapped.
It does not touch the characters on the serial wire. A wrong character, a parity error or a baud mismatch at the port looks the same with the mode on or off, so byte swap is never the fix for a dirty RS-232 link, only for the order of bytes inside words arriving over a clean one. On an SLC 500 with a DeviceNet scanner, the module's data lands in the M-file you mapped in the scanner configuration; the byte order is decided inside the module before the scanner writes those words, which is why the fix belongs at the module or in your copy logic, not in the mapping.
Why the M-file shows the pairs reversed #
An SLC integer element is one 16-bit word, and a string file holds two characters per word with the earlier character in the high byte. The module does the opposite by default: the first byte it receives goes into the low byte of the first word. Read such a word high byte first and every two-character pair comes out reversed, so 12 turns into 21 and 34 into 43.
This is the big-endian against little-endian mismatch, and how big-endian and little-endian byte order work in automation lays out the two layouts side by side. The same word-order trap bites on other platforms too: Fix ABB IRC5 PROFINET word values with a byte swap walks through it for word values into an ABB robot over PROFINET.
One word through the chain, byte by byte #
Type 1234 at a terminal connected to the module's port. Each character leaves as one ASCII byte: 1 is 49 decimal (31h), 2 is 50 (32h), 3 is 51 (33h) and 4 is 52 (34h), so the port delivers the byte stream 31h 32h 33h 34h.
With Byte Swap off, the module places each arriving byte in the low byte of the next word:
| Byte Swap | First word | Second word | Reads high byte first |
|---|---|---|---|
| Off | 3231h | 3433h | 2143 |
| On | 3132h | 3334h | 1234 |
Off, the first byte 31h sits in the low position, the word reads 3231h, and any SLC copy that takes the high byte first produces 2143 in the M-file. On, the module reverses each pair before it publishes the words, word one becomes 3132h and word two 3334h, and the same copy path now yields 1234. The module monitor flips the other way at the same moment and shows 2143, because it lists each word low byte first; that display is the setting working, not the serial link failing.
Confirm the boundary, then verify at full length #
- Send a short known sequence, for example four digits, from a terminal into the module's port.
- Watch the module monitor in your DeviceNet configuration software. Characters missing, shifted or garbled at this point mean the serial link or the sender is at fault; stop here, because no byte setting repairs that.
- Copy the M-file words through your normal path into an integer element (in this example A17:0) and extract the string into a string element (ST18:0). Pairs reversed here while the monitor was correct points at the module-to-M-file boundary.
- Set Byte Swap mode for the receive direction, download the module configuration and repeat the same sequence.
- Judge the result by the extracted string, never by the monitor alone, then rerun with a full-length real message and confirm the copy logic extracts the same range on every scan.
If a value from this link feeds a machine decision or an operator reading, remember that a byte-order fault surfaces as a silently wrong number with no fault bit to flag it, so the full-length test has to pass before the link carries anything that matters.
The decision for each case #
- Monitor correct, M-file pairs reversed: enable Byte Swap mode for the receive direction. This is the standard case for a device that only sends data to the SLC, and it leaves transmit untouched.
- Your copy logic already reverses bytes: leave the module setting off. Two swaps cancel and the string reads reversed again, so keep exactly one conversion in the path.
- The module sends words out the serial port and the receiving device prints the pairs reversed: set Byte Swap for the transmit direction as well; the module keeps the two directions independent.
- Monitor wrong before any swap: repair the serial settings or the sending device first; byte order is not the problem.
- No single conversion produces a stable correct string: restore the configuration you saved, then capture the module configuration, the M-file words and the destination string for review before changing anything else.
Questions asked
Does Byte Swap mode change the data on the RS-232 wire?
No. The port sends and receives the same characters with the mode on or off, so a terminal test at the port shows identical data either way. The mode only reverses the two bytes inside each 16-bit word as the module exchanges it with the DeviceNet master, which is why the characters on the wire can be correct while the M-file words read reversed.
Why does the module monitor read backwards after the swap is enabled?
The monitor lists each word's bytes low byte first, in the order they travel on DeviceNet, not in reading order. Once the swap is on, the low byte holds the second character of each pair, so a word that reads correctly in the SLC displays as 2143 there. Read the result from the string your logic extracts, never from the monitor.
What happens if the module swap and my logic swap are both active?
The two reversals cancel: the words return to the module's default order and the extracted string reads reversed again. Disable one conversion at a time and resend a short known sequence after each change, then keep exactly one in the path, either the module's Byte Swap mode or your copy logic.
How do the words fill out for a longer or odd-length message?
Characters pair up two per word along the whole message: characters one and two share the first word, three and four the second, and so on. With the swap enabled, the first character of each pair sits in the high byte, so a 10-character message fills five words and an odd-length message leaves the last low byte unused. Test with the longest message the device can send.

