Nhãn hiệu của chúng tôi

Impact-Company-Logo-English Black-01-177x54

Chào mừng bạn đến với Trang web của Schneider Electric

Chào mừng đến với trang web của chúng tôi.
		
Hôm nay chúng tôi có thể giúp gì cho bạn?
Performing a Byte Swap within a Register using TelePACE Studio

When communicating between devices from different manufacturers, there could be different conventions for how data is stored in each device. This might result in a situation where one device stores a floating point value with a byte order AB CD but if the second device stores the value with a byte order BA CD, it will result in seemingly garbage data.

For example, start with a device that has a floating point 12345.6 stored in a byte order AB CD. If another device is used to handling floating points as BA DC, then the same 4 bytes (32-bits) would now give a floating point value of -4.07227e-23

In a situation like this, a word swap would be needed so that the data is placed in the correct order to be understood in the SCADAPack.

This sample program takes a floating point value from Registers 42000-42001  in the form AB CD, swaps the Byte order to BA CD and stores the result in registers 42002-42003
Registers 41000-41006 are temporarily used as the contents of 42000 are rotated one bit at a time, before ending in 42002
Similarly, registers 41010-41016 are temporarily used as the contents of 42001 are rotated one bit at a time, before ending in 42003

Screen shot showing how the byte order has been swapped using the logic routine

As seen in the screenshot, registers 42000-42001 have now had their byte order swapped in 42002-42003, going from a value of 449A 51EC to 9A44 EC51

Schneider Electric Việt Nam

Tìm hiểu thêm
Phạm vi:
Tìm hiểu thêm
Phạm vi:

Bạn cần trợ giúp?

  • Công cụ chọn sản phẩm

    Nhanh chóng và dễ dàng tìm được sản phẩm và phụ kiện phù hợp cho các ứng dụng của bạn.

  • Nhận báo giá

    Bắt đầu gửi yêu cầu bán hàng trực tuyến và chuyên gia sẽ liên hệ với bạn.

  • Nơi mua hàng?

    Dễ dàng tìm nhà phân phối Schneider Electric gần bạn nhất.

  • Trung tâm Hỗ trợ

    Tìm sự hỗ trợ cho mọi nhu cầu của bạn tại một nơi.

  • Tài liệu về Sản phẩm
  • Tải xuống phần mềm
  • Công cụ chọn Sản phẩm
  • Thay thế và thay đổi sản phẩm
  • Trung tâm Hỗ trợ
  • Tìm Văn phòng của chúng tôi
  • Nhận báo giá
  • Tìm Nhà Phân phối
  • Cơ hội nghề nghiệp
  • Hồ sơ doanh nghiệp
  • Báo cáo hành vi sai trái
  • Khả năng truy cập
  • Phòng tin tức
  • Nhà đầu tư
  • EcoStruxure
  • Tìm việc
  • Blog
  • Chính sách bảo mật
  • Thông báo về Cookie
  • Điều khoản sử dụng
  • Change your cookie settings