產(chǎn)品展示
聯(lián)系我們
聯(lián)系人:麥女士
手機:+86 15270269218
電話:
Q Q:3136378118
郵箱:stodcdcs@gmail.com
地址:江西省九江市瑞昌市東益路23號賽湖農(nóng)商城401號
3003
在許多應用中,需要向從設(shè)備讀取或?qū)懭敫↑c數(shù)據(jù)。示例程序僅為ReadData和Write Data數(shù)組提供一個INT數(shù)組(16位有符號整數(shù)值)。為了向從設(shè)備讀/寫浮點數(shù)據(jù),必須添加額外的梯形圖,以處理數(shù)據(jù)到ControlLogix處理器內(nèi)真實數(shù)據(jù)類型的轉(zhuǎn)換。這很容易做到。以下主題介紹如何向從屬設(shè)備讀取或?qū)懭霐?shù)據(jù)。這些主題還顯示了何時在模塊配置中使用浮點標志和浮點啟動參數(shù)。對于所有應用程序,可以從設(shè)備讀取浮點數(shù)據(jù),而無需更改浮點標志和浮點啟動參數(shù)。您只需配置這些參數(shù),即可向使用單個Modbus地址(如47001)來表示單個浮點值的設(shè)備發(fā)出寫入命令。這是從設(shè)備的尋址,參數(shù)“能耗”顯示為兩個寄存器40257和40258。值描述類型40257------KWH能耗浮點,低16位40258 KWH能耗浮點,高16位要對此參數(shù)發(fā)出讀取命令,請使用以下配置。參數(shù)值說明啟用1每次通過命令列表發(fā)送命令。IntAddress 1000將數(shù)據(jù)放置在模塊內(nèi)存的地址1000處。根據(jù)ModDef中的配置,這將把數(shù)據(jù)放在標記MCM上。數(shù)據(jù)。READDATA[0]。輪詢0此命令沒有延遲。計數(shù)2從從設(shè)備讀取2個連續(xù)寄存器。這2個Modbus寄存器將構(gòu)成“能耗”浮點值。交換0交換代碼描述0無-字節(jié)順序(1234=1234)1個字-交換字(1234=3412)2個字和字節(jié)-交換字,然后交換每個字中的字節(jié)(1234=4321)3個字節(jié)-交換每個字中的字節(jié)(1234=2143)節(jié)點1將命令發(fā)送到節(jié)點#1。Func 3發(fā)出Modbus功能代碼3“讀取保持寄存器”DevAddress 256與功能代碼3一起,DevAddress 256將讀取從設(shè)備的Modbus地址40257。除功能代碼3外,DevAddress 256還將讀取從設(shè)備的Modbus地址40257。上述命令將讀取Modbus從站#1的40257和40258,并將該數(shù)據(jù)放入MCM中。數(shù)據(jù)。READDATA[0]和[1]。在ControlLogix處理器的controller tags(控制器標簽)部分中,有必要配置數(shù)據(jù)類型為“REAL”的標簽,如下圖所示。[+]能耗實際[1]浮動



In many applications, it is necessary to read or write floating-point data to the Slave device. The sample program only provides an INT array for the ReadData and Write Data array (16-bit signed integer value). In order to read/write floatingpoint data to and from the Slave device, you must add additional ladder to handle the conversion of the data to a REAL data type within the ControlLogix processor. This is very easy to accomplish. The following topics show how to read or write data to a Slave device. These topics also show when to use the Float Flag and Float Start parameters within the module configuration. For all applications, floating-point data can be read from a device without any changes to the Float Flag and Float Start parameters. You only need to configure these parameters to issue a Write command to a device that uses a single Modbus address, such as 47001, to represent a single floating-point value.Here is the addressing of a Slave device, with a parameter "Energy Consumption" that is shown as two registers 40257 and 40258. Value Description Type 40257 -------- KWH Energy Consumption Float, lower 16 bits 40258 KWH Energy Consumption Float, upper 16 bits To issue a Read command to this parameter, use the following configuration. Parameter Value Description Enable 1 Sends the command every time through the command list. IntAddress 1000 Places data at address 1000 of the module memory. Based on the configuration in ModDef this will put the data at the tag MCM.DATA.READDATA[0]. PollInt 0 No delay for this command. Count 2 Reads 2 consecutive registers from the Slave device. These 2 Modbus registers will make up the "Energy Consumption" floatingpoint value. Swap 0 Swap Code Description 0 None - No Change is made in the byte ordering (1234 = 1234) 1 Words - The words are swapped (1234=3412) 2 Words & Bytes - The words are swapped then the bytes in each word are swapped (1234=4321) 3 Bytes - The bytes in each word are swapped (1234=2143) Node 1 Sends the command to Node #1. Func 3 Issues a Modbus Function Code 3 to "Read Holding registers." DevAddress 256 Along with the Function Code 3, DevAddress 256 will read Modbus address 40257 of the Slave device. Along with the Function Code 3, DevAddress 256 will read Modbus address 40257 of the Slave device. The above command will read 40257 and 40258 of the Modbus Slave #1 and place that data in MCM.DATA.READDATA[0] and [1]. Within the controller tags section of the ControlLogix processor, it is necessary to configure a tag with the data type of "REAL" as shown in the following illustration. [+] Energy_Consumption REAL[1] Float
相關(guān)產(chǎn)品