ImportData
ImportData is a function that automatically inserts a Cell Data (.CXD) file into the spreadsheet when a predetermined event in the spreadsheet indicates that the file is to be loaded. With the Import Data function, data (stored as a .CXD file) that was exported through the ExportData function is imported, one cell at a time, from one of the following locations:
- The flash memory of a local or networked In-Sight sensor.
- A central server via FTP. For more information, see File Transfer Protocol (FTP).
- The RAM Disk or SD Card of a local or networked sensor. For more information, see RAM Disk Settings Dialog and SD Card Folder.
When a .CXD file is imported using the ImportData function, the data becomes a part of the ImportData function and cannot be edited; when you click on an imported .CXD file, the ImportData property sheet will be opened and not the property sheet for the type of data that was imported. ImportData is able to import the following data types:
- DelayLine: For more information, see DelayLine.
- CountPassFail: For more information, see CountPassFail.
- Calibrate: For more information, see Calibrate.
- CalibrateAdvanced: For more information, see CalibrateAdvanced.
- FindPatterns: For more information, see FindPatterns.
- OCRMax: For more information, see OCRMax.
- OCRMaxSettings: For more information, see OCRMaxSettings.
- TrainPatMaxPattern: For more information, see TrainPatMaxPattern.
- TrainFont: For more information, see TrainFont.
ImportDataInputs
Syntax: ImportData(Event,Host Name,User Name,Password,File Name)
Parameter | Description |
---|---|
Specifies the update event on which to read data. This parameter must be a reference to one of the following:
|
|
Indicates the location where the file is saved. The file can be stored on a local sensor via the flash memory, an external server via FTP, the RAM Disk or SD Card of a local or networked sensor. Note:
|
|
Specifies the user name that will access the file system of the sensor or device where the file is stored. |
|
Specifies the password that will access the file system of the sensor or device where the file is stored. Note: The Host Name, User Name and Password parameters are only required for FTP destinations.
|
|
Specifies the name for the file used to identify the information being stored.
Note: Inserting the file name extension is not required; it is automatically appended to the string. If a different file name extension is inserted, In-Sight will return a #ERR.
|
ImportDataOutputs
The imported data will correspond to the data structure of the data contained in the exported cell. For example, if an integer is imported, the cell will display the integer value; if a Calib structure is imported, the cell will display the Calib structure. But, when you double-click on the Calib structure, the ImportData property sheet will open, and not the Calib structure's property sheet.
ImportData will import a .CXD file if one of the following four conditions is met:
- The OKbutton on the ImportData property sheet is pressed.
- An Event is received. For more information, see Event.
- The ImportData Event parameter is ON (or points to a non-zero numeric value), and any one of the ImportData input parameters is updated.
- A job with an ImportData function is loaded.
ImportData Example
ImportData(A0,"192.168.0.100","admin","","PartXPattern")
Whenever the spreadsheet updates after an image acquisition, the function imports the data, as a file named PartXPattern.cxd, from the server located at the IP address 192.168.0.100. The user name is specified as admin, and the password is left blank.