Topic: DMD0225 WX - Do-more Network Write |
|
The Do-more Network Write (WX) instruction uses the Do-more proprietary protocol to write data over the on-board Ethernet port or a BX-P-ECOMEX POM to another Ethernet-equipped Do-more CPU. The WX instruction uses UDP (not TCP) protocol to communicate with the remote Do-more CPU. Do-more WX is the preferred way to write data to a remote Do-more CPU because it has direct access to nearly all of the memory in the remote CPU - including direct access to the PLC's I/O memory. This is in contrast to DirectLOGIC (DLRX / DLWX) and Modbus/TCP (MRX / MWX) network communication which only has access to the protocol-specific memory blocks in the remote CPUs. instruction
Each WX instruction can contain up to 50 individual write requests for a total of up to 1000 bytes of data. The WX instruction can write to all of the built-in memory blocks, all of the built-in structures, and any user-created memory blocks in the remoteCPU. WX does NOT support writing to a Heap Item A Heap item and it's associated memory are not preallocated in a default Memory configuration. They are single items as opposed to one entry of a memory block. A Heap Item can be created in the Memory Configuration or be created when the instruction using it is added to the ladder diagram. in the remote Do-more CPU.
The WX instruction establishes a communication session with the remote Do-more CPU similar to Do-more Designer and C-More panels. The session is established using one of the User Accounts setup in the System Security of the remote CPU. The User Account selected will enforce any restrictions on what can be accessed by this instruction. Even if no password is selected, the session will be established using the Default User account.
This instruction uses either the on-board Ethernet port or BX-P-ECOMEX POM, both of which are shared, system resources controlled by a device driver. The device driver allows the Ethernet port to process concurrent client-side requests ( RX, WX, DLRX, DLWX, MRX, MWX, EIPMSG, EMAIL, etc. ) without the need for additional interlocking logic in the ladder program.
|
|
Element References:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Device : the only Device that can be selected $IntEthDMPPClient.
UDP Addressing
Remote Password : the WX instruction requires that a communication session be established with the remote Do-more CPU before the data write operations can be processed. Depending on how the remote system is configured, this may require the user to enter the password for the User Account on the target CPU to allow the session to be established.
If no remote password is selected, the connection will be established using the Default User account. If that account exists on the remote system AND that account has Write Data privilege the connection will be made and the write data operations will be processed. If the Default User does not exist a connection cannot be established and thus the WX operation will fail. If the Default User account has been changed to NOT have Write Data privilege the write data operations cannot be processed.
If a remote password is selected, the connection will be made using the password specified below. If that account exists on the remote system AND that account has Write Data privilege the connection will be made and the write data operations will be processed. If a connection cannot be made using the specified the password the connection cannot be established and the WX operation will fail. If the account specified by the password does NOT have Write Data privilege the write data operations cannot be processed.
The password for the User Account can be supplied in either of the following ways:
Enable specifies how this instruction is enabled. Select from one of the following:
The On Success and On Error parameters specify what action to perform when this instruction completes. You do not have to use the same type of selection for both On Success and On Error.
If the Set Bit selection is used for either On Success or On Error, the specified BIT location will be SET OFF when the instruction is first enabled and will remain OFF until the instruction completes. Once complete, the appropriate Success or Error bit location ON. The specified Bit location is enabled with a SET (Latch) operation meaning that it will remain ON even if the input logic for the instruction goes OFF.
If the JMP to Stage selection is used for either On Success or On Error the target Stage must be in the same Program code-block as this instruction, you cannot specify a target Stage that exists in a different Program code-block. When the operation finishes, the target Stage will be enabled the same way as a standalone Jump to Stage (JMP) instruction would do it. The JMP to Stage option will only be available if this instruction is placed in a Program code-block.
On Success selects which of the following actions to perform if the operation is successful:
On Error selects which of
the following actions to perform if the operation is unsuccessful:
If either the On Success or On Error selections are set to JMP to Stage, Automatically create the SG box for any NEW stage number will be enabled which will automatically create any target stage that does not already exist.
Enable the On Error Counter option and specify a DWord location to store the total number of times the WX failed to complete. This can be any writable DWord location.
Enable the Extended Error Information option then enter a memory location to store any error codes returned for this instruction. This can be any writable numeric location. The following lists the Extended error responses and their meaning:
-1 = Protocol Error occurred. The value in LastProtoError (DST38) contains the protocol error code as follows:
0 = No Extended Error
1 - 50 = row number of the bad write request if the Last Protocol Error Code was 20 (0x14).
|
|
A single Do-more Network Write instruction can process up to 50 individual data requests. The total amount of data that the 50 data requests can write is 1000 bytes. Each of the individual write operations can write one data type into a memory location that is the same type and size.
The type of data that's being written determines how many elements of each type can be written in each data request as shown below:
The buttons are for functions which manage the rows in the instruction: Edit opens the editor for the currently selected row, Insert adds an empty row before the currently selected row and opens the editor for this new row, Remove deletes the currently selected row from the table, and Move UP / Move Down shifts the currently selected row up one or down one row respectively in the table.
When using the Insert or Edit operations the row editor dialog will open. The Row Editor will allow you to construct write requests that will fit within the rules for the data types stated earlier.
Be aware that because the local CPU does not have access to the memory configuration of the remote system, there is no guarantee that a write request that is correctly formed on the local CPU will work when the remote system tries to execute it. For example, you could write data from a memory location that is valid locally (D4000 - D4095) but the range of D memory locations may have been adjusted in the remote CPU to stop at D3000.
Write From Local into Remote selects the first location of the source data in the Local CPU to write to the remote CPU.
Number of Elements is the number of consecutive elements in the memory block to write.
Write into Remote Memory Block selects the beginning location in the remote CPU to store the data from the write operation. This location must be the same data type and have the same element size as the specified Write From Local data location. For example you can write from WY (Signed Word) into N (Signed Word) but you cannot write from WY (Signed Word) into V (Unsigned Word)
The remaining fields are to help you maintain the size limitations of the instruction. These fields validate immediately as you make changes in the editor. Current is the number of bytes in the write request currently being edited, Others is the number of bytes in the write requests already in this instruction, New Size is the total number of bytes of all the write requests in this instruction (including the one currently being edited), and Bytes Remaining is the number of bytes of the 1000 byte limit remaining for write requests in this instruction.
OK closes the editor, saving any changes.
Cancel closes the editor, discarding any changes.
|
|
Status Display:
The red triangle in the upper left corner of the status display indicates this is a Fully Asynchronous instruction.
|
|
See Also:
WX - Do-more Network Write
Modbus Exception
Response Codes
DLRX - DirectLOGIC Network Read
DLWX - DirectLOGIC Network Write
|
|
Related Topics:PUBLISH - Translate from Do-more
SUBSCRIB - Translate to Do-more
|
|
Example:
|
|