Topic: DMD0306

STRGETB - Get Bytes out of a String


The Get Bytes Out of a String (STRPUTB) instruction will copy bytes of data from the specified String and place them in memory locations in the controller.

 

This instruction is NOT intended to operate on Strings containing ASCII text. The primary use of this instruction - and its companion instruction Put Bytes Into a String (STRPUTB) - is in creating protocol drivers, where the data in the String is not ASCII text but 16-bit, or 32-bit, or floating point numbers.

 

If the data in the String is in fact an ASCII text representation of integer or floating point numbers, the correct instruction to use for handling that data is the Convert String to Integer (STR2INT) or Convert String to Real (STR2REAL) respectively.

 

Element References:

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

 

Get out of String - designates the String to receive the bytes of data. This can be any of the system-defined Short Strings, system-defined Long Strings, or any user-defined Strings.

 

Start at Index - designates the first location in the String to get the bytes of data. This can be any readable numeric location or a constant value from 0 to the maximum number of characters in the string.

 

Length in Bytes - designates the total number of bytes of data to copy from the Get out of String. This can be any readable numeric location or a constant value from 1 to the maximum number of bytes available in the string.

 

Into Starting Element - designates the beginning location in the controller to place the bytes of data read from the String. This can be any writable numeric location.

 


Status Display:

The Status display of the Get Bytes Out of a String instruction will only display as many of the characters of the Get out of String as will fit within the borders of the instruction, typically this is about 50 characters.

 


See Also:

 


Rung Example: