IS230SNRTH2A燃機通用電氣卡件
建立到另一個PLC的讀取通道使用“建立讀取通道”命令打開與遠程PLC并從該PLC讀取數據。
如下面的示例所示,命令塊指定周期、數量從遠程PLC讀取以執行,以及等待每個轉移到完成。第一次讀取立即執行,而不考慮時間段明確規定。
示例:建立讀取通道命令塊該示例命令塊在IP上建立到遠程PLC的通道(通道5)
地址3.0.0.1。它將COMREQ狀態字返回到%R10。成功后執行命令后,總線控制器將讀取“遠程”PLC寄存器%R50-%R57進入“本地”PLC寄存器%R100-%R107。此通信將以7秒間隔重復10次。每次讀取的超時時間為500ms。命令塊定義
(字7)信道命令號:字7(02003十進制或07D3十六進制)請求可以設置讀取通道。
(字8)通道號:字8指定用于讀取的通道。這個值必須在1到32的范圍內。如果信道超出范圍,則命令錯誤指示為置于COMREQ狀態字中。如果頻道號與頻道號相同已在使用中的通道將重新設置為執行此新命令。
(Word 9)讀取重復次數:Word 9指定要執行的讀取次數然后自動關閉通道。如果該值設置為1,則只有一次讀取發布。如果此值設置為0,則在請求的時間段內發出讀取,直到通道中止。
(字10)讀取期間的時間單位:字10是指定時間單位的數字讀取期間:秒
3秒
4分鐘
5小時
(字11)讀取周期的時間單位數:字11指定時間數
讀取期間的單位
即使通道命令設置為發出單個讀取。
示例讀取周期:如果字10包含值3,則將秒指定為如果時間單位和字11包含值20,則讀取周期為20秒。
通常在每個讀取周期開始時發出讀取。如果掛起的讀取傳輸是讀取期間未完成,信道錯誤位和詳細信道狀態字被設置為指示非致命周期錯誤。如果時間單位數為設置為零,則在上一次傳輸完成后立即發出后續傳輸,否發生錯誤的時間段。在期間錯誤發生后,掛起的傳輸仍然可以完成。
對于設置為發出多次讀取的通道命令,將發出下一次讀取傳輸僅在掛起的讀取傳輸完成之后。
設置為發出單個讀取的通道命令只能有一個掛起讀取轉移
(字12)每次讀取的超時:字12指定時間(以第二)FIP總線控制器在設置
通道錯誤位和詳細的通道狀態字,用于指示非致命超時錯誤即使發生超時,傳輸仍然可以完成。因此應用程序可以選擇如果
Establish a Read Channel to Another PLC
Use the Establish Read Channel Command to open a communications channel to a
remote PLC and to read data from that PLC.
As shown in the example below, the Command Block specifies the period, the number of
reads from the remote PLC to perform, and the timeout allowed in waiting for each
transfer to complete. The first read is performed immediately, regardless of the period
specified.
Example Establish Read Channel Command Block
This example command block establishes a channel (channel 5) to a remote PLC at IP
address 3.0.0.1. It returns the COMREQ Status Word to %R10. Following successful
execution of the command, the Bus Controller will read “remote” PLC registers
%R50-%R57 into “local” PLC registers %R100-%R107. This communication will be
repeated 10 times at 7 second intervals. The timeout period is 500 ms for each read.Command Block Definitions
(Word 7) Channel Command Number: Word 7 (02003 decimal or 07D3 hex) requests that
a read channel be set up.
(Word 8) Channel Number: Word 8 specifies the channel to be used for the read. This value
must be in the range of 1 to 32. If the channel is out of range, a command error indication is
placed in the COMREQ Status word. If the channel number is the same as a channel
already in use, the channel is retasked to perform this new command.
(Word 9) Number of Read Repetitions: Word 9 specifies the number of reads to perform
before automatically closing the channel. If this value is set to 1, only a single read is
issued. If this value is set to 0, reads are issued on the requested period until the channel
is aborted.
(Word 10) Time Units for Read Period: Words 10 is a number that specifies the time units
for the read period:econds
3 seconds
4 minutes
5 hours
(Word 11) Number of Time Units for Read Period: Word 11 specifies the number of time
units for the read period. The read period is in effect even when the channel command
is set up to issue a single read.
Example Read Period: If Word 10 contains a value of 3 specifying seconds as the
time unit and Word 11 contains a value of 20, then the read period is 20 seconds.
A read is normally issued at the start of each read period. If the pending read transfer is
not completed during the read period, the Channel Error bit and Detailed Channel
Status words are set to indicate a non-fatal period error. If the Number of Time Units is
set to zero, a subsequent transfer is issued as soon as the previous transfer completes, no
period errors occur.
A pending transfer can still complete after the period error occurs.
For channel commands set up to issue multiple reads, the next read transfer is issued
only after the pending read transfer completes.
A channel command set up to issue a single read can have only one pending read
transfer.
(Word 12) Timeout for Each Read: Word 12 specifies the time (in hundredths of a
second) the FIP Bus Controller waits for a read transfer to complete before setting the
Channel Error bit and Detailed Channel Status words to indicate a non-fatal timeout
error. The transfer can still complete even after a timeout occurs. As a result, an
application can choose what to do if one