LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

passing array pointers between programs

Using LabWindows/CVI version 8.1
I have created two programs running on one PC that communicate by using localHost and UDP/IP
In the first program I assign and fill two arrays.
The second program asks for pointers to the arrays.
The second program receives pointers that agree between the two programs.
The second program tries to read the array at the pointer but gets a General Protection Fault.

Is there a way for the second program to access the data from the first program by reference without passing the data to the second program?
There is quite a bit of data.

Thanks,
archieb
0 Kudos
Message 1 of 3
(3,123 Views)
Do they have to be separate programs?
If not, you can combine them into a single program where each functionality is performed by a separate thread.
Then you can use thread-safe queues or thread-safe arrays to pass data between two operations.
S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 3
(3,112 Views)
You can do this, but it is a bit tricky if you are not familiar with Windows SDK programming. There is a CVI example which illustrates the principles of File Mapping techniques (where a kernel memory region/virtual file can be mapped for access by multiple programs) at C:\Program Files\National Instruments\CVI70\samples\sdk\sharemem. It should point you in the right direction.
 
JR
0 Kudos
Message 3 of 3
(3,107 Views)