# Siemens driver byteswap

**URL:** <https://forum.inductiveautomation.com/t/siemens-driver-byteswap/38553>\
**Category:** Ignition\
**Created:** [September 10, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/siemens-driver-byteswap/38553 "2020-09-10T14:21:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon.goovaerts](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@simon.goovaerts](https://forum.inductiveautomation.com/u/simon.goovaerts)\
**Post date:** [September 10, 2020, 2:21pm UTC](https://forum.inductiveautomation.com/t/siemens-driver-byteswap/38553/1 "2020-09-10T14:21:56Z")

</div>

Hi all,

I did some tests with the Ignition siemens driver for s7-1500 PLC’s to check how communication works exactly between Ignition and Siemens PLC. My main goal was trying to toggle a bit in a word, a self written script fired on a button in vision client.  
I figured out that, for some reason, the siemens driver did a byteswap. So this means if I want to toggle the first bit in word in PLC, in Ignition I have to toggle the 8th bit.

word in PLC : [0…7] [8…15]  
byteswap in Ignition : [8…15] [0…7]

The scripting is more or less as following

```auto
def InvertBitInWord(word, bit):
tagpath = system.tag.read(word)
if tagpath.quality.isGood():		
	value = tp.value ^ (1<<bit) #where bit is '8' (the 8th bit) 		
	system.tag.write(word,value)

```

Has anyone else experienced this?  
Is there a way to define in the driver settings to disable/enable the byteswap? I know from other SCADA packages you can set this up.

Btw, the reason I tested with the Siemens driver, is because via OPC UA connection Siemens has limited the number of tags send over OPC to max 10000 tags.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [September 24, 2020, 8:33pm UTC](https://forum.inductiveautomation.com/t/siemens-driver-byteswap/38553/2 "2020-09-24T20:33:07Z")

</div>

Sorry this post got missed.

Unfortunately the driver does not have an option to set the byte order or word order.
