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:
- The flash memory of a localor 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 localor 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 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:
- 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.
- 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 |
---|---|
Specifies the update event on which to readdata. This parameter must be a reference to one of the following:
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.
|
|
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 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. |
|
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.
|
|
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.
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.
|
|
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)
- Inserta FindPatterns function into cell F4.For more information, see FindPatternsVision Data Access Functions.
- 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.