Raptor:Data Logging File Read: Difference between revisions

From NewEagleWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(2 intermediate revisions by one other user not shown)
Line 6: Line 6:


== Description ==
== Description ==
<p>This block is used to read the contents of a file.</p>
<p>This block will take in the file handle and length of a message to be read. It will then output a uint8 array of the given length.</p>
 
<p>The value provided to the "Length" input of the block will determine the number of characters read from the target file. The value provided to the mask parameter: "Output Size" determines the size of the character array output by the read block. If these values differ (e.g. Output Size is larger than "Length"), the remaining characters output in the Data array will be unitialized and may contain undesired values.</p>
 
<p>As with many of the other datalogging and file I/O Raptor blocks, this block takes a file handle as an input, and propagates the same file handle through the block logic to an output of the block. By connecting the File Handle output of file I/O block 'X' to the File Handle input of file I/O block 'Y', application designers can ensure that the logic executed by block Y will be performed after the logic executed by block X.</p>


== Inputs ==
== Inputs ==
Line 16: Line 20:
|-
|-
! File Handle
! File Handle
| File Handle
| file type
| Specifies the file to check.
| A number the operating system temporarily assigns to a file when it is opened
|-
|-
! Length
! Length
| int32
| int32
|  
| The length of data that will be read.
|}
|}


Line 31: Line 35:
! scope="col" style="width: 70%;"|Description
! scope="col" style="width: 70%;"|Description
|-
|-
! File Handle
! File Handle
| File Handle
| file type
| Outputs the File Handle provided on the input.
| A number the operating system temporarily assigns to a file when it is opened
|-
|-
! Data
! Data
| uint8[]
| uint8[]
| The data read from the file.
| An array of data that is output in packets that are the size of the 'Length' input (up to 10 bytes).
|-
|-
! Length
! Length
| int32
| int32
|  
| The length of data that is being read.
|}
|}


Line 51: Line 55:
! scope="col" style="width: 70%;"|Description
! scope="col" style="width: 70%;"|Description
|-
|-
! Resource
! Hardware Resource
|  
|  
| Specify the resource which contains the file to read.
| Specified hardware from which the file will be opened.
|-
|-
! Output Size
! Output Size
|
|  
|  
| Determines the size of the character array to be output by the block.
|}
|}

Latest revision as of 13:00, 13 September 2023

Return to the main Raptor page

Return to File IO page

Raptor™ Data Logging File Read

Description

This block will take in the file handle and length of a message to be read. It will then output a uint8 array of the given length.

The value provided to the "Length" input of the block will determine the number of characters read from the target file. The value provided to the mask parameter: "Output Size" determines the size of the character array output by the read block. If these values differ (e.g. Output Size is larger than "Length"), the remaining characters output in the Data array will be unitialized and may contain undesired values.

As with many of the other datalogging and file I/O Raptor blocks, this block takes a file handle as an input, and propagates the same file handle through the block logic to an output of the block. By connecting the File Handle output of file I/O block 'X' to the File Handle input of file I/O block 'Y', application designers can ensure that the logic executed by block Y will be performed after the logic executed by block X.

Inputs

Input Type Description
File Handle file type A number the operating system temporarily assigns to a file when it is opened
Length int32 The length of data that will be read.

Outputs

Output Type Description
File Handle file type A number the operating system temporarily assigns to a file when it is opened
Data uint8[] An array of data that is output in packets that are the size of the 'Length' input (up to 10 bytes).
Length int32 The length of data that is being read.

Parameters

Parameter Type Description
Hardware Resource Specified hardware from which the file will be opened.
Output Size Determines the size of the character array to be output by the block.