Topic: DMD0074

SUBSCRIB - Translate to Do-more


The Translate to Do-more instruction (SUBSCRIB) copies and converts data that is not directly usable by the controller to a data format that is usable. Typically this is data that originated on an external source. For example: converting BCD data that came from a DirectLOGIC controller, or byte-swapping data that came from a Modbus source.

 

 

Each Translate to Do-more instruction can have from 1 to 255 rows of data blocks to convert. For each of the rows, this instruction will copy each of the Elements from the Source block to the Destination block, converting each of them from the specified format to the native data format of the Destination block.

 

There is no sequencing or stepping regarding the rows in this instruction, every row in the instruction is processed every time the instruction is executed.

Row Editor Keys:

The following functions are used to add or remove rows, edit existing rows or reorganize the rows in the instruction.

 

  • Ok - closes the editor, saving any changes

  • Cancel - closes the editor, discarding any changes
     

  • Edit - brings up the editor for the currently selected row

  • Insert - inserts a new row in the instruction before the currently selected row

 

  • Remove - removes the currently selected row

 

  • Move Up - moves the currently selected row up one row

  • Move Down - moves the currently selected row down one row

 


Parameters:

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.

 

Each row of the table contains a conversion step. Adding a new step or editing an existing step will open the following dialog:

 

 

Source - designates the beginning address of the block of data to be copied and converted. This can be any readable numeric location.

 

As - designates the data format of the elements in the specified Source block
 

 

Format

Size

Signed

Unsigned

BCD

Real

Byte

Ok

Ok

Ok

n/a

Word

Ok

Ok

Ok

n/a

DWord

Ok

n/a

Ok

Ok

 


Destination - designates both the type of data conversion to do and the beginning address of the block to store the converted data. For example, if the Destination is R100, the target format is Real and the beginning address is 100. The Destination can be any writable numeric location.

 


#Elements - designates the number of Source locations to convert. This can be any constant value between 1 and 255.

 


Swap Byte - checking this option will cause the Bytes of each Source Word or DWord to be swapped before the data conversion operation is applied.



Swap Word - checking this option will cause the Words of each Source DWord to be swapped before the data conversion operation is applied.

 

Note: As of Do-more Designer version 1.1, the Reverse Bytes option in the SUBSCRIB instruction was split in two options: Swap Byte and Swap Word. This change allows any combination of Swap Bytes in Word-size elements and/or Swap Words in DWord-size elements. However, if the Do-more CPU is running a firmware version older that v1.1 there is a caveat: if the instruction is setup to operate on a DWord-size element, and ONLY Swap Byte or Swap Word is selected, this cannot be downloaded to the Do-more CPU with the older firmware. Selecting Swap Word AND Swap Byte can be downloaded to the Do-more CPU with older firmware. This issue is best remedied by upgrading the CPU firmware to v1.1 or later.

 

Note: checking both Swap Byte and Swap Word will reverse the bytes in a DWord.

 


Status Display:

 

The status display of the SUBSCRIB instruction is a textual description of the data conversion.

 


See Also:

 


Rung Example: