From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get time tick marks in Component Works 2.0?

I've been trying to get VC++ to set up tick marks based upon seconds, minutes and hours on a graph. I also set the graph to show 10 minutes. When I run the graph, I see NO tick marks (even at 1 second intervals). When I do Auto Scale I see a BUNCH of tick marks. When I Zoom, the tick marks have no label which makes me think that they are minor tick marks. Here is my code:


COleVariant vDivisions( (double)0 );
COleVariant vInterval( (double)1 );
COleVariant vBaseSize( dBaseSize ); // equals 1/86400


m_X_Axis.GetTicks().SetMajorDivisions(vDivisions);// Must be zero in the instructions
m_X_Axis.GetTicks().SetMajorUnitsInterval( vInterval );// display each second (UNIT) is shown. The instructions say 2 wo
uld be every other second.
m_X_Axis.GetTicks().SetMajorUnitsBase( vBaseSize );// display using seconds.


OK..what am I doing wrong?
0 Kudos
Message 1 of 2
(2,716 Views)
Hello

Since you are using Unit Intervals, its expecting the input in a string type format ( See Measurement Studio Help for more details on how to pass information for hour min second format), so instead of a one, it needs (number of seconds)/86400

try using this instead

COleVariant vInterval( (double) 2.0/86400.0 ); // Set minor ticks every two seconds.

m_X_Axis.GetTicks().SetMajorUnitsInterval( vInterval )

This way, it will display the minor ticks every 2 seconds.

Hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(2,716 Views)