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:
- The flash memory of a local or networked In-Sight vision system.
- A central server via FTP. For more information, see File Transfer Protocol (FTP).
- The RAM Disk or SD Card of a local or networked vision system. For more information, see RAM Disk Settings Dialog and SD Card Folder.
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:
- 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.
- 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 |
---|---|
Specifies the update event on which to read data. This parameter must be a reference to one of the following:
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.
|
|
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:
|
|
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. |
|
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.
|
|
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.
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.
|
|
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)
- Insert a FindPatterns function into cell F4. For more information, see FindPatternsVision Data Access Functions.
- 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.