ExportData

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

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

Note: TheExportData function cannot export .CXD files to the Snippetsfolder on the PC.For more information, see Palette: Spreadsheet View.
CAUTION:  
  • Writingdata 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 thejob takes longer to process than the trigger period.
  • Whenutilizing the ExportDatafunction 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 jobwill be slowed when more than 0.5KB/sec of data is written to flash memorysixteen consecutive times.In this event, data will not be dropped orignored.An In-Sight vision system's flash memory has a life-cycle of approximately100,000 writes per page, therefore, when using the ExportDatafunction, the precaution above must be taken to protect the vision system's flashmemory.

ExportDataInputs

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

Parameter Description

Event

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

  • TheImage data structurein cell A0, containing the AcquireImagefunction.For more information, see AcquireImage.

    Note: If the datais being written to flash memory and the Eventis set to the Imagedata structure, an #ERR will be returned.
  • Acell containing an Event function.For more information, see Event.
  • Acell containing a Button function.For more information, see Button.
Note: The defaultEvent parameter setting for the ExportDatafunction is 0, and if the setting remains at 0, an ExportDatabutton will be created next to the ExportDatacell.

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 datato flash memory, the Host Name field must be left blank (e.g. "").
  • If an FTP serveris specified as the destination, and the FTP server is unavailable atthe time of the data transfer, it will take severalseconds to timeout; In-Sight Explorer may disconnect from the vision system ifthis occurs.

User Name

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

Password

Specifies the password that will access thefile system of the vision system or device that will store the file.If the datais being exported to a local vision system's flash memory, RAM Disk or SD Card, this fieldcan 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 identifythe information being stored.If the file name already exists on the targetlocation, the existing file will be overwritten.

  • When exporting to RAM Disk, the File Name mustinclude "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 thefilename extension is not required; it will automatically be appendedto the string.If a different filename extension is inserted, an #ERRwill be returned.

Data to Export

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

ExportDataOutputs

Returns

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

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

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

  • The OKbutton on the ExportData property sheet is pressed.

  • An Eventis received.

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

    Note: ExportDatawill export data even while in Offlinemode.

ExportData Examples

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

Whenever the spreadsheet updates after an event is triggered in cellA8, 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. Inserta FindPatterns function into cell F4.For more information, see FindPatternsVision Data Access Functions.
  2. Opena 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 namedFindPatterns.cxd and saved to the flash memory of the local vision system.Theuser name and password are not required because the data is being writtento a vision system.For more information, see Evaluate.