DC_SCAN_CONTAINER Function

Determines the number and location of defined variables in an HP VEE Container by scanning the file.

Usage

    status = DC_SCAN_CONTAINER(filename, num_variables, start_records, end_records)

Input Parameters

filename — A string containing the path name and filename of the Container file.

Output Parameters

num_variables — The number of variables described within the specified Container file.

start_records — A long array containing the starting position of each variable within the Container file. This information can be used as input to the DC_READ_CONTAINER function to extract a given variable.

end_records — A long array containing the ending position of each variable within the Container file. This information can be used as input to DC_READ_CONTAINER to extract a given variable.

Returned Value

status — The value returned by DC_READ_CONTAINER indicating the validity of the returned output parameter information.

  • < 0 — Indicates an error, such as an invalid filename or incorrect file format.

  • 0 — Indicates a successful read.

Keywords

None.

Discussion

HP VEE is Hewlett-Packard’s Visual Engineering Environment, a graphical programing language for creating test systems and solving engineering problems.

The Container file format is a proprietary HP ASCII file format which contains a header description of the enclosed data. PV‑WAVE reads this header information and creates a PV‑WAVE variable of the appropriate type and dimension to hold the enclosed data.

DC_SCAN_CONTAINER enables you to determine the number of variables described within an HP VEE Container file. The returned parameter arrays start_records and end_records can be used as inputs to the DC_READ_CONTAINER function to extract individual variables.

An HP VEE Container file is created in HP VEE by using the Write Container transaction in the To File object. Please refer to your HP VEE documentation for more details.

Example

This example shows how to scan a Container file for multiple containers. Then, a loop is created that reads each container found in the file.

; Scan container file for multiple containers. Loop for every 
; container in the file. At this point, you could check num_vars. 
; DC_READ_CONTAINER function can only read 1 container at a time.
status = DC_SCAN_CONTAINER(!Data_dir+'hpvee_multi.con',  $
num_vars, start_recs, end_recs)

; Make a new name for each variable. 
; There are other ways to do this as well.
FOR I=0L, num_vars-1 DO $
   rc= EXECUTE("status = DC_READ_CONTAINER( " + $
      "!Data_dir + 'hpvee_multi.con'," + $
      'var' + STRTRIM(I,2) + $
      ", Start_Record=start_recs(I), " + $
      "End_Record=end_recs(I))" )

; At the WAVE> prompt, use INFO to show the new variables.
INFO, var0, var1, var2
; VAR0 DOUBLE    = 18.0000
; VAR1 COMPLEX   = Array(4)
; VAR2 DOUBLE    = Array(10) 

See Also

DC_READ_CONTAINER