File size: 9,242 Bytes
44efec5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
HSLFilLib
================================
https://github.com/theonetruenerd/VenusPackages/blob/main/HSLFilLib.pkg
This library allows interaction with and manipulation of files present on the host computer. It adds the following functions:
- :ven:func:`FilEof`
- :ven:func:`FilFindFile`
- :ven:func:`FilFindNextFile`
- :ven:func:`FilFormatBarcodeFile`
- :ven:func:`FilGetBinPath`
- :ven:func:`FilGetCommState`
- :ven:func:`FilGetCommTimeouts`
- :ven:func:`FilGetConfigPath`
- :ven:func:`FilGetLabwarePath`
- :ven:func:`FilGetLibraryPath`
- :ven:func:`FilGetLogFilesPath`
- :ven:func:`FilGetMethodsPath`
- :ven:func:`FilGetSystemPath`
- :ven:func:`FilIsNull`
- :ven:func:`FilReadString`
- :ven:func:`FilRemoveFields`
- :ven:func:`FilSearchPath`
- :ven:func:`FilSetCommState`
- :ven:func:`FilSetCommTimeouts`
- :ven:func:`FilUpdateRecord`
- :ven:func:`FilWriteString`
.. ven:function:: FilEof(variable filObj)
This function checks whether the current position in the specified file is the final line
:params filObj: The opened file to be checked
:type filObj: Variable (file)
:return: Boolean as to whether the position is the end of the file or not
:rtype: Boolean
.. ven:function:: FilFindFile(variable filName)
This function starts searching the specified path for a file. This function is obsolete, and :ven:func:`FilSearchPath` should be used instead.
:params filName: The directory or path and file name to be searched for. Can contain wildcard characters such as * or ?
:type filName: Variable
:return: If successful, the path name of the first file found that matches the input
:rtype: Variable
.. ven:function:: FilFindNextFile()
Continues the search from :ven:func:`FilFindFile` to the next file.
:return: If successful, the path name of the next file found that matches the input from the most recent FilFindFile command
:rtype: Variable
.. ven:function:: FilFormatBarcodeFile(variable dataSource, variable dataTarget)
This function takes the barcode ASCII text file written during LoadCarrier and converts it into a strongly formatted barcode file. This strongly formatted file can be an ASCII text file, a Microsoft Excel file, or a Microsoft Access file. Will contain the following columns:
- ID (record ID, integer)
- Specifier (string, P = position, C = carrier)
- Position (position, integer)
- Barcode (barcode, string)
- Timestamp (timestamp, YYYY-MM-DD hh:mm:ss, string)
:params dataSource: The name of the barcode ASCII file generated during the load carrier step
:params dataTarget: The name of the barcode ASCII text file, Microsoft Excel file or Microsoft Access file generated by the function. The name must include a table name for a Microsoft Excel file or a Microsoft Access Database.
:type dataSource: Variable
:type dataTarget: Variable
:return: Boolean showing if the function was successful or not
:rtype: Boolean
.. ven:function:: FilGetBinPath()
This function retrieves the vector binary path
:return: The vectory binary path (usually C:\Program Files (x86)\Hamilton\Bin)
:rtype: Variable
.. ven:function:: FilGetCommState(file port)
This function retrieves the configuration information for the specified communication resource. The entries of the structure that retrieves the configuration information must be accessible in the global scope.
:params port: The communication resource opened during the file-Open operation
:type: Port
:return: Boolean showing if the function was successful or not
:rtype: Boolean
.. ven:function:: GetCommTimeouts(file port)
This function retrieves the time-out parameters for all read and write operations for the specified communication resource. The entries of the structure that contains the configuration information must be accessible in the global scope.
:params port: The communication resource opened during the file-Open operation
:type port: Port
:return: Boolean showing if the function was successful or not
:rtype: Boolean
.. ven:function:: FilGetConfigPath()
This function retrieves the vector configuration path
:return: The vector configuration path (usually C:\Program Files (x86)\Hamilton\Config)
:rtype: Variable
.. ven:function:: FilGetLabwarePath()
This function retrieves the vector labware path
:return: The vector labware path (usually C:\Program Files (x86)\Hamilton\Labware)
:rtype: Variable
.. ven:function:: FilGetLibraryPath()
This function retrieves the vector library path
:return: The vector library path (usually C:\Program Files (x86)\Hamilton\Library)
:rtype: Variable
.. ven:function:: FilGetLogFilesPath()
This function retrieves the vector log files path
:return: The vector log files path (usually C:\Program Files (x86)\Hamilton\LogFiles)
:rtype: Variable
.. ven:function:: FilGetMethodsPath()
This function retrieves the vector methods path
:return: The vector methods path (usually C:\Program Files (x86)\Hamilton\Methods)
:rtype: Variable
.. ven:function:: FilGetSystemPath()
This function retrieves the vector system path
:return: The vector system path (usually C:\Program Files (x86)\Hamilton\System)
:rtype: Variable
.. ven:function:: FilIsNull(variable value)
This function returns a non-zero if the variable is a null value (SQL style Null).
:params value: The variable being checked
:type value: Variable
:return: A boolean determining if the variable is SQL style Null or not
:rtype: Boolean
.. ven:function:: FilReadString(file fileObj)
This function reads the next record from the input file as string-valued data. Row data, but no schema data, is saved to the string. After you call FilReadString, the next unread record becomes the current record, or Eof is set to hslTrue if there are no more records.
:params fileObj: The file being looked at
:type fileObj: File
:return: The contents of the line being looked at as string-valued data, or the specific run-time error
:rtype: String
.. ven:function:: FilRemoveFields(file fileObj)
This function removes all fields from a record definition
:params fileObj: The file containing the record which is having its fields removed
:type fileObj: File
:return: None
:rtype: N/A
.. ven:function:: FilSearchPath(variable fileName)
This function searches for the specified file, and outputs the path and filename of the file if found, or an empty string if not found. Will search the current directory, the methods directory, the library directory, and any directories in the PATH environment variable.
:params fileName: The file name to be searched for
:type fileName: Variable
:return: The path name of the first file found, or an empty string if no files were found
:rtype: Variable
.. ven:function:: FilSetCommState(file port, variable cfgFile)
This function configures a communication resource according to the specifications in a structure that contains the configuration information. The structure that contains the configuration information must be structured as shown below. Each entry in the structure is optional and overwrites the default value in parentheses.
:params port: The communication resource opened during the file-Open operation
:params cfgFile: The name of the file containing the configuration information. If this parameter is empty, the entries in the structure that contains the configuration information must be accessible in the global scope.
:type port: File
:type cfgFile: Variable
:return: Boolean showing whether the function succeeded or not
:rtype: Boolean
.. ven:function:: FilSetCommTimeouts(file port, variable cfgFile)
This function sets the time-out parameters for all read and write operations on a specified communication resource. The structure that contains the time-out information is as shown below. Each entry in the structure is optional and overwrites the default value in parentheses.
:params port: The communication resource opened during the file-Open operation
:params cfgFile: The name of the file that contains the time-out information. If this parameter is empty, the entries in the structure that contains the time-out information must be accessible in the global scope.
:type port: File
:type cfgFile: Variable
:return: Boolean showing whether the function succeeded or not
:rtype: Boolean
.. ven:function:: FilUpdateRecord(file fileObj)
Updates the current record of the file object with the values of the variable objects specified in the record definition. The current record remains current after you call the FilUpdateRecord function. The provider must support UPDATE.
:params fileObj: The file object being updated
:type fileObj: File
:return: Boolean showing whether the function succeeded or not
:rtype: Boolean
.. ven:function:: FilWriteString(file fileObj, variable stringObj)
Writes a string to the end of the file data source. After you call the FilWriteString function, the new record becomes the current record.
:params fileObj: The file which is being written in
:params stringObj: The string to be written
:type fileObj: File
:type stringObj: Variable
:return: Boolean showing whether the function succeeded or not
:rtype: Boolean
|