12.07.2015 Views

RAPID reference manual - Technology

RAPID reference manual - Technology

RAPID reference manual - Technology

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

InstructionCopyRawBytesFile and Serial Channel HandlingCopyRawBytes - Copy the contents of rawbytes dataCopyRawBytes is used to copy all or part of the contents from one rawbytes variableto another.ExampleVAR rawbytes from_raw_data;VAR rawbytes to_raw_data;VAR num integer := 8VAR num float := 13.4;ClearRawBytes from_raw_data;PackRawBytes integer, from_raw_data, 1 \IntX := DINT;PackRawBytes float, from_raw_data, (RawBytesLen(from_raw_data)+1) \Float4;CopyRawBytes from_raw_data, 1, to_raw_data, 3, RawBytesLen(from_raw_data);In this example the variable from_raw_data of type rawbytes is first cleared, i.e.all bytes set to 0. Then in the first 4 bytes the value of integer is placed and in thenext 4 bytes the value of float.After having filled from_raw_data with data, the contents (8 bytes) is copied toto_raw_data, starting at position 3.ArgumentsCopyRawBytesFromRawDataFromRawData FromIndex ToRawData ToIndex [ \NoOfBytes ]Data type: rawbytesFromRawData is the data container from which the rawbytes data shall be copied.FromIndexData type: numFromIndex is the position in FromRawData where the data to be copied starts.Indexing starts at 1.ToRawDataData type: rawbytesToRawData is the data container to which the rawbytes data shall be copied.ToIndexData type: numToIndex is the position in ToRawData where the data to be copied will be placed.Indexing starts at 1.<strong>RAPID</strong> <strong>reference</strong> <strong>manual</strong> - part 1a, Instructions A-R 63

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!