LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

memory mapping

I'm coming from the world of C language where to write to a particular hardware address, you might say
 
#define MAILBOX0_ADDRESS    0xFFD80000    /* Mailbox 0 Local Address */
 
 
How do I do something like this in LabVIEW?
0 Kudos
Message 1 of 3
(2,884 Views)
Pretty much the same way, sort of. Just create a numeric constant on the block diagram, right-click on it to select Properties, in the "Format and Precision" set it to "Hexadecimal, in the "Data Range" set the data type (for your probably U32), and for good measure, in the "Appearance" tab check the box "Show radix". Set the value of this numeric in the block diagram and you now have a constant that you can wire to your other code. If you need this to be a global, save it into a global variable as a control and set its default value to be the value you want, set it to "Make Current Value Default", and save the global variable.
0 Kudos
Message 2 of 3
(2,870 Views)
Hello:

I don't know if I'm missing the point but I think what you're trying to do is to access and write to a specific location in the computer's memory. That cannot be done in LabVIEW the way you're used to do it. You may try doing that using a call to a C function using a Code Interface Node or a Call Library Function Node. LabVIEW, unlike C or C++ doesn't require you to manage the memory, the memory is managed by LabVIEW so you are not totally responsable of allocating and deallocating memory, and also you can't access it freely. You'll miss maybe some of the memory control you can have in C, but you don't have to worry about improper access (with pointers mainly) and memory corruption. You can look at the following URL to know a bit more about memory in LabVIEW

http://zone.ni.com/devzone/conceptd.nsf/webmain/732CEC772AA4FBE586256A37005541D3







Robst - CLD

Using LabVIEW since version 7.0


0 Kudos
Message 3 of 3
(2,860 Views)