LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

HP34401A problem

Currently using HP34401A driver and use the example code to display the result of the reading.

Data Type declaration of the variables according to the sample
            ViReal64  reading;
            ViChar    msgStr[256];

checkErr( hp34401a_Read (hp34401a, 5000, &reading));
sprintf (msgStr, "%f", reading);

so for it to display on the panel, i created

SetCtrlVal(panel,PANEL_STRING, msgStr);

not it shows the reading on the Panel as a string(correct me if I am wrong),
because I want to do a calculation first on the reading like I want to display it on float, how can i convert it as such, something like
floatvariable = reading/somevalue;
SetCtrlVal(panel,PANEL_STRING, floatvariable);

thanks
________________________________________________________________
Electronics Manufacturing Tester Forum
0 Kudos
Message 1 of 3
(3,327 Views)

Well the easiest way to do this is to create a numeric control on your panel and set it as an indicator for the double data type. Then you can simply do a:

    SetCtrlVal (panel, PANEL_NUMERIC, double_value_to_display);

JR

0 Kudos
Message 2 of 3
(3,317 Views)
Hello JR,

Thanks for your reply, I forgot, i have already the variable "reading" to work on.
________________________________________________________________
Electronics Manufacturing Tester Forum
0 Kudos
Message 3 of 3
(3,311 Views)