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.

InstructionClearRawBytesFile and Serial Channel HandlingClearRawBytes - Clear the contents of rawbytes dataClearRawBytes is used to set all the contents of a rawbytes variable to 0.ExampleVAR rawbytes raw_data;VAR num integer := 8VAR num float := 13.4;PackRawBytes integer, raw_data, 1 \IntX := DINT;PackRawBytes float, raw_data, (RawBytesLen(raw_data)+1) \Float4;ClearRawBytes raw_data \FromIndex := 5;In the first 4 bytes the value of integer is placed (from index 1) and in the next 4bytes starting from index 5 the value of float.The last instruction in the example clears the contents of raw_data, starting atindex 5, i.e. float will be cleared, but integer is kept in raw_data.Current length of valid bytes in raw_data is set to 4.ArgumentsClearRawBytes RawData [ \FromIndex ]RawDataData type: rawbytesRawData is the data container which will be cleared.[ \FromIndex ] Data type: numWith \FromIndex it is specified, where to start clearing the contents of RawData.Everything is cleared to the end.If \FromIndex is not specified, all data starting at index 1 is cleared.Program executionData from index 1 (default) or from \FromIndex in the specified variable is reset to 0.The current length of valid bytes in the specified variable is set to 0 (default) or to (FromIndex- 1) if \FromIndex is programmed.<strong>RAPID</strong> <strong>reference</strong> <strong>manual</strong> - part 1a, Instructions A-R 37

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

Saved successfully!

Ooh no, something went wrong!