The following methods are available for interfacing with the CxDynagraph.CxExport object:
For information about other methods not specific to CxDynagraph.CxExport, including additional export methods, see CxDynagraph Methods.
The CancelExport method enables you to define how many seconds to wait before canceling the export.
CancelExport(iSecondsToWait As Long) As Boolean
| Parameter | Required | Description |
|---|---|---|
| iSecondsToWait | Yes | Defines the maximum number of seconds to wait before canceling the export. |
GetStatus() As String
IsExportRunning() As Boolean
The StartExport method defines the export of the specified set of dynagraph cards upon a defined event.
StartExport(UisOrDdsSiteService As String, Filter As String, CardTypes As Integer, SurfaceCard As Boolean, DateTime As String, ExportFormat As Integer, FileSpecifier As String, StatusTag As String) As Boolean
| Parameter | Required | Description |
|---|---|---|
|
UisOrDdsSiteService |
Yes |
The UisOrDdsSiteService method defines the relevant UIS or DDS site and service in "Site.Service" format. For example, TEST.UIS. |
|
Filter |
Yes |
Identifies a set of devices to export. Only pumpoff control devices can be included. Note:Setting a device filter to DEVICE_ENABLED=Y yields a list of all enabled pumpoff control devices. Setting a device filter to DEVICE_TYPE=LUFKINSAM yields a list of all Lufkin SAM devices. Setting a device filter to FACILITY_ID=SAM_TEST yields the one facility with Facility ID SAM_TEST. |
|
CardTypes |
Yes |
Identifies a set of card types to export. Cards are identified by the following numeric constants:
To export both shutdown and pump-up cards, set to 6 (shutdown (2) + pumpup (4) = 6). |
|
SurfaceCard |
Yes |
Indicates if a card is a surface card (true) or a downhole card (false). Currently, the only export format valid for downhole cards is .csv. |
|
DateTime |
Yes |
Represents the earliest card time (DDS transaction timestamp) to export. It can be an absolute time (for instance, 1/14/2019) or relative time (for instance, t-1 = yesterday). If left blank, the single most recently retrieved card is exported. Otherwise, all cards retrieved on or after this time are exported. |
|
ExportFormat |
Yes |
Indicates the export file format. File formats are identified by the following numeric constants:
|
|
FileSpecifier |
Yes |
Specifies the folder (or file) in which to store the relevant export files. If no file name is specified, the default file name is FacilityId_DateTime.filename, where .filename is the file extension specific to the export format. Keyword substitution is provided for facility ID, date, sequence number, card type, and file extension. For example, a default file name can be represented as "%fac%_%date%.%ext%". A file specifier of "c:\DynaExport\%fac%_%date%\Current%seq%.%ext%" puts the cards for each facility and date into a different folder. For instance, c:\DynaExport\FAC1_2007-09-29\Current0.DAT. The following are all of the format specifiers available:
Additional formatting is available for dates and sequence numbers; the nomenclature is the same as on CygNet Studio screens. For example "%date[yyyy-mmm-dd]%" results in the a date formatted as 2007-Sep-19. Sequence number formatting can be used to zero pad numbers. For example, "%seq[000]%" results in a 3-digit sequence number. |
|
StatusTag |
Yes |
Writes export status to a fully qualified tag. Upon successful export, this value indicates the number of facilities and number of cards exported. Leave blank to omit recording to a status tag. |
The following is a very simple example used in a CygNet Studio screen.
|
On Error Resume Next Dim gDynaExp Set gDynaExp = CreateObject("CxDynagraph.CxExport") If err.number <> 0 Then MsgBox "Unable to create object" Exit Sub End If
' UisOrDdsSiteService ' Filter ' CardTypes 1=current; 2=shutdown; 4=pumpup; 8=reference; 16=start ' SurfaceCard ' DateTime (blank = most recent card) ' ExportFormat: 1=csv; 2=diag; 3=theta ' FileSpecifier ' StatusTag (blank = none)
gDynaExp.StartExport "SEK.UIS", "DEVICE_ID=SAM45", 1, True, "May 2, 2007 13:34", 2, "d:\CygNet\ExportFiles", "SEK.UIS:SAM45_EXP_STATUS"
' wait for thread to complete before exiting; ' because of local object (gDynaExp) declaration in this example ' the dynagraph object is destroyed when the function exits
While gDynaExp.IsExportRunning() wscript.sleep(100) ' wait in milliseconds Wend
'In an HSS script, call CygNetScriptHost.Sleep(100) instead of wscript.sleep(100). The CygNetScriptHost.Sleep() function returns false if the HSS is in the midst of shutting down.
bShutdown = false While gDynaExp.IsExportRunning() and not bShutdown bShutdown = CygNetScriptHost.Sleep(100) ' wait in milliseconds Wend |