検索機能を使用して 500 を上回る Kepware の知識ベース記事の中から閲覧します。結果を絞り込むか、クエリーを下部の検索フィールドに入力します。

解決策が見つからなかった場合には、当社の PTC eSupport Portal で追加資料を確認することもできます。eSupport Portal へのログインを要求された場合、My Kepware の認証情報を使用できます。My Kepware アカウントが必要ですか? こちらで作成

各種検索方法:
View All Solutions

Kepware Knowledge Base: Solution


Siemens S5 Byte Swapping in Strings


Last Update: 2018/11/07

In KEPServerEX V5.15, the Siemens S5 driver was enhanced to support byte swapping for the String data type. Strings can be from 2 to 254 characters (bytes) in length. All strings are assumed to be in a HiLo byte order, meaning that for each register (which is 2 bytes in length) there can be 2 characters. An issue can occur if an odd string length is used or if an odd number of characters is written to the string and the incorrect byte order is used.

For example, assume that there is a tag with the address "DB1:KS0.5H" and with a value of "AFTER" written to it. If users read it from a tag with an address of "DB1:KS0.5L" they would see a value of "FAET". This is because the tag is consuming DB1 Register 0, 1, and 2. The actual value stored in the three registers is 0x414651455200. The last byte of the string is the string terminator, which is a Null (0x00). When the byte order is swapped, the registers are essentially viewed as having a value of 0x464145540052. When updating the tag value, the driver stops at the null value. This will also occur anytime a non-printable character is included in the string. PLC programmers should avoid including control characters (0x01 to 0x1F) or any extended characters (0xA0 to 0xFF) in registers that will be read as part of a string.

Related Products
Siemens S5

Related Protocols
Siemens S5 3964(R)