This is a tool that provides two things.
1) Memory that can be shared between different Windows applications (shared memory).
2) Global memory for applications (not shared between different Windows applications)
The functionality is provided by a dll whic can be distributed under the terms of the GPL. This instrument driver is a wrapper around that dll.
Attached is a small program test2.exe. It writes the numbers 0..99 to the first 100 bytes of the shared memory. Then it writes the number 17 to the first 10 bytes. Then, every 100ms, it writes a loop index to the first 10bytes.
History: Version 0.0, 8th of April 2004
Copyright (C)
Gesellschaft für Schwerionenforschung, GSI
Planckstr. 1
64291 Darmstadt
Germany
Contact: D.Beck@gsi.de
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 2 of the license, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General License for more details (http://www.gnu.org).
Gesellschaft für Schwerionenforschung, GSI
Planckstr. 1, 64291 Darmstadt, Germany
For all questions and ideas contact: D. Beck, M.Richter@gsi.de or H.Brand@gsi.de.
Last update: 07-APR-2004
Creates a global memory buffer. The name of the memory buffer is an optional feature and limited to 32 characters. If the name is specified, another buffer with the same name must not exist. This function always creates a new buffer. In order to link to an existing buffer one can use the functions GetBuffID, GetBufferName and GetBufferPointer.
Returns the pointer to the global memory or 0, if not successful.
Destroys a global memory buffer.
Returns the ID of the buffer or -1, if not successful.
Copies data from a global memory buffer to a buffer.
Returns the number of bytes copied or 0, if not successful.
Gets the ID of a global memory buffer.
Returns the ID of the buffer or -1, if not successful.
Gets the name of a global memory buffer. The name has a length of up to 32 characters.
Returns the ID of the buffer or -1, if not successful.
Gets the pointer to the global memory buffer.
Returns the pointer to the buffer or 0, if not successful.
Gets the size of a global memory buffer.
Gets the size of the buffer or 0, if not successful.
Initializes a global memory buffer with the specified value.
Returns the size of the global memory buffer in bytes or 0, if not successful.
Copies a buffer into a global memory buffer.
Returns the number of bytes copied or 0, if not successful.
Gets the number of processes that are connected to the dll.
This example demonstrates how to pass data from one thread to another thread via global memory.
Contains all the instrument-specific error codes and descriptions.
In case of an error, this VI adds the error message to the error source.
Optionaly, an error message pops up.
History: 05-APR-2004, Dietrich Beck
Copyright (C)
Gesellschaft für Schwerionenforschung, GSI
Planckstr. 1
64291 Darmstadt
Germany
Contact: D.Beck@gsi.de
This program is free software; you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation; either version 2 of the license, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General License for more details (http://www.gnu.org).
Gesellschaft für Schwerionenforschung, GSI
Planckstr. 1, 64291 Darmstadt, Germany
For all questions and ideas contact: D. Beck, M.Richter@gsi.de or H.Brand@gsi.de.
Last update: 05-APR-2004
Copies data from the shared memory to a buffer.
Returns the number of bytes copied or 0, if not successful.
Copies a buffer into a the shared memory.
Returns the number of bytes copied or 0, if not successful.
Gets the size of the shared memory.
Gets the size of the buffer or 0, if not successful.
Gets the pointer to the shared memory.
Returns the pointer to the buffer or 0, if not successful.
This example demonstrates how to pass data from one thread to another thread via shared memory.
Measures the transfer speed for a read/write cycle of shared memory in Mbytes/s.
Measures the transfer speed for a read/write cycle of global memory in Mbytes/s.
Converts data to an array of unsigned bytes (unsigned char). If desired, this function converts the data from Motorola to Intel format.
Remark: LabVIEW stores data in Motorola format (even on an Intel machine). So if you would like to share data with other applications via memory buffers one should take care of that conversion.
Converts from an array of unsigned bytes (unsigned char) to data. If desired, this function converts the data from Intel to Motorola format.
Remark: LabVIEW stores data in Motorola format (even on an Intel machine). So if you would like to share data with other applications via memory buffers one should take care of that conversion.