usb-6009
This commit is contained in:
159
NI-VISA/Examples/C/Vxi-vme/AsyncIntr.c
Normal file
159
NI-VISA/Examples/C/Vxi-vme/AsyncIntr.c
Normal file
@ -0,0 +1,159 @@
|
||||
/**********************************************************************/
|
||||
/* Asynchronous Interrupt Handling Example */
|
||||
/* */
|
||||
/* This code opens a session to a controller at Logical Address zero */
|
||||
/* This example installs an event handler to receive interrupts or */
|
||||
/* signals. The program can be easily tested by running it and then */
|
||||
/* asserting interrupts using VXI Interactive Control, VIC. */
|
||||
/* VIC can be used to assert an interrupt or generate a signal. */
|
||||
/* Send the StatusId = 0xfd00 for this example. The driver does not */
|
||||
/* pass interrupts generated from National Instruments' controllers */
|
||||
/* with certain StatusId values to the event handler. */
|
||||
/* */
|
||||
/* The general flow of this code is: */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA session to an instrument */
|
||||
/* Enable A Handler For Interrupt Events */
|
||||
/* Wait For An Interrupt Event */
|
||||
/* (Assert An Interrupt From VIC) */
|
||||
/* Continue to Wait For Interrupt Events Until User Ends Program */
|
||||
/* Close the VISA session */
|
||||
/**********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViUInt16 StatusID;
|
||||
static ViSession instr;
|
||||
static ViSession defaultRM;
|
||||
static ViStatus status;
|
||||
static int tempchar;
|
||||
|
||||
ViStatus _VI_FUNCH IntrHandler(ViSession instr, ViEventType etype, ViEvent event, ViAddr userhandle);
|
||||
|
||||
/*
|
||||
* Here we define the function that is called whenever an interrupt event
|
||||
* is received.
|
||||
*/
|
||||
ViStatus _VI_FUNCH IntrHandler(ViSession instr, ViEventType etype, ViEvent event, ViAddr userhandle)
|
||||
{
|
||||
/* etype is a number which identifies the event type that has been received. */
|
||||
viGetAttribute (event, VI_ATTR_SIGP_STATUS_ID, &StatusID);
|
||||
printf("An event was received. The Status/ID value is 0x%x\n",StatusID);
|
||||
|
||||
/* System calls are allowed to be used inside the event handler on
|
||||
all VISA supported platforms other than Macintosh. */
|
||||
return VI_SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* main code.
|
||||
*/
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the manager
|
||||
* handle. We will store this handle in defaultRM.
|
||||
*/
|
||||
status=viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: at this point it would be proper programming procedure to
|
||||
* to call viFindRsrc to find available instruments to which we can
|
||||
* open a session. The viFindRsrc function returns the descriptor
|
||||
* for the first of these instrument. viFindNext can then be used to
|
||||
* get descriptors for the other instruments. These descriptors
|
||||
* are then used to open a session to the desired instrument.
|
||||
* For simplicity, we will assume there is a controller
|
||||
* at Logical Address zero and open a session to this address.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to the device at logical
|
||||
* address zero. We must use the resource manager handle
|
||||
* from viOpenDefaultRM. We must also use a string which will
|
||||
* indicate which instrument to open. This is called the
|
||||
* instrument descriptor. The format for this string can
|
||||
* be found in the NI-VISA User Manual. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The remaining two parameters
|
||||
* in this function are reserved for future functionality.
|
||||
* They are given the values VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "VXI::0::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Can not open a VISA session to VXI0::0::INSTR\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will install the event handler that will monitor interrupt
|
||||
* events. The handler is named IntrHandler. uhandle is a handle
|
||||
* allowing data to be passed to the handler from the application.
|
||||
*/
|
||||
status = viInstallHandler (instr, VI_EVENT_VXI_SIGP, IntrHandler, VI_NULL);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not install the interrupt handler.\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will enable signal processing events so the program can
|
||||
* receive them into its event handler. It will only receive events for
|
||||
* interrupts or signals. See the other interrupt example to see how things
|
||||
* would differ if events were queued.
|
||||
*/
|
||||
status = viEnableEvent (instr, VI_EVENT_VXI_SIGP, VI_HNDLR, VI_NULL);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not enable the interrupt event.\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Under Windows 3.x or the Macintosh, Yield() or PeekMessage() functions
|
||||
* may need to be called to give up processor time so that VISA events
|
||||
* will be invoked. Under WIN32 or UNIX, this is not necessary because
|
||||
* VISA event handlers are spawned in a separate thread.
|
||||
*/
|
||||
printf("Press any key to stop waiting for events.\n");
|
||||
fflush(stdin);
|
||||
tempchar=getchar();
|
||||
|
||||
/*
|
||||
* The VXI Interactive Control program, VIC, can be used to
|
||||
* assert an interrupt or generate a signal. Send the StatusId = 0xFD00
|
||||
* for this example. The driver does not pass interrupts generated from
|
||||
* National Instruments' controllers with certain StatusId values to
|
||||
* to the event handler.
|
||||
*/
|
||||
|
||||
/* Now we will uninstall the handler we installed to handle interrupts
|
||||
* Calling this function will implicitly call viDisableEvent().
|
||||
* Note that unlike viWaitonEvent, the event is closed for us when we
|
||||
* exit the handler. Compare this with the other interrupt example. */
|
||||
status = viUninstallHandler (instr, VI_EVENT_VXI_SIGP, IntrHandler, VI_NULL);
|
||||
|
||||
/* Now we will close the session to the instrument using
|
||||
* viClose. We will tell VISA what to close using the handle, "instr". */
|
||||
viClose (instr);
|
||||
viClose (defaultRM);
|
||||
printf("\nHit Enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Vxi-vme/AsyncIntr_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Vxi-vme/AsyncIntr_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="AsyncIntr" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=AsyncIntr - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "AsyncIntr_MSVC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "AsyncIntr_MSVC.mak" CFG="AsyncIntr - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "AsyncIntr - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "AsyncIntr - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "AsyncIntr - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /machine:I386 /out:"Release/AsyncIntr.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "AsyncIntr - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /debug /machine:I386 /out:"Debug/AsyncIntr.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "AsyncIntr - Win32 Release"
|
||||
# Name "AsyncIntr - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AsyncIntr.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visa.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visatype.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Library Files"
|
||||
|
||||
# PROP Default_Filter "lib"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
501
NI-VISA/Examples/C/Vxi-vme/AsyncIntr_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Vxi-vme/AsyncIntr_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="AsyncIntr"
|
||||
ProjectGUID="{B45A4F23-689C-4756-BCD7-B999BDBB29A5}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="AsyncIntr.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visa.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visatype.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Library Files"
|
||||
Filter="lib"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib_x64\msc\visa64.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
153
NI-VISA/Examples/C/Vxi-vme/HighReg.c
Normal file
153
NI-VISA/Examples/C/Vxi-vme/HighReg.c
Normal file
@ -0,0 +1,153 @@
|
||||
/**************************************************************/
|
||||
/* High Level Register Access Example */
|
||||
/* */
|
||||
/* This example reads and writes the offset register of the */
|
||||
/* device at logical address 0. To do this, the code reads */
|
||||
/* the register at 0xC006 in A16 space, then writes the value*/
|
||||
/* back to the same register. Then it moves the first four */
|
||||
/* configuration registers into local RAM and displays this */
|
||||
/* on the STDIO window. This code uses only VISA functions. */
|
||||
/* */
|
||||
/* The general flow of this code is: */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA session to the instrument at LA 0 */
|
||||
/* Read the offset register */
|
||||
/* Write the same value back to the offset register */
|
||||
/* Move in the first 4 config registers */
|
||||
/* Close VISA session */
|
||||
/**************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr;
|
||||
static ViUInt16 value;
|
||||
static ViBusAddress offset;
|
||||
static ViUInt16 data[4];
|
||||
static ViBusSize count;
|
||||
static ViStatus status;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the manager
|
||||
* handle. We will store this handle in defaultRM.
|
||||
*/
|
||||
status=viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Note: at this point it would be proper programming procedure to
|
||||
* to call viFindRsrc to find available instruments to which we can
|
||||
* open a session. The viFindRsrc function returns the descriptor
|
||||
* for the first of these instrument. viFindNext can then be used to
|
||||
* get descriptors for the other instruments. These descriptors
|
||||
* are then used to open a session to the desired instrument.
|
||||
* For simplicity, we will assume there is a controller
|
||||
* at Logical Address zero and open a session to this address.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to the device at logical
|
||||
* address zero. We must use the resource manager handle
|
||||
* from viOpenDefaultRM. We must also use a string which will
|
||||
* indicate which instrument to open. This is called the
|
||||
* instrument descriptor. The format for this string can
|
||||
* be found in the NI-VISA User Manual. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The remaining two parameters
|
||||
* in this function are reserved for future functionality.
|
||||
* They are given the values VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "VXI0::0::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will read in the offset register and display it
|
||||
* on the screen. We must use the session handle to the
|
||||
* instrument from the viOpen function. We will be reading
|
||||
* 16 bits by using the viIn16 function.
|
||||
*/
|
||||
offset = 0x6; /* offset in A16 space from the base of the device's memory */
|
||||
|
||||
/*
|
||||
* Note that the offset is relative to the base of the device's
|
||||
* memory in that address space. Offset is not the absolute address
|
||||
* of the device.
|
||||
*/
|
||||
status = viIn16 (instr, VI_A16_SPACE, offset, &value);
|
||||
if (status < VI_SUCCESS) /* an error occurred */
|
||||
{
|
||||
printf ("Cannot communicate with device.\n");
|
||||
}
|
||||
else /* read was successful */
|
||||
{
|
||||
printf ("The offset register of the device at LA 0 is 0x%x\n", value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will write out the value just read with the
|
||||
* viOut16 function. We will write this to the offset
|
||||
* register of the device at logical address zero
|
||||
* using the instrument handle returned from viOpen.
|
||||
*/
|
||||
status = viOut16 (instr, VI_A16_SPACE, offset, value);
|
||||
if (status < VI_SUCCESS) /* success */
|
||||
{
|
||||
printf("Cannot write data to registers.\n");
|
||||
}
|
||||
else /* an error occurred */
|
||||
{
|
||||
printf ("0x%x was written correctly to the Offset Register.\n",value);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will move the first 4 configuration registers into local
|
||||
* memory. This will be done using viMoveIn16.
|
||||
*/
|
||||
offset = 0; /* we want to get data from 0xC000-0xC007 */
|
||||
count = 4; /* move 4 16-bit pieces of data */
|
||||
|
||||
status = viMoveIn16 (instr, VI_A16_SPACE, offset, count, data);
|
||||
if (status < VI_SUCCESS) /* error occurred */
|
||||
{
|
||||
printf ("Could not move data.\n");
|
||||
}
|
||||
else /* successful move */
|
||||
{
|
||||
printf ("\nThe first 4 configuration registers are:\n");
|
||||
printf ("Register 0 = 0x%04hX\n", data[0]);
|
||||
printf ("Register 1 = 0x%04hX\n", data[1]);
|
||||
printf ("Register 2 = 0x%04hX\n", data[2]);
|
||||
printf ("Register 3 = 0x%04hX\n", data[3]);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we must close the session to the instrument using
|
||||
* viClose. We must tell VISA what to close by use of the
|
||||
* instrument handle, "instr". We will also close the VISA
|
||||
* Resource Manager.
|
||||
*/
|
||||
|
||||
status = viClose (instr);
|
||||
status = viClose (defaultRM);
|
||||
printf("\nHit Enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Vxi-vme/HighReg_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Vxi-vme/HighReg_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="HighReg" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=HighReg - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "HighReg_MSVC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "HighReg_MSVC.mak" CFG="HighReg - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "HighReg - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "HighReg - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "HighReg - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /machine:I386 /out:"Release/HighReg.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "HighReg - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /debug /machine:I386 /out:"Debug/HighReg.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "HighReg - Win32 Release"
|
||||
# Name "HighReg - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\HighReg.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visa.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visatype.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Library Files"
|
||||
|
||||
# PROP Default_Filter "lib"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
501
NI-VISA/Examples/C/Vxi-vme/HighReg_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Vxi-vme/HighReg_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="HighReg"
|
||||
ProjectGUID="{5287D317-A439-4C06-B49C-1D180B7A257B}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/HighReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/HighReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/HighReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/HighReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/HighReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/HighReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/HighReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/HighReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/HighReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="HighReg.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visa.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visatype.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Library Files"
|
||||
Filter="lib"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib_x64\msc\visa64.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
158
NI-VISA/Examples/C/Vxi-vme/LowReg.c
Normal file
158
NI-VISA/Examples/C/Vxi-vme/LowReg.c
Normal file
@ -0,0 +1,158 @@
|
||||
/**************************************************************/
|
||||
/* Low Level Register Access Example */
|
||||
/* */
|
||||
/* This example uses low level register functions to read the */
|
||||
/* offset register of a VXI device at logical address 0. The */
|
||||
/* program uses the viMapAddress function to map a window */
|
||||
/* to the A16 VXI address space and then uses viPeek to read */
|
||||
/* the value of this register. */
|
||||
/* */
|
||||
/* The general flow of this code is: */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA session to an instrument */
|
||||
/* Map the desired VXI memory to the local processor's memory */
|
||||
/* Use viPeek to read the offset register */
|
||||
/* Unmap the memory */
|
||||
/* Close the VISA session */
|
||||
/**************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
#define ADD_OFFSET(addr, offs) (((ViPByte)addr) + (offs))
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr;
|
||||
static ViUInt16 value, access;
|
||||
static ViBusAddress offset;
|
||||
static ViAddr mapped_address, address;
|
||||
static ViBusSize size;
|
||||
static ViStatus status;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the manager
|
||||
* handle. We will store this handle in defaultRM.
|
||||
*/
|
||||
status=viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: at this point it would be proper programming procedure to
|
||||
* to call viFindRsrc to find available instruments to which we can
|
||||
* open a session. The viFindRsrc function returns the descriptor
|
||||
* for the first of these instrument. viFindNext can then be used to
|
||||
* get descriptors for the other instruments. These descriptors
|
||||
* are then used to open a session to the desired instrument.
|
||||
* For simplicity, we will assume there is a controller
|
||||
* at Logical Address zero and open a session to this address.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to the device at logical
|
||||
* address zero. We must use the resource manager handle
|
||||
* from viOpenDefaultRM. We must also use a string which will
|
||||
* indicate which instrument to open. This is called the
|
||||
* instrument descriptor. The format for this string can
|
||||
* be found in the NI-VISA User Manual. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The remaining two parameters
|
||||
* in this function are reserved for future functionality.
|
||||
* They are given the values VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "VXI0::0::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Now we will map a window to the A16 space containing the
|
||||
* configuration registers of the device using the viMapAddress
|
||||
* function. This function will use the session to the
|
||||
* device we obtained using viOpen.
|
||||
*/
|
||||
offset = 0x0; /* read Offset register in A16 */
|
||||
size = 0x40; /* we will map to all configuration registers */
|
||||
status = viMapAddress (instr, VI_A16_SPACE, offset, size, VI_FALSE, VI_NULL,&mapped_address);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Error mapping the address to local memory\n");
|
||||
printf ("Make sure you have a User Window configured in VXIedit\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will use the viPeek16 function to read the value
|
||||
* of the Offset register for the device at LA 0 which we have
|
||||
* mapped to the A16 space. We will do this using the pointer
|
||||
* returned from the viMapAddress function. The viPeek function
|
||||
* basically just dereferences a pointer to the VXI address space.
|
||||
* The Offset register is at offset 0x6, so we need to increment
|
||||
* the mapped address.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Now that we have mapped the window, we can use the pointer
|
||||
* to read and write to registers. We could do this by directly
|
||||
* dereferencing the pointer, or by using viPeekXX/viPokeXX. On
|
||||
* some O/S's you will not be able to directly dereference the pointer,
|
||||
* so your code is more portable if you use viPeekXX/viPokeXX. To
|
||||
* find out if you can directly dereference the pointer, you can get
|
||||
* a VISA Attribute. In the following code, we check to see if we
|
||||
* can dereference the pointer. If that is permitted we will read
|
||||
* the Offset register by a direct dereference, otherwise we call
|
||||
* viPeek16. After this we call viPeek again.
|
||||
*/
|
||||
|
||||
/* Now we will use a macro to manipulate the pointer. This */
|
||||
/* macro will add the correct value to the pointer to make */
|
||||
/* it point to the Offset register. */
|
||||
address = ADD_OFFSET (mapped_address, 6);
|
||||
|
||||
viGetAttribute (instr, VI_ATTR_WIN_ACCESS, &access);
|
||||
if (access == VI_DEREF_ADDR) /* can dereference the pointer directly */
|
||||
{
|
||||
printf ("Direct Pointer Dereference was used to read the Offset Register.\n");
|
||||
value = *(ViPUInt16)address;
|
||||
}
|
||||
else /* must use viPeek16 */
|
||||
{
|
||||
printf ("viPeek16 was used to read the Offset Register.\n");
|
||||
viPeek16 (instr, address, &value);
|
||||
}
|
||||
|
||||
printf("The value read from the Offset register is 0x%hX\n", value);
|
||||
|
||||
/* Now do viPeek16 again in case you could dereference the pointer in the first access. */
|
||||
viPeek16 (instr, address, &value);
|
||||
printf ("The value read from the Offset Register using viPeek16 was 0x%hx", value);
|
||||
|
||||
/*
|
||||
* Now we need to unmap the User Window for completeness of
|
||||
* code.
|
||||
*/
|
||||
status = viUnmapAddress (instr);
|
||||
|
||||
/*
|
||||
* Finally, we need to close all the VISA sessions that we
|
||||
* opened
|
||||
*/
|
||||
viClose (instr);
|
||||
viClose (defaultRM);
|
||||
printf("\nHit Enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Vxi-vme/LowReg_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Vxi-vme/LowReg_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="LowReg" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=LowReg - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "LowReg_MSVC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "LowReg_MSVC.mak" CFG="LowReg - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "LowReg - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "LowReg - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "LowReg - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /machine:I386 /out:"Release/LowReg.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "LowReg - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /debug /machine:I386 /out:"Debug/LowReg.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "LowReg - Win32 Release"
|
||||
# Name "LowReg - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\LowReg.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visa.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visatype.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Library Files"
|
||||
|
||||
# PROP Default_Filter "lib"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
501
NI-VISA/Examples/C/Vxi-vme/LowReg_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Vxi-vme/LowReg_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="LowReg"
|
||||
ProjectGUID="{4851B238-5BD8-407F-A9C4-B7460E42BCE3}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/LowReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/LowReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/LowReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/LowReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/LowReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/LowReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/LowReg.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/LowReg.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/LowReg_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="LowReg.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visa.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visatype.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Library Files"
|
||||
Filter="lib"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib_x64\msc\visa64.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
260
NI-VISA/Examples/C/Vxi-vme/ShareSys.c
Normal file
260
NI-VISA/Examples/C/Vxi-vme/ShareSys.c
Normal file
@ -0,0 +1,260 @@
|
||||
/**************************************************************/
|
||||
/* How to Share System Memory Example */
|
||||
/* */
|
||||
/* This example demonstrates how to share memory from */
|
||||
/* a National Instruments controller to the VXI backplane. */
|
||||
/* */
|
||||
/* Before proceeding, familiarize yourself with application */
|
||||
/* note 018, Use of Local Shared RAM on NI-VXI Interfaces, */
|
||||
/* from National Instrument's web or ftp site or */
|
||||
/* faxback system. */
|
||||
/* */
|
||||
/* You will need to make some configuration changes in */
|
||||
/* VXIEdit or VXItedit or T&M Explorer. Note that these */
|
||||
/* descriptions apply to MITE based controllers. */
|
||||
/* Please refer to the documentation that came with your */
|
||||
/* controller to determine how to configure shared memory */
|
||||
/* from system memory. */
|
||||
/* */
|
||||
/* The following steps must be carried out before memory can */
|
||||
/* be shared. If using VXIEdit or VXItedit, start below. */
|
||||
/* Is using the T&M Explorer, skip down to that section */
|
||||
/* */
|
||||
/* VXIEdit/VXItedit settings: */
|
||||
/* 1. In the logical address configuration page for the */
|
||||
/* controller set the Address Space parameter to A16/A24 */
|
||||
/* or A16/A32 (preferred) depending on which space you want */
|
||||
/* to use to share memory. The A16/A32 allows you to share */
|
||||
/* all system RAM. */
|
||||
/* */
|
||||
/* 2. Set the VXI Shared RAM Size. parameter to program the */
|
||||
/* VXI interface registers to map cycles from the */
|
||||
/* VXI/VMEbus to the computer memory. It is recommended */
|
||||
/* that you set this to All System RAM. A16/A24 does not */
|
||||
/* usually allow you to select All System RAM */
|
||||
/* */
|
||||
/* 3. Set the Shared RAM Pool to the amount of RAM that you */
|
||||
/* actually need plus 1kB. The Shared RAM Pool indicates */
|
||||
/* the amount of physically contiguous memory that is */
|
||||
/* allocated on system startup. This reserved memory can */
|
||||
/* be shared to the VXI/VMEbus by the VISA MemAlloc call. */
|
||||
/* Remember that the OS will be denied access to this */
|
||||
/* memory, so take into account the memory requirements of */
|
||||
/* your OS and your applications with regard to the amount */
|
||||
/* of RAM in your system before setting this option. */
|
||||
/* If VISA MemAlloc fails, it may be because your system */
|
||||
/* could not provide for sufficient reserved memory for */
|
||||
/* the Shared RAM Pool. */
|
||||
/* If this happens, simply make the Shared RAM Pool */
|
||||
/* smaller until VISA MemAlloc returns successfully. */
|
||||
/* */
|
||||
/* T&M Explorer settings: */
|
||||
/* 1. Select the VXI controller, i.e. PCI-MXI-2. Right click */
|
||||
/* on the selection and choose Hardware Configuration. */
|
||||
/* Select the Shared Memory tab. Note that you can get */
|
||||
/* help on each step by right clicking on each setting. */
|
||||
/* */
|
||||
/* 2. Select Share RAM in A24 Space or Select Share RAM in */
|
||||
/* A32 Space (preferred). */
|
||||
/* */
|
||||
/* 3. Next set the VXI Shared RAM Size parameter to program */
|
||||
/* the VXI interface registers to map cycles from the */
|
||||
/* VXI/VMEbus to the computer memory. */
|
||||
/* It is recommended to set this to All System RAM */
|
||||
/* (usually not available if you have Share RAM in A24 */
|
||||
/* selected above). */
|
||||
/* */
|
||||
/* 4. Set the Reserve Physical Memory to the amount of RAM */
|
||||
/* that you actually need plus 1kB. The Reserve Physical */
|
||||
/* Memory indicates the amount of physically contiguous */
|
||||
/* memory that is allocated on system startup. This */
|
||||
/* reserved memory can be shared to the VXI/VMEbus by */
|
||||
/* the VISA MemAlloc call. */
|
||||
/* Remember that the OS will be denied access to this */
|
||||
/* memory, so take into account the memory requirements of */
|
||||
/* your OS and your applications with regard to the amount */
|
||||
/* of RAM in your system before setting this option. */
|
||||
/* If VISA MemAlloc fails, it may be because your system */
|
||||
/* could not provide for sufficient reserved memory for the */
|
||||
/* Reserve Physical Memory. */
|
||||
/* If this happens, simply make the Reserve Physical Memory */
|
||||
/* smaller until VISA MemAlloc returns successfully. */
|
||||
/* */
|
||||
/* Now, you are ready to run this example. Keep in mind, */
|
||||
/* that if VISA MemAlloc fails, request less memory in the */
|
||||
/* Shared RAM Pool or Reserve Physical Memory settings. */
|
||||
/* Obviously, the Size parameter passed into VISA MemAlloc */
|
||||
/* must be made correspondingly smaller. */
|
||||
/* */
|
||||
/* The general flow of this code is: */
|
||||
/* Open Resource Manager */
|
||||
/* Open a session to LA 0 */
|
||||
/* Allocate the shared memory */
|
||||
/* Use viGetAttribute to determine the offset of the shared */
|
||||
/* memory. */
|
||||
/* Use viOut16 to write a value into shared memory */
|
||||
/* Use viIn16 to read the value to see if the data was */
|
||||
/* written correctly. */
|
||||
/* Use viMemFree to free the shared memory buffer. */
|
||||
/* Close VISA sessions */
|
||||
/**************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession instr, defaultRM;
|
||||
static ViAddr local_address;
|
||||
static ViBusAddress offset;
|
||||
static ViBusSize size;
|
||||
static ViUInt16 addrspace, value;
|
||||
static int base;
|
||||
static ViStatus status;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the manager
|
||||
* handle. We will store this handle in defaultRM.
|
||||
*/
|
||||
status=viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: at this point it would be proper programming procedure to
|
||||
* to call viFindRsrc to find available instruments to which we can
|
||||
* open a session. The viFindRsrc function returns the descriptor
|
||||
* for the first of these instrument. viFindNext can then be used to
|
||||
* get descriptors for the other instruments. These descriptors
|
||||
* are then used to open a session to the desired instrument.
|
||||
* For simplicity, we will assume there is a controller
|
||||
* at Logical Address zero and open a session to this address.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to the device at logical
|
||||
* address zero. We must use the resource manager handle
|
||||
* from viOpenDefaultRM. We must also use a string which will
|
||||
* indicate which instrument to open. This is called the
|
||||
* instrument descriptor. The format for this string can
|
||||
* be found in the NI-VISA User Manual. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The remaining two parameters
|
||||
* in this function are reserved for future functionality.
|
||||
* They are given the values VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "VXI0::0::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Now we will allocate the first 100 bytes of shared
|
||||
* memory by the device at LA 0 using the viMemAlloc function.
|
||||
* This function is only valid on sessions to the local controller.
|
||||
* This function will return a pointer to local memory and
|
||||
* we will store this in the variable "offset."
|
||||
*/
|
||||
|
||||
/* This is how much memory we are going to set aside
|
||||
* in our local RAM. Even though we have possibly many
|
||||
* megs requested in VXI space, we are only going to
|
||||
* use 0x100 bytes. This value is arbitrary for this example.
|
||||
*/
|
||||
size = 0x100;
|
||||
status = viMemAlloc (instr, size, &offset);
|
||||
if (status < VI_SUCCESS) /* an error occurred */
|
||||
{
|
||||
printf("Failed to successfully allocate system RAM.\n");
|
||||
viClose (defaultRM);
|
||||
printf("\nPress any key to exit...");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* We will determine in which address space the shared memory is located. */
|
||||
viGetAttribute (instr, VI_ATTR_MEM_SPACE, &addrspace);
|
||||
|
||||
/* We will also find the base address of our controller so another */
|
||||
/* bus master can access our shared memory. */
|
||||
viGetAttribute (instr, VI_ATTR_MEM_BASE, &base);
|
||||
|
||||
/*
|
||||
* Now we will try to do a cycle of high level In's and Out's
|
||||
* to show how the shared memory can be accessed.
|
||||
*/
|
||||
|
||||
/* Now let's write a value into this memory. */
|
||||
status = viOut16 (instr, addrspace, offset, 0xBEEF);
|
||||
if (status < VI_SUCCESS)
|
||||
printf ("Could not write into the shared memory.\n");
|
||||
|
||||
|
||||
/* At this point, you can use another bus master to access
|
||||
* the shared memory at the Base + Offset.
|
||||
* You may notice that you will not be able to self-access
|
||||
* this memory from another application such as VIC or VISAIC.
|
||||
* The hardware is not capable of allowing self-accesses.
|
||||
* But the viIn16 and viOut16 in this example works because
|
||||
* VISA keeps track of the actual memory buffer that is allocated
|
||||
* and allows direct access to the memory.
|
||||
* This allows viIn16 and viOut16 to work without accessing the VXI/VME bus.
|
||||
*/
|
||||
printf("The shared memory is located at absolute address 0x%08lX",base + offset);
|
||||
switch (addrspace)
|
||||
{
|
||||
case VI_A16_SPACE:
|
||||
printf(" in A16 address space.\n\n");
|
||||
break;
|
||||
case VI_A24_SPACE:
|
||||
printf(" in A24 address space.\n\n");
|
||||
break;
|
||||
case VI_A32_SPACE:
|
||||
printf(" in A32 address space.\n\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* Now let's read back from this location and see if it is */
|
||||
/* the correct value. */
|
||||
status = viIn16 (instr, addrspace, offset, &value);
|
||||
if (status < VI_SUCCESS)
|
||||
printf ("Could not read from shared memory.\n");
|
||||
else if (value == 0xBEEF)
|
||||
printf ("Value written = value read; sharing is successful!\n");
|
||||
else
|
||||
printf ("We wrote 0xBEEF, but read back 0x%04hX\n", value);
|
||||
|
||||
/*
|
||||
* At this point we have to clean up after ourselves by freeing
|
||||
* the shared memory.
|
||||
* This will be done using the viMemFree function.
|
||||
*/
|
||||
status = viMemFree (instr, offset); /* free the allocated memory */
|
||||
if (status < VI_SUCCESS)
|
||||
printf("An error occurred in freeing the local memory.\n");
|
||||
|
||||
/*
|
||||
* Now we will close the session to the instrument using
|
||||
* viClose. We will tell VISA what to close using the
|
||||
* instrument handle "instr"
|
||||
*/
|
||||
|
||||
status = viClose (instr);
|
||||
status = viClose (defaultRM);
|
||||
printf("\nHit Enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Vxi-vme/ShareSys_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Vxi-vme/ShareSys_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="ShareSys" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=ShareSys - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ShareSys_MSVC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "ShareSys_MSVC.mak" CFG="ShareSys - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "ShareSys - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "ShareSys - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "ShareSys - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /machine:I386 /out:"Release/ShareSys.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "ShareSys - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /debug /machine:I386 /out:"Debug/ShareSys.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "ShareSys - Win32 Release"
|
||||
# Name "ShareSys - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\ShareSys.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visa.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visatype.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Library Files"
|
||||
|
||||
# PROP Default_Filter "lib"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
501
NI-VISA/Examples/C/Vxi-vme/ShareSys_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Vxi-vme/ShareSys_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="ShareSys"
|
||||
ProjectGUID="{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ShareSys.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/ShareSys.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ShareSys.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/ShareSys.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ShareSys.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/ShareSys.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ShareSys.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/ShareSys.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/ShareSys_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="ShareSys.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visa.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visatype.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Library Files"
|
||||
Filter="lib"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib_x64\msc\visa64.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
144
NI-VISA/Examples/C/Vxi-vme/WaitIntr.c
Normal file
144
NI-VISA/Examples/C/Vxi-vme/WaitIntr.c
Normal file
@ -0,0 +1,144 @@
|
||||
/**********************************************************************/
|
||||
/* Synchronous Interrupt Events Example */
|
||||
/* */
|
||||
/* This example is written using VISA. */
|
||||
/* This code opens a session to a controller at Logical Address zero */
|
||||
/* Then configures an event queue to receive interrupts. */
|
||||
/* The program can be exercised by running it and then asserting an */
|
||||
/* interrupt with VIC, the VXI Interactive Control program. */
|
||||
/* */
|
||||
/* The general flow of this code is: */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA session to an instrument */
|
||||
/* Enable Signal Processing Events To Be Queued */
|
||||
/* Wait For An Interrupt Event */
|
||||
/* [Assert an Interrupt from VIC - AssertVXIint( 0, 1, 0xFD00 )] */
|
||||
/* Check The Status ID Of The Interrupt Event */
|
||||
/* Close the VISA session */
|
||||
/**********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr;
|
||||
static ViUInt32 WaitTimeout;
|
||||
static ViEvent event;
|
||||
static ViEventType etype;
|
||||
static ViUInt16 intrID;
|
||||
static ViStatus status;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the manager
|
||||
* handle. We will store this handle in defaultRM.
|
||||
*/
|
||||
status=viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: at this point it would be proper programming procedure to
|
||||
* to call viFindRsrc to find available instruments to which we can
|
||||
* open a session. The viFindRsrc function returns the descriptor
|
||||
* for the first of these instrument. viFindNext can then be used to
|
||||
* get descriptors for the other instruments. These descriptors
|
||||
* are then used to open a session to the desired instrument.
|
||||
* For simplicity, we will assume there is a controller
|
||||
* at Logical Address zero and open a session to this address.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to the device at logical
|
||||
* address zero. We must use the resource manager handle
|
||||
* from viOpenDefaultRM. We must also use a string which will
|
||||
* indicate which instrument to open. This is called the
|
||||
* instrument descriptor. The format for this string can
|
||||
* be found in the NI-VISA User Manual. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The remaining two parameters
|
||||
* in this function are reserved for future functionality.
|
||||
* They are given the values VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "VXI::0::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will enable signal processing events so the program can
|
||||
* receive them into the event queue. We will use the queuing method
|
||||
* instead of setting up a handler. See the other interrupt example to
|
||||
* see how things would differ if a handler was set up. The default
|
||||
* queue size is 50. This can be changed with the viSetAttribute
|
||||
* function but it must be done before calling viEnableEvent().
|
||||
*/
|
||||
printf("Waiting for an event...\n");
|
||||
status = viEnableEvent (instr, VI_EVENT_VXI_SIGP, VI_QUEUE, VI_NULL);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error enabling events.\n");
|
||||
viClose (instr);
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Next we must use the viWaitOnEvent function to check the queue
|
||||
* for a signal processing event. This function can be given a timeout
|
||||
* after which it will return if no event has been received. The
|
||||
* timeout can be set to VI_TMO_IMMEDIATE to just pull the oldest event
|
||||
* off the queue. To test this example an interrupt can be asserted
|
||||
* using VIC, the VXI Interactive Control program.
|
||||
* Call AssertVXIint with these arguments: AssertVXIint( 0, 1, 0xFD00 )
|
||||
* to use the default controller to assert an interrupt on level 1 with a
|
||||
* StatusID of 0xFD00. Note that most VXI interrupters will place its
|
||||
* logical address in the lower byte of the StatusID.
|
||||
*/
|
||||
printf("Waiting for an interrupt. Use VIC to assert an interrupt with\n ");
|
||||
printf("these parameters: AssertVXIint( 0, 1, 0xFD00 )\n");
|
||||
|
||||
WaitTimeout = 8000; /* Wait 8 seconds for an event */
|
||||
status = viWaitOnEvent (instr, VI_EVENT_VXI_SIGP, WaitTimeout, &etype, &event);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("No event was received in the designated period.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Now we will use the event handle returned by viWaitOnEvent to
|
||||
* check the Status ID attribute. Only interrupts from LA 0
|
||||
* will be seen because it was set up in a session to LA 0.
|
||||
*/
|
||||
status = viGetAttribute (event, VI_ATTR_SIGP_STATUS_ID, &intrID);
|
||||
printf ("The Status/ID was 0x%hX\n", intrID);
|
||||
|
||||
/*
|
||||
* Now we will close the session for the event using viClose.
|
||||
*/
|
||||
status = viClose (event);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will close the session to the instrument.
|
||||
*/
|
||||
|
||||
status = viClose (instr);
|
||||
status = viClose (defaultRM);
|
||||
printf ("\nHit Enter to continue.");
|
||||
fflush (stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Vxi-vme/WaitIntr_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Vxi-vme/WaitIntr_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="WaitIntr" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=WaitIntr - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "WaitIntr_MSVC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "WaitIntr_MSVC.mak" CFG="WaitIntr - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "WaitIntr - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "WaitIntr - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "WaitIntr - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /machine:I386 /out:"Release/WaitIntr.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "WaitIntr - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /debug /machine:I386 /out:"Debug/WaitIntr.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "WaitIntr - Win32 Release"
|
||||
# Name "WaitIntr - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\WaitIntr.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visa.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visatype.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Library Files"
|
||||
|
||||
# PROP Default_Filter "lib"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
501
NI-VISA/Examples/C/Vxi-vme/WaitIntr_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Vxi-vme/WaitIntr_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="WaitIntr"
|
||||
ProjectGUID="{11155569-0F34-48BB-A2CB-5325486864EB}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitIntr.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitIntr.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitIntr_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="WaitIntr.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visa.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visatype.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Library Files"
|
||||
Filter="lib"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib_x64\msc\visa64.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
158
NI-VISA/Examples/C/Vxi-vme/WaitTrig.c
Normal file
158
NI-VISA/Examples/C/Vxi-vme/WaitTrig.c
Normal file
@ -0,0 +1,158 @@
|
||||
/**********************************************************************/
|
||||
/* Synchronous Trigger Events Example */
|
||||
/* */
|
||||
/* This code opens a session to a device at Logical Address two. */
|
||||
/* The programs sets up an event queue to receive triggers on TTL */
|
||||
/* Trigger line three. The program can be tested easily by */
|
||||
/* running the program and then asserting a trigger in VIC, the VXI */
|
||||
/* Interactive Control program. The program is written using VISA. */
|
||||
/* */
|
||||
/* The general flow of this code is: */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA session to an instrument */
|
||||
/* Enable a particular trigger line using the Trigger Attribute */
|
||||
/* Enable Trigger Events To Be Queued */
|
||||
/* Wait For A Trigger Event */
|
||||
/* [Source TTL Trigger line 3 using VIC - SrcTrig( -1, 3, 4, 1000 );]*/
|
||||
/* Check The ID Of Received Trigger Event To See If It Was Line 3 */
|
||||
/* Close The Event */
|
||||
/* Close the VISA session */
|
||||
/**********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr;
|
||||
static ViUInt32 WaitTimeout;
|
||||
static ViInt16 trig_line;
|
||||
static ViEvent event;
|
||||
static ViEventType type;
|
||||
static ViStatus status;
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the manager
|
||||
* handle. We will store this handle in defaultRM.
|
||||
*/
|
||||
status=viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: at this point it would be proper programming procedure to
|
||||
* to call viFindRsrc to find available instruments to which we can
|
||||
* open a session. The viFindRsrc function returns the descriptor
|
||||
* for the first of these instrument. viFindNext can then be used to
|
||||
* get descriptors for the other instruments. These descriptors
|
||||
* are then used to open a session to the desired instrument.
|
||||
* For simplicity, we will assume there is a controller
|
||||
* at Logical Address zero and open a session to this address.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to the device at logical
|
||||
* address two. We must use the resource manager handle
|
||||
* from viOpenDefaultRM. We must also use a string which will
|
||||
* indicate which instrument to open. This is called the
|
||||
* instrument descriptor. The format for this string can
|
||||
* be found in the NI-VISA User Manual. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The remaining two parameters
|
||||
* in this function are reserved for future functionality.
|
||||
* They are given the values VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "VXI::2::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will set the VI_ATTR_TRIG_ID. This ID determines which trigger
|
||||
* lines will generate events in a particular session. By default,
|
||||
* it is set to software triggers. This attribute can only be changed
|
||||
* before trigger events are enabled. After they are enabled it is a
|
||||
* read-only attribute. We will set the ID to look for TTL triggers
|
||||
* on line 3.
|
||||
*/
|
||||
status = viSetAttribute (instr, VI_ATTR_TRIG_ID, VI_TRIG_TTL3);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Error setting the TTL trigger level to monitor\n");
|
||||
viClose (instr);
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will enable trigger events so this example can receive them
|
||||
* into its event queue. It will only receive events for triggers on
|
||||
* TTL line 3. We will use the queuing method instead of
|
||||
* setting up a handler. Refer to the interrupt handler example to see how
|
||||
* things would differ if a handler was set up. The default queue size
|
||||
* is 50. This can be changed with the viSetAttribute function but it
|
||||
* must be done before calling viEnableEvent().
|
||||
*/
|
||||
status = viEnableEvent (instr, VI_EVENT_TRIG, VI_QUEUE, VI_NULL);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error enabling the trigger events\n");
|
||||
viClose (instr);
|
||||
viClose (defaultRM);
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*
|
||||
* Next we will use the viWaitOnEvent function to check the queue
|
||||
* for a trigger event. This function can be given a timeout after
|
||||
* which it will return if an event has not been received. The
|
||||
* timeout can be set to VI_TMO_IMMEDIATE to just pull the oldest
|
||||
* event off the queue. To test this example, a trigger can be sourced
|
||||
* on TTL line three using VIC, the VXI Interactive Control program.
|
||||
* Call SrcTrig with these arguments: SrcTrig( -1, 3, 4, 1000 ) to
|
||||
* generate a Sync trigger pulse on TTL line 3 with a 1000msec timeout.
|
||||
*/
|
||||
printf ("Waiting for a trigger event...\n");
|
||||
|
||||
WaitTimeout = 8000; /* Wait 8 seconds for an event */
|
||||
status = viWaitOnEvent (instr, VI_EVENT_TRIG, WaitTimeout, &type, &event);
|
||||
if (status < VI_SUCCESS)
|
||||
{ /* error (possibly timeout?) */
|
||||
printf ("An error occurred waiting for the trigger.\n");
|
||||
printf ("No event was received.\n");
|
||||
viClose (defaultRM);
|
||||
printf("\nHit Enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
else /* successfully received an event */
|
||||
{
|
||||
printf ("The trigger was successfully received.\n");
|
||||
/* Always call viClose on the event whenever viWaitOnEvent is successful. */
|
||||
status = viClose (event);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will close the event context, the session to the instrument, and the
|
||||
* resource manager session, all using viClose.
|
||||
*/
|
||||
status = viClose (instr);
|
||||
status = viClose (defaultRM);
|
||||
|
||||
printf("\nHit Enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Vxi-vme/WaitTrig_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Vxi-vme/WaitTrig_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="WaitTrig" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=WaitTrig - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "WaitTrig_MSVC.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "WaitTrig_MSVC.mak" CFG="WaitTrig - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "WaitTrig - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "WaitTrig - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "WaitTrig - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /machine:I386 /out:"Release/WaitTrig.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "WaitTrig - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "$(VXIPNPPATH)\WinNT\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib advapi32.lib shell32.lib /nologo /subsystem:console /map /debug /machine:I386 /out:"Debug/WaitTrig.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "WaitTrig - Win32 Release"
|
||||
# Name "WaitTrig - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\WaitTrig.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visa.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\include\visatype.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Library Files"
|
||||
|
||||
# PROP Default_Filter "lib"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
501
NI-VISA/Examples/C/Vxi-vme/WaitTrig_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Vxi-vme/WaitTrig_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="WaitTrig"
|
||||
ProjectGUID="{D397112D-1904-4BB2-AEA7-994095BF4A43}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitTrig.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitTrig.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="1"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitTrig.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
TypeLibraryName="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="$(VXIPNPPATH)\WinNT\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
PrecompiledHeaderFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.pch"
|
||||
AssemblerListingLocation="$(PlatformName)\$(ConfigurationName)/"
|
||||
ObjectFile="$(PlatformName)\$(ConfigurationName)/"
|
||||
ProgramDataBaseFileName="$(PlatformName)\$(ConfigurationName)/"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitTrig.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitTrig.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitTrig_MSVC.bsc"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="WaitTrig.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visa.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\include\visatype.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Library Files"
|
||||
Filter="lib"
|
||||
>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|x64"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="$(VXIPNPPATH)\WinNT\lib_x64\msc\visa64.lib"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
ExcludedFromBuild="true"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
Reference in New Issue
Block a user