LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CWGraph AxisSetFormatString

Hi!
 
What is it wrong with the line in italic?

    CAObjHandle ObjHandle;        // Handle for activeX control
    CWUIControlsLibObj_CWAxes AxesHandle;
    CWUIControlsLibObj_CWAxis AxisHandle;
    
    GetObjHandleFromActiveXCtrl (panel, control, &ObjHandle);
    CWUIControlsLib_Get_DCWGraphProperty (ObjHandle, NULL, CWUIControlsLib__DCWGraphAxes,
            CAVT_OBJHANDLE, &AxesHandle);
    CWUIControlsLib_CWAxesItem (AxesHandle, NULL, CA_VariantInt(AxisValue), &AxisHandle);

    CWUIControlsLib_CWAxisSetFormatString (AxisHandle, NULL, "hh:nn:ss");

Thank you in advance.

Message Edited by Oliveira on 10-16-2007 12:01 PM

0 Kudos
Message 1 of 5
(3,585 Views)

I don't use Measurement Studio so I'm not at all familiar with the library you refer to, but I couldn't help noticing the apparant typo in the final string. Should it be "hh:mm:ss"? Could this (presumably unrecognised format) be upsetting the library?

    CWUIControlsLib_CWAxisSetFormatString (AxisHandle, NULL, "hh:nn:ss");

JR

0 Kudos
Message 2 of 5
(3,569 Views)
No, the string format according the manual is correct.

Some other idea of what can be happening?

Thank you.
0 Kudos
Message 3 of 5
(3,563 Views)
In fact, I would like to pass as a parameter to the plot function, a timestamp in seconds that starts to count at midnight and the graph should shows me the time axis in the format "hh:nn:ss"

Using this function, I hope that it occurs automatically. If it doesn't works as I expect what have I to do?

Thank you!
0 Kudos
Message 4 of 5
(3,562 Views)
Hi Oliveira,

Are you able to set the FormatString property during design-time to see if that works? To do that, right-click on the graph and select Properties and then switch to the Format tab. There you can configure the Format string. 

It looks like you are using both Per Server and Per Property configurations which is a bit odd. That first statements you posted should say something like:

CWUIControlsLib_CWAxesItem (axesHandle, NULL, CA_VariantInt(1), &axisHandle);
CWUIControlsLib_SetCWAxisProperty (axisHandle, NULL, CWUIControlsLib_CWAxisFormatString, CAVT_CSTRING, "hh:nn:ss");


In addition to the FormatString property, you will need to also convert your data such that it represents the date/time that you want to represent. See the last paragraph in the remarks section of the CWAxis.FormatString property in the Measurement Studio reference for more information.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 5 of 5
(3,549 Views)