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:

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:

Note: The ImportData function cannot import .CXD files from the Snippets folder on the PC. For more information, see Palette: Spreadsheet View.

ImportDataInputs

Syntax: ImportData(Event,Host Name,User Name,Password,File Name)

Parameter Description

Event

Specifies the update event on which to read data. This parameter must be a reference to one of the following:

  • The Image data structure in cell A0, containing the AcquireImage function. For more information, see AcquireImage.
  • A cell containing an Event function. For more information, see Event.
  • A cell containing a Button function. For more information, see Button.

Host Name

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:
  • The Host Name drop-down does not list Host Names of In-Sight vision systems and/or emulators on the network. Manually enter the host name or the IP address of the target vision system/emulator in the Host Name field.
  • If importing data from flash memory, RAM Disk or SD Card, the Host Name field must be left blank(e.g. ""). If an FTP server is specified as the destination, and the FTP server is unavailable at the time of the data transfer, it will take several seconds to timeout; In-Sight Explorer may disconnect from the sensor if this occurs.

User Name

Specifies the user name that will access the file system of the sensor or device where the file is stored.

Password

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.

File Name

Specifies the name for the file used to identify the information being stored.

  • When importing from RAMDisk, the File Name must include "ramdisk/" before the name of the file (e.g. "ramdisk/PartXPattern"; the spelling of RAMDisk in this instance is not case sensitive). For more information, see RAM Disk Settings Dialog.
  • When importing from SD Card, the File Name must include "sdcard/" before the name of the file (e.g. "sdcard/PartXPattern"; the spelling of SD Card in this instance is not case sensitive). For more information, see In-Sight Files.
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.
Note: ImportData will import data even while in Offline mode.

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.