Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge HMI

Swap16

  • Last UpdatedAug 07, 2026
  • 1 minute read

Swap16 returns the result of swapping the two lower bytes of a numeric value.

Group

Sync / Async Exec

String Exp?

Windows Support

Windows Embedded Support

IoT View Support

Thin Client Support

Mobile Access Support

Arithmetic

Sync

Yes

Yes

Yes

Yes

Yes

Yes

Syntax

Swap16(numValue)

numValue

The numeric value argument on which the function operation will be performed.

Return value

Returns the numeric value after swapping the bytes.

Examples

As used in a Math worksheet:

Tag Name

Expression

Tag

Swap16( 16 ) // 16 is 0000000000010000 in binary. Returns 4096 (0001000000000000 in binary).

Tag

Swap16( 43760 ) // 43760 is 1010010111110000 in binary. Returns 61610 (1111000010100101 in binary).

In This Topic