3364940CSP2燃機電氣模塊
梯級#3:MOVEWORD函數將零移動到命令塊中引用的COMREQ狀態字(參見梯級4)。這將清除狀態字。這個橫檔也是重置梯級#6中COMREQ功能塊的FT輸出線圈
狀態字將被清除,COMREQ故障輸出線圈將被清除啟動COMREQ功能。
梯級#4-5:BLKMVINT函數設置COMREQ命令塊內容。
激活這些梯級時,常量操作數將從指令中指示的地址開始移動到內存中。
第6級:COMREQ功能塊有三個輸入和兩個輸出參數。
輸入字段指向命令塊參數的起始位置在本例中為%R00301)。
SYSID字段定義接收命令數據的目標機架和插槽。這個SYSID的前兩位數字(本例中為00)表示機架號,后兩位數字(本例中為04)表示插槽編號。
任務字段指示用于指定機架和插槽的郵箱任務ID。
信道命令可以為0,網絡診斷可以為2,或13(0Dh)通用消息。
如果存在以下情況,則FT輸出(本例中為CMRQFLT)打開(設置為1):阻止將命令塊傳遞到FIP總線控制器的問題。在這種情況下,其他狀態指示器不會更新該COMREQ。
本例中不使用OK輸出,因此示例代碼同樣適用連接到90-70系列或90-30系列PLC。90-70系列PLC可維護多達32個單獨的TCP/IP通信信道通過它可以與網絡上的其他PLC或控制器交換數據。
本章說明如何使用COMREQ指令:
允許90-70系列PLC從指定范圍內讀取多達2048字節的數據網絡上另一個PLC中的內存。
允許90-70系列PLC將多達2048字節的數據寫入指定范圍網絡上另一個PLC中的內存。
允許90-70系列PLC向主機應用程序寫入多達2048字節的數據網絡。
使用信道狀態位和詳細信息監控通信信道頻道狀態字。
有關編程通信的更多一般說明,請參閱第6章請求FIP總線控制器并監控COMREQ狀態。通信信道利用周期性數據傳輸的概念。本地PLC使用單個COMREQ建立與另一設備(PLC或控制器),并請求在它們之間周期性地傳送特定數據。COMREQ的命令塊指定傳輸的頻率和方向以及要在傳輸中使用的存儲器位置。
通道建立后,總線控制器自動管理建立通信和定期數據傳輸。
COMREQ指定通道是否在特定數量的轉讓(包括一次)或無限期轉讓。如果為特定號碼設置了頻道:
傳輸時,總線控制器將自動關閉通道轉移已經發生。如果通道被設置為無限期保持打開,則以后可以關閉或重新分配任務。
Rung # 3: The MOVEWORD function moves a zero to the COMREQ Status Word referenced in the Command Block (see rung #4). This clears the status word. This rung also
resets the FT output coil of the COMREQ Function Block in rung #6. It is vital that the
status word be cleared and the COMREQ fault output coil be cleared each time before
initiating a COMREQ function.
Rungs # 4-5: The BLKMVINT functions set up the COMREQ Command Block contents.
When these rungs are activated, the constant operands are moved into memory beginning at the address indicated in the instruction.
Rung # 6: The COMREQ Function Block has three input and two output parameters.
The IN field points to the starting location of the Command Block parameters
(%R00301 in this example).
The SYSID field defines the target rack and slot to receive the command data. The
first two digits of SYSID (00 in this example) indicate the rack number, the last two
digits (04 in this example) indicate the slot number.
The TASK field indicates which mailbox task ID to use for the specified rack and slot.
It can be 0 for Channel commands, 2 for Network Diagnostics, or 13 (0Dh) for
Generic Messages.
The FT output (CMRQFLT in this example) is turned on (set to 1) if there were
problems preventing the delivery of the Command Block to the FIP Bus Controller.
In this case, the other status indicators are not updated for this COMREQ.
The OK output is not used in this example so that the sample code can equally apply
to a Series 90-70 or a Series 90-30 PLC.The Series 90-70 PLC can maintain up to 32 individual TCP/IP communications channels
through which it can exchange data with other PLCs or controllers on the network.
This chapter explains how to use COMREQ instructions to:
Allow the Series 90-70 PLC to read up to 2048 bytes of data from a specified range of
memory in another PLC on the network.
Allow the Series 90-70 PLC to write up to 2048 bytes of data into a specified range of
memory in another PLC on the network.
Allow the Series 90-70 PLC to write up to 2048 bytes of data to a host application on
the network.
Monitor communications channels using the Channel Status bits and the Detailed
Channel Status words.
See Chapter 6 for more general instructions about programming Communications
Requests to the FIP Bus Controller and monitoring COMREQ status.Communications channels utilize the concept of periodic data transfers. The local PLC
uses a single COMREQ to establish a channel (connection) to another device (PLC or
controller) and to request that specific data be periodically transferred between them.
The COMREQ’s Command Block specifies the frequency and direction of the transfer
and the memory locations to be used in the transfer.
After a channel is established, the Bus Controller automatically manages the
establishment of communications and the periodic data transfer.
The COMREQ specifies whether the channel will remain open for a specific number of
transfers (including just one), or indefinitely. If a channel is set up for a specific number
of transfer, the Bus Controller will close the channel automatically when that number of
transfers has taken place. If a channel is set up to remain open indefinitely, it can later be
closed or re-tasked.