This commit is contained in:
2024-11-01 11:47:29 -07:00
commit ebbc16ee6a
128 changed files with 23645 additions and 0 deletions

View File

@ -0,0 +1,78 @@
/**************************************************************
* This example opens a session to a PXI BACKPLANE resource and
* reserves trigger lines for an identified PXI system.
* The PXI BACKPLANE resource will follow the format:
* PXI0::?::BACKPLANE
* where ? is the number of your PXI chassis in MAX.
*
* Note that the unreserve call only executes if the reservation
* was successfully made. You must use caution when unreserving
* triggers as you could remove automatic reservations made by
* drivers such as DAQmx which could result in hardware damage.
*
* For more information on PXI Timing and Triggering, please see
* KB 3TCCT2D8 at ni.com/support
***************************************************************/
/* Includes */
#define NIVISA_PXI /* to include PXI VISA Attributes */
#include <visa.h>
/* Prototypes */
int ReserveTrigger (int myTrigger, int myBusSegment);
/* Definitions */
int main (void)
{
ViStatus status;
status = ReserveTrigger (0, 1);
return status;
}
int ReserveTrigger (int myTrigger, int myBusSegment)
{
ViSession RsrcManager;
ViSession vi;
ViStatus status = VI_SUCCESS;
/* Open VISA Resource Manager and PXI Backplane Resource */
status = viOpenDefaultRM (&RsrcManager);
if (status < VI_SUCCESS)
goto ReserveDone;
status = viOpen (RsrcManager, "PXI0::2::BACKPLANE", 0, 0, &vi);
if (status < VI_SUCCESS)
goto CloseRMSession;
/* Set the Trigger ID and the Trigger Bus Attributes */
status = viSetAttribute (vi, VI_ATTR_TRIG_ID, myTrigger);
if (status < VI_SUCCESS)
goto CloseBackplaneSession;
status = viSetAttribute (vi, VI_ATTR_PXI_TRIG_BUS, myBusSegment);
if (status < VI_SUCCESS)
goto CloseBackplaneSession;
/* Reserve the Trigger */
status = viAssertTrigger (vi, VI_TRIG_PROT_RESERVE);
if (status < VI_SUCCESS)
goto CloseBackplaneSession;
/* TODO: Enter code that requires the trigger reserved here */
/* UnReserve the Trigger - only do this if we succeeded in Reserving */
status = viAssertTrigger (vi, VI_TRIG_PROT_UNRESERVE);
CloseBackplaneSession:
/* Close the VISA Session to the PXI Backplane */
viClose (vi);
CloseRMSession:
viClose (RsrcManager);
ReserveDone:
return (status);
}

View File

@ -0,0 +1,115 @@
# Microsoft Developer Studio Project File - Name="ReserveTrig" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=ReserveTrig - 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 "ReserveTrig_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 "ReserveTrig_MSVC.mak" CFG="ReserveTrig - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ReserveTrig - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "ReserveTrig - 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)" == "ReserveTrig - 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/ReserveTrig.exe"
!ELSEIF "$(CFG)" == "ReserveTrig - 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/ReserveTrig.exe" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "ReserveTrig - Win32 Release"
# Name "ReserveTrig - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\ReserveTrig.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

View File

@ -0,0 +1,501 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="ReserveTrig"
ProjectGUID="{10767517-D9FC-4241-9DD9-805ECA12A584}"
>
<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)/ReserveTrig_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)/ReserveTrig_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)/ReserveTrig.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/ReserveTrig.map"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig_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)/ReserveTrig_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)/ReserveTrig_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)/ReserveTrig.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/ReserveTrig.map"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig_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)/ReserveTrig_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)/ReserveTrig_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)/ReserveTrig.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/ReserveTrig.map"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig_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)/ReserveTrig_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)/ReserveTrig_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)/ReserveTrig.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/ReserveTrig.map"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/ReserveTrig_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="ReserveTrig.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>

View File

@ -0,0 +1,80 @@
/**************************************************************
* This example opens a session to a PXI BACKPLANE resource and
* routes trigger lines for an identified PXI system.
* The PXI BACKPLANE resource will follow the format:
* PXI0::?::BACKPLANE
* where ? is the number of your PXI chassis in MAX.
*
* Note that this program routes triggers from a source bus
* to a destination bus but does not reserve a trigger line
* in the source bus. This could allow multiple boards to drive
* a single trigger line which could damage your hardware.
* See the "Reserve PXI Trigger" example for a method of reserving
* the source trigger so automatic drivers such as DAQmx avoid
* using the same line.
*
* For more information on PXI Timing and Triggering, please see
* KB 3TCCT2D8 at ni.com/support
***************************************************************/
/* Includes */
#define NIVISA_PXI /* to include PXI VISA Attributes */
#include <visa.h>
/* Prototypes */
int RouteTrigger (ViInt16 myTrigger, int mySourceSegment, int myDestinationSegment);
/* Definitions */
int main (void)
{
ViStatus status;
status = RouteTrigger (0, 1, 3);
return status;
}
int RouteTrigger (ViInt16 myTrigger, int mySourceSegment, int myDestinationSegment)
{
ViSession RsrcManager;
ViSession vi;
ViStatus status = VI_SUCCESS;
/* Open VISA Resource Manager and PXI Backplane Resource */
status = viOpenDefaultRM (&RsrcManager);
if (status < VI_SUCCESS)
goto RouteDone;
status = viOpen (RsrcManager, "PXI0::2::BACKPLANE", 0, 0, &vi);
if (status < VI_SUCCESS)
goto CloseRMSession;
/* Set the Source and Destination bus PXI VISA Attributes */
status = viSetAttribute (vi, VI_ATTR_PXI_SRC_TRIG_BUS, mySourceSegment);
if (status < VI_SUCCESS)
goto CloseBackplaneSession;
status = viSetAttribute (vi, VI_ATTR_PXI_DEST_TRIG_BUS,myDestinationSegment);
if (status < VI_SUCCESS)
goto CloseBackplaneSession;
/* Route the trigger */
status = viMapTrigger (vi, myTrigger, myTrigger, VI_NULL);
if (status < VI_SUCCESS)
goto CloseBackplaneSession;
/* TODO: Enter code that requires the trigger routed here */
/* UnRoute the trigger - only do this if we succeeded in Routing */
status = viUnmapTrigger (vi, myTrigger, myTrigger);
CloseBackplaneSession:
/* Close your VISA Sessions */
status = viClose (vi);
CloseRMSession:
status = viClose (RsrcManager);
RouteDone:
return (status);
}

View File

@ -0,0 +1,115 @@
# Microsoft Developer Studio Project File - Name="RouteTrig" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=RouteTrig - 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 "RouteTrig_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 "RouteTrig_MSVC.mak" CFG="RouteTrig - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "RouteTrig - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "RouteTrig - 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)" == "RouteTrig - 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/RouteTrig.exe"
!ELSEIF "$(CFG)" == "RouteTrig - 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/RouteTrig.exe" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
!ENDIF
# Begin Target
# Name "RouteTrig - Win32 Release"
# Name "RouteTrig - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\RouteTrig.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

View File

@ -0,0 +1,501 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="RouteTrig"
ProjectGUID="{C00818A7-D55D-48BE-9E32-09389E1DD4EB}"
>
<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)/RouteTrig_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)/RouteTrig_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)/RouteTrig.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RouteTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/RouteTrig.map"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/RouteTrig_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)/RouteTrig_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)/RouteTrig_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)/RouteTrig.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RouteTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/RouteTrig.map"
SubSystem="1"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/RouteTrig_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)/RouteTrig_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)/RouteTrig_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)/RouteTrig.exe"
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RouteTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/RouteTrig.map"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/RouteTrig_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)/RouteTrig_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)/RouteTrig_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)/RouteTrig.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RouteTrig.pdb"
GenerateMapFile="true"
MapFileName="$(PlatformName)\$(ConfigurationName)/RouteTrig.map"
SubSystem="1"
TargetMachine="17"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
SuppressStartupBanner="true"
OutputFile="$(PlatformName)\$(ConfigurationName)/RouteTrig_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="RouteTrig.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>