LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Show the adresse of a variable in a box

Hallo,

I need to see the ADRESS of a variable in a box (table), while the programm is running. I have problems to transfer the adress of a double into the box (table). I don't know the format of an adress; is it a String or an Integer ??. In each case (String, Double, Integer) i always get an Error.
Is somebody able to help me?

Thanks

Nyn
0 Kudos
Message 1 of 2
(2,959 Views)
Variable addresses are integer pointers.

To help you treat them, try this: paste these line into the Interactive Window and press Shift-F5 to run them.

static int *adr;
static char msg[60];

adr = (int *)msg;
DebugPrintf ("Direct address: %d - Address in a 'adr' variable: %d\n", &msg, adr);

In the example, you obtain the address of 'msg' variable both directly into the output message and in the variable 'adr'. I choose the char type because you can easily see its address into the Variables window, and compare it to the output message into the Debug Window.

Also when considering other type of variables you'll have to cast their address to an integer pointer in order to store it into a variable:

static double k;
adr = (int *)&k;

Hope this
helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 2
(2,959 Views)