LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI : CWGraph and CWNumEdit

Hi,

using CVI and CW, I ve some problem.

1)I try to install a callback function to an ActiveX CWNumEdit. I've taken the callback function prototype in the include file but the function CWUIControlsLib__DCWNumEditEventsRegOnValueChanged () needs a CAObjHandle. I've tried to pass the CAObjHandle got by :
GetObjHandleFromActiveXCtrl() function but it doesn't work. Any suggestion ?
2)How can I simply calculate the value of a date to set the x-axis on a CWGraph ?. This value is base on midnight 30 december 1899.

Thank for your help
0 Kudos
Message 1 of 2
(2,801 Views)
1) It worked fine for me. I got the callback event to work using the objHandle for the CWNumedit from GetObjHandleFromActiveXCtrl(). Maybe if you post your code, we could see the problem.

2) If you look at the Online help for the ActiveX controls it will tell you under the help for CWAxis.FormatString. Here is the quote from the help that tells you how to calculate the value.

"With ActiveX controls, the date is implemented as a floating-point value, measuring days from midnight, 30 December 1899. So, midnight, 31 December 1899, is represented by 1.0. Similarly, 6 AM, 1 January 1900, is represented by 2.25, and midnight, 29 December 1899, is -1.0. However, 6 AM, 29 December 1899, is -1.25. To interpret the time portion, take the absolute value of the
fractional part of the number. Thus, 1 second equals 1 / 24 hours / 60 minutes / 60 seconds, which is 1/86400 or approximately 1.157407e-5."

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 2
(2,801 Views)