Main Content

opc.setDateDisplayFormat

Set display format of timestamp for OPC data objects

Description

opc.setDateDisplayFormat(dateFmt) sets the display format of timestamp for OPC HDA data objects to dateFmt. The display format persists across MATLAB® sessions.

newFmt = opc.setDateDisplayFormat(___) sets the display format and also returns the new display format in newFmt.

example

Examples

collapse all

Load the OPC HDA example data set and set the display format. Display the timestamps and the corresponding values and quality readings of one of the loaded variables.

load opcSampleHdaData;
opc.setDateDisplayFormat('HH:MM:SS');
hdaDataSmall(1).showValues
    TIMESTAMP      VALUE       QUALITY
    ========  =============  ==========
    09:30:00       0.000000  Raw (Good)
    09:30:15       1.000000  Raw (Good)
    09:30:30       2.000000  Raw (Good)
    09:30:45       1.000000  Raw (Good)
    09:31:00       0.000000  Raw (Good)

Set the display format of timestamp to display date and time, and display the values again.

opc.setDateDisplayFormat('yyyy-mm-dd HH:MM:SS');
hdaDataSmall(1).showValues
         TIMESTAMP           VALUE       QUALITY
    ===================  =============  ==========
    2010-06-01 09:30:00       0.000000  Raw (Good)
    2010-06-01 09:30:15       1.000000  Raw (Good)
    2010-06-01 09:30:30       2.000000  Raw (Good)
    2010-06-01 09:30:45       1.000000  Raw (Good)
    2010-06-01 09:31:00       0.000000  Raw (Good)

Input Arguments

collapse all

Display format of timestamp for OPC HDA objects, specified as date format number, character vector, or string as defined by datestr.

Example: opc.setDateDisplayFormat('HH:MM:SS');

Data Types: char | string

Output Arguments

collapse all

Display format of timestamp for OPC HDA objects, returned as a character vector.

Version History

Introduced in R2011a

See Also

Functions