> This makes my head hurt. Can anyone explain how it's able to work like this? > Does Labview automatically make a new copy of a variable when you pass a > pointer to it, hence what is coming out of the node is different from the > memory I thought I needed to pass into it? This would be odd but is the only > way I can see that it would be working. >
It works because LV has to protect the constant. If you send PI into a DLL by pointer and the DLL changed the value, then the next time the VI ran, PI would be some new value. This might not matter if it is only used as a buffer for your DLL, but if your DLL cared about the value, or if the wire forked ... So at the moment, LV just treats the pointers like numbers and will hold onto them and move them from buffer to buffer as needed. The number is only a pointer when you later use it that way. So if you can make the mental substitution and treat the number as the result of some mathematical operation, does it make sense to you how the three values are being maintained. Greg McKaskle