Topic: DMD0297

DLWX - DirectLOGIC Network Write


The DirectLOGIC Network Write (DLWX) instruction uses the onboard Ethernet port or an ECOM module to write data to a remote DirectLOGIC PLC through an ECOM module in the remote system.

 

The DirectLOGIC Network Write instruction will use TCP/IP broadcasts to perform the network write operation, this means that both the Do-more controller and the remote ECOM module must be in the same broadcast domain.

 

 

Element References:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Network Device - designates which of the configured Devices to use. Before this instruction can select a Device, that Device must be configured to accept data from an external source. Part of the configuration for a device is assigning a name to the device. It is that name which will show up in the Device selection drop-down menu. For more information on configuring devices go to the Device Configuration Section under System Configuration.
 

  • Ethernet Devices - selects one of the Devices configured to use.
     

  • create module - indicates that there are no Modules that have been configured to perform this instruction, selecting this option will invoke the Module Configuration selection of the System Configuration where a suitable Module can be created.

 


Remote Address - specifies which of the following addressing modes to use:

 

  • Slave ID - selects the Slave ID (Module ID) of the remote slave. This can be any constant value in the range of 1 to 90.
     

  • IP Address - selects the IP Address of the remote slave ECOM. This can be any valid TCP/IP Address on the same local network as the Do-more controller or ECOM module. Note: Invoking the Element Browser (F9) for this field will bring up the IP Address Lookup utility that can find the IP Address for a given name.

 


From - designates the beginning address of the data to send to the remote slave. This value must be compatible with the type specified in the To DL selection:

 

If V-memory is selected the From value must be from a WORD or DWORD range. This value can be any writable numeric location.

 

If one of the BIT types is selected the From value must be from a BIT range. This value can be any writable numeric location.
 

Note: in most cases, the built-in DirectLOGIC memory blocks DLX / DLY / DLC / DLV should NOT be used as the source location for data sent by the DLX instruction because these memory locations are reserved for use by the Do-more's DirectLOGIC Server (Slave) function. Refer to the DirectLOGIC Memory Blocks diagram in the Memory Configuration section of the System Configuration for more information.

 

Number of Bytes - designates the number of elements of the selected type to write.

 

  • V - each V-memory location is 2 bytes in length, so writing V-memory requires the length be in 2-BYTE increments
     

  • X, Y, C, S, T, CT, GX, GY, SP - BIT locations must be written in 1-BYTE increments

 

To DL - designates the data type and the address to write to in the DL controller.

 

Type

Range (octal)

Notes

V

0 to 41237

V-memory locations in a DirectLOGIC controller are unsigned 16-bit values.

X

0 to 1770

The memory address value must begin on a BYTE boundary, for example X0, X10, X20, X1000, X1770, etc..

 

Single BIT locations in the DirectLOGIC controllers cannot be written individually, you must write the BYTE that contains the desired BIT.

For example, the BYTE beginning at X0 contains the BITs X0 through X7, the BYTE beginning at X10 contains the BITs X10 through X17. To write to X12, set the 3rd BIT in that BYTE to the desired value (0 or 1) then write the entire BYTE to X10.

Y

0 to 1770

C

0 to 3770

S

0 to 1770

T

0 to 370

CT

0 to 370

GX

0 to 3770

GY

0 to 3770

SP

0 to 770

 


Enable - designates how this instruction will operate. Select from one of the following:
 

  • Once on Leading Edge - select this option to have this instruction run to completion exactly one time. Typically, this will take more than one controller scan. Configured this way the DirectLOGIC Network Write (DLWX) instruction is edge triggered.
     

  • Continuous on Power Flow at Interval - select this option to have this instruction run as long as the instruction has power flow. After the DirectLOGIC Network Write (DLWX) has initially run, if the instruction still has power flow, the instruction will remain enabled and will wait the specified amount of time before running again. The following options select how much time (in milliseconds) to wait between successive runs. A value of 0ms means the DirectLOGIC Network Write (DLWX) will re-run immediately.

 

    • Constant - specifies the interval time in Hours / Minutes / Seconds / Milliseconds.
       

    • Variable - This can be any writable numeric location that contains a value between 0 and 2,147,483,647.

 


On Success - designates one of the following two options if the DirectLOGIC Network Write operation is successful:

 

  • SET BIT - The specific BIT location will be SET OFF when the DirectLOGIC Network Write (DLWX) instruction is first enabled, and then SET ON if the operation is successful. This value can be any writable bit location.
     

  • JMP to Stage  - JMP to the specified Stage. The target Stage must be in the same Program as the DirectLOGIC Network Write (DLWX) instruction, you cannot specify a Stage in a different Program. This selection will function like a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 

On Error - designates one of the following two options if the DirectLOGIC Network Write operation is unsuccessful:

 

  • SET BIT - The specific BIT location will be SET OFF when the DirectLOGIC Network Write (DLWX) instruction is first enabled, and then SET ON if the operation is unsuccessful. This value can be any writable bit location.
     

  • JMP to Stage  - JMP to the specified Stage. The target Stage must be in the same Program as the DirectLOGIC Network Write (DLWX) instruction, you cannot specify a Stage in a different Program. This selection will function the same as a standalone Jump to Stage instruction. Click here for more information on the Jump To Stage instruction.

 


Status Display:

The red triangle in the upper left corner of the status display indicates this is a Fully Asynchronous instruction.

 


See Also:

 


Example 1 of 2:

Description of a Typical DirectLOGIC Network Write (DLWX) Stage Diagram:

To the right is a stage diagram showing a typical sequence that monitors a DL-PLC slave (via an ECOM100) slave and reads up a new recipe whenever it becomes available.

 

Initially the NewRec (New Recipe) stage monitors a bit from the slave. When this bit comes ON, RecipeRdy (Recipe Ready) causes the transition to the RDRec stage.

 

The RDRec (Read Recipe) reads the new recipe from the slave. When this completes, RecipeRD (Recipe Read) causes the transition to the RSTRec stage.

 

The RSTRec (Reset Recipe) writes a bit to the slave to inform it the recipe has been read successfully. When this write is complete, RecipeRST (Recipe Reset) causes a transition to the RSTMon stage.

 

The RSTMon (Reset Monitor) stage monitors a bit from the slave to confirm the slave heard the reset. When this bit comes ON, MonRST (Monitor Reset) causes a transition back to the NewRec stage to repeat the process and wait for the next new recipe.

 

Description of a Typical DirectLOGIC Network Write (DLWX) Stage Ladder:

To the right is a ladder program that is equivalent to the above stage diagram. It utilizes both the DirectLOGIC Network Read (DLRX) and DirectLOGIC Network Write (DLWX) instructions to monitor a DL-PLC slave (via the built-in Do-more Ethernet port to the DL-PLC's ECOM100) and read up a new recipe whenever it becomes available.

 

A summary of the master/slave interaction is as follows:

  1. The Do-more monitors C10 bit from DL-PLC.

  2. The DL-PLC formulates a new recipe and stores it in V2000-2017 memory range.

  3. The DL-PLC sets C10 ON when the recipe is ready and begins to monitor for C10 to go back OFF in order to know when the Do-more has read the new recipe up.

  4. The Do-more sees C10 turn ON and reads up the new recipe from V2000-2017 memory range and stores it in his memory range RecipeVar01-RecipeVar16.

  5. The Do-more then turns the DL-PLC's C10 bit OFF to inform the DL-PLC he has read up the new recipe. Then the Do-more begins to monitor for C11 bit to come ON in order to know the DL-PLC heard him.

  6. The DL-PLC sees his C10 bit turn OFF and then turns ON his C11 bit to inform the Do-more he is now formulating the next recipe.

  7. The Do-more sees C11 come ON and can now repeat the cycle (return to step 1 above).

 

NewRecipe is the initial stage. The DLRX instruction is set to execute "Continuous at Interval 0.100s" to read a bank of C-bits (C10-27) from the DL-PLC. This word contains the bit the DL-PLC will turn ON when a new recipe has been stored and is ready for the Do-more PLC to read it up. C10 will be stored in Monitor's first bit (Monitor:0), C11 in Monitor's second bit (Monitor:1), etc, until 16 bit are stored. The DLRX reads this bank of bits and stores it in the Monitor word. Upon the successful completion of each read the ReadSuccess1 bit will come ON. When there has been a successful read and the Monitor:0 bit is ON, Rung 3 resets the Monitor:0 bit back OFF (in preparation for the next cycle) and transitions to the ReadRecipe stage. If any one of these reads fails, the DLRX instruction will transition to the ErrorStage where the error can be handled.

 

The ReadRecipe stage executes the DLRX instruction once to read up the new recipe from DL-PLC's V2000-2017 memory range and stores them in Do-more memory range RecipeVar01-RecipeVar16. Upon a successful read, the DLRX transitions to the ResetRecipe stage. If the read failed, the DLRX instruction will transition to the ErrorStage.

 

The ResetRecipe stage executes the DLWX instruction once to write the Monitor word (16 bits) down to the bank of C-bits (C10-27) to inform the DL-PLC the new recipe has been read up successfully (i.e. C10 will be written OFF). Upon a successful read, the DLWX transitions to the ResetMonitor stage. If the write failed, the DLWX instruction will transition to the ErrorStage.

 

The ResetMonitor stage monitors a feedback bit (C11) from the DL-PLC that the DL-PLC should use to inform the Do-more PLC that it "heard" the recipe read was successful and that the DL-PLC can now make preparations for the next recipe. The DLRX reads this bit (C11) by reading the same bank of bits (C10-27) and storing them in Monitor word. Upon the successful completion of each read the ReadSuccess2 bit will come ON. When there has been a successful read and the Monitor:1 bit (i.e. C11) is ON, Rung 10 resets the ReadSuccess2 bit back OFF (in preparation for the next cycle) and transitions back to the initial NextRecipe stage. If any one of these reads fails, the DLRX instruction will transition to the ErrorStage.

 

The ErrorStage should have code in it (not shown here) that evaluates the various errors that can occur in this example.


Example 2 of 2:


Copyright © Host Engineering, Inc. ALL RIGHTS RESERVED