3364940CSP2燃機(jī)電氣模塊
梯級(jí)#3:MOVEWORD函數(shù)將零移動(dòng)到命令塊中引用的COMREQ狀態(tài)字(參見(jiàn)梯級(jí)4)。這將清除狀態(tài)字。這個(gè)橫檔也是重置梯級(jí)#6中COMREQ功能塊的FT輸出線圈
狀態(tài)字將被清除,COMREQ故障輸出線圈將被清除啟動(dòng)COMREQ功能。
梯級(jí)#4-5:BLKMVINT函數(shù)設(shè)置COMREQ命令塊內(nèi)容。
激活這些梯級(jí)時(shí),常量操作數(shù)將從指令中指示的地址開(kāi)始移動(dòng)到內(nèi)存中。
第6級(jí):COMREQ功能塊有三個(gè)輸入和兩個(gè)輸出參數(shù)。
輸入字段指向命令塊參數(shù)的起始位置在本例中為%R00301)。
SYSID字段定義接收命令數(shù)據(jù)的目標(biāo)機(jī)架和插槽。這個(gè)SYSID的前兩位數(shù)字(本例中為00)表示機(jī)架號(hào),后兩位數(shù)字(本例中為04)表示插槽編號(hào)。
任務(wù)字段指示用于指定機(jī)架和插槽的郵箱任務(wù)ID。
信道命令可以為0,網(wǎng)絡(luò)診斷可以為2,或13(0Dh)通用消息。
如果存在以下情況,則FT輸出(本例中為CMRQFLT)打開(kāi)(設(shè)置為1):阻止將命令塊傳遞到FIP總線控制器的問(wèn)題。在這種情況下,其他狀態(tài)指示器不會(huì)更新該COMREQ。
本例中不使用OK輸出,因此示例代碼同樣適用連接到90-70系列或90-30系列PLC。90-70系列PLC可維護(hù)多達(dá)32個(gè)單獨(dú)的TCP/IP通信信道通過(guò)它可以與網(wǎng)絡(luò)上的其他PLC或控制器交換數(shù)據(jù)。
本章說(shuō)明如何使用COMREQ指令:
允許90-70系列PLC從指定范圍內(nèi)讀取多達(dá)2048字節(jié)的數(shù)據(jù)網(wǎng)絡(luò)上另一個(gè)PLC中的內(nèi)存。
允許90-70系列PLC將多達(dá)2048字節(jié)的數(shù)據(jù)寫(xiě)入指定范圍網(wǎng)絡(luò)上另一個(gè)PLC中的內(nèi)存。
允許90-70系列PLC向主機(jī)應(yīng)用程序?qū)懭攵噙_(dá)2048字節(jié)的數(shù)據(jù)網(wǎng)絡(luò)。
使用信道狀態(tài)位和詳細(xì)信息監(jiān)控通信信道頻道狀態(tài)字。
有關(guān)編程通信的更多一般說(shuō)明,請(qǐng)參閱第6章請(qǐng)求FIP總線控制器并監(jiān)控COMREQ狀態(tài)。通信信道利用周期性數(shù)據(jù)傳輸?shù)母拍?。本地PLC使用單個(gè)COMREQ建立與另一設(shè)備(PLC或控制器),并請(qǐng)求在它們之間周期性地傳送特定數(shù)據(jù)。COMREQ的命令塊指定傳輸?shù)念l率和方向以及要在傳輸中使用的存儲(chǔ)器位置。
通道建立后,總線控制器自動(dòng)管理建立通信和定期數(shù)據(jù)傳輸。
COMREQ指定通道是否在特定數(shù)量的轉(zhuǎn)讓?zhuān)òㄒ淮危┗驘o(wú)限期轉(zhuǎn)讓。如果為特定號(hào)碼設(shè)置了頻道:
傳輸時(shí),總線控制器將自動(dòng)關(guān)閉通道轉(zhuǎn)移已經(jīng)發(fā)生。如果通道被設(shè)置為無(wú)限期保持打開(kāi),則以后可以關(guān)閉或重新分配任務(wù)。
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.