ExportData

ExportData is a function that automatically exports data in a spreadsheet cell to a Cell Data (.CXD) file when a predetermined event in the spreadsheet indicates that the file is to be exported. It allows the data within a single cell on one vision system to be exported to one of the following locations:

When a .CXD file is exported using the ExportData function, the data becomes a part of the ExportData function and cannot be edited; when you click on an exported .CXD file, the ExportData property sheet will be opened and not the property sheet for the type of data that was exported. ExportData is able to export the following data types:

Note: The ExportData function cannot export .CXD files to the Snippets folder on the PC. For more information, see Palette: Spreadsheet View.
CAUTION:  
  • Writing data from the ExportData function is a potential job blocking function; jobs can be slowed down and a vision system may queue or miss a trigger if the job takes longer to process than the trigger period.
  • When utilizing the ExportData function to write to a local or networked In-Sight vision system's flash memory, the following considerations apply: a warning will be issued and the job will be slowed when more than 0.5KB/sec of data is written to flash memory sixteen consecutive times. In this event, data will not be dropped or ignored. An In-Sight vision system's flash memory has a life-cycle of approximately 100,000 writes per page, therefore, when using the ExportData function, the precaution above must be taken to protect the vision system's flash memory.

ExportDataInputs

Syntax: ExportData(Event,Host Name,User Name,Password,File Name,Data to Export)

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.

    Note: If the data is being written to flash memory and the Event is set to the Image data structure, an #ERR will be returned.
  • A cell containing an Event function. For more information, see Event.
  • A cell containing a Button function. For more information, see Button.
Note: The default Event parameter setting for the ExportData function is 0, and if the setting remains at 0, an ExportData button will be created next to the ExportData cell.

Host Name

Indicates the location where the file isto be saved.Thefile can be stored on a local or networked vision system via the flash memory,an external server via FTP, RAMDisk, or SD Card of a local or networked vision system.

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 exporting data to flash memory, 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 vision system if this occurs.

User Name

Specifies the user name that will access the file system of the vision system or device that will store the file. If the data is being exported to a local vision system's flash memory, RAM Disk or SD Card, this field can be left blank.

Password

Specifies the password that will access the file system of the vision system or device that will store the file. If the data is being exported to a local vision system's flash memory, RAM Disk or SD Card, this field can be left blank.

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. If the file name already exists on the target location, the existing file will be overwritten.

  • When exporting to RAM Disk, the File Name must include "ramdisk/" before the name of the file (e.g. "ramdisk/PartXPattern"; the spelling of RAM Disk in this instance is not case sensitive).
  • When exporting to 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).
Note: Inserting the file name extension is not required; it will automatically be appended to the string. If a different file name extension is inserted, an #ERR will be returned.

Data to Export

Indicates the cell that will be exported. If a cell contains a reference to another structure, such as a GetString reference, the actual value contained in the cell be exported.

ExportData Outputs

Returns

Creates a .CXD file that can be stored on an external server via FTP server, a local or networked In-Sight vision system's flash memory, or on the RAM Disk or SD Card of a local or networked vision system.

Note: If ExportData returns an #ERR as a result, you can utilize GetErrorString to determine the cause. For more information, see GetErrorString.

ExportData will export a .CXD file if one of the following three conditions are met:

  • The OKbutton on the ExportData property sheet is pressed.

  • An Event is received.

  • The Event parameter is ON (or points to a non-zero numeric value), and any one of the ExportData input parameters is updated.

    Note: ExportData will export data even while in Offline mode.

ExportData Examples

ExportData(A8,"FTPServer1","operator1","","PartXPattern",H7)

Whenever the spreadsheet updates after an event is triggered in cell A8, the function writes the data in cell H7, as a file named PartXPattern.cxd, to the server named FTPServer1. The user name is specified as operator1, and the password is left blank.

EV ExportData(1,"","","","FindPatterns",F4)

  1. Insert a FindPatterns function into cell F4. For more information, see FindPatternsVision Data Access Functions.
  2. Open a telnet session and issue the following EvaluateNative Mode command: EV ExportData(1,"","","","FindPatterns",F4).The FindPatterns function contained in cell F4 is written to a file named FindPatterns.cxd and saved to the flash memory of the local vision system.The user name and password are not required because the data is being writtento a vision system.For more information, see Evaluate.