usb-6009
This commit is contained in:
243
NI-VISA/Examples/C/Examples_MSVC.dsw
Normal file
243
NI-VISA/Examples/C/Examples_MSVC.dsw
Normal file
@ -0,0 +1,243 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "AsyncIO"=.\GPIB\AsyncIO_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "AsyncIntr"=".\VXI-VME\AsyncIntr_MSVC.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "AsyncSRQ"=.\GPIB\AsyncSRQ_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "FindRsrc"=.\General\FindRsrc_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "HighReg"=".\VXI-VME\HighReg_MSVC.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "Locking"=.\General\Locking_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "LowReg"=".\VXI-VME\LowReg_MSVC.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "RdWrt"=.\General\RdWrt_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "RdWrtSrl"=.\Serial\RdWrtSrl_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ReserveTrig"=.\PXI\ReserveTrig_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "RouteTrig"=.\PXI\RouteTrig_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "ShareSys"=".\VXI-VME\ShareSys_MSVC.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "TCPIP"=.\TCPIP\TCPIP_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "WaitIntr"=".\VXI-VME\WaitIntr_MSVC.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "WaitSRQ"=.\GPIB\WaitSRQ_MSVC.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "WaitTrig"=".\VXI-VME\WaitTrig_MSVC.dsp" - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
240
NI-VISA/Examples/C/Examples_MSVC_VS2005.sln
Normal file
240
NI-VISA/Examples/C/Examples_MSVC_VS2005.sln
Normal file
@ -0,0 +1,240 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 9.00
|
||||
# Visual Studio 2005
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsyncIO", "Gpib\AsyncIO_MSVC_VS2005.vcproj", "{0DF1F546-0EB8-426B-AE08-3247ACC1F355}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsyncIntr", "Vxi-vme\AsyncIntr_MSVC_VS2005.vcproj", "{B45A4F23-689C-4756-BCD7-B999BDBB29A5}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AsyncSRQ", "Gpib\AsyncSRQ_MSVC_VS2005.vcproj", "{FB2EAF25-2003-4295-A24B-2869DDF335D8}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FindRsrc", "General\FindRsrc_MSVC_VS2005.vcproj", "{93BA1AE2-1344-4B95-993F-16314E4E1832}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "HighReg", "Vxi-vme\HighReg_MSVC_VS2005.vcproj", "{5287D317-A439-4C06-B49C-1D180B7A257B}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Locking", "General\Locking_MSVC_VS2005.vcproj", "{6B2088ED-A867-4708-9067-92E75E092EB5}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LowReg", "Vxi-vme\LowReg_MSVC_VS2005.vcproj", "{4851B238-5BD8-407F-A9C4-B7460E42BCE3}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RdWrt", "General\RdWrt_MSVC_VS2005.vcproj", "{2FA33368-82C2-49B8-AC94-460A34C719C1}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RdWrtSrl", "Serial\RdWrtSrl_MSVC_VS2005.vcproj", "{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ReserveTrig", "PXI\ReserveTrig_MSVC_VS2005.vcproj", "{10767517-D9FC-4241-9DD9-805ECA12A584}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RouteTrig", "PXI\RouteTrig_MSVC_VS2005.vcproj", "{C00818A7-D55D-48BE-9E32-09389E1DD4EB}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShareSys", "Vxi-vme\ShareSys_MSVC_VS2005.vcproj", "{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TCPIP", "TCPIP\TCPIP_MSVC_VS2005.vcproj", "{02C1C19C-5E65-420B-959C-145A0264F934}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WaitIntr", "Vxi-vme\WaitIntr_MSVC_VS2005.vcproj", "{11155569-0F34-48BB-A2CB-5325486864EB}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WaitSRQ", "Gpib\WaitSRQ_MSVC_VS2005.vcproj", "{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WaitTrig", "Vxi-vme\WaitTrig_MSVC_VS2005.vcproj", "{D397112D-1904-4BB2-AEA7-994095BF4A43}"
|
||||
ProjectSection(WebsiteProperties) = preProject
|
||||
Debug.AspNetCompiler.Debug = "True"
|
||||
Release.AspNetCompiler.Debug = "False"
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Debug|x64.Build.0 = Debug|x64
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Release|Win32.Build.0 = Release|Win32
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Release|x64.ActiveCfg = Release|x64
|
||||
{0DF1F546-0EB8-426B-AE08-3247ACC1F355}.Release|x64.Build.0 = Release|x64
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Debug|x64.Build.0 = Debug|x64
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Release|Win32.Build.0 = Release|Win32
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Release|x64.ActiveCfg = Release|x64
|
||||
{B45A4F23-689C-4756-BCD7-B999BDBB29A5}.Release|x64.Build.0 = Release|x64
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Debug|x64.Build.0 = Debug|x64
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Release|Win32.Build.0 = Release|Win32
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Release|x64.ActiveCfg = Release|x64
|
||||
{FB2EAF25-2003-4295-A24B-2869DDF335D8}.Release|x64.Build.0 = Release|x64
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Debug|x64.Build.0 = Debug|x64
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Release|Win32.Build.0 = Release|Win32
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Release|x64.ActiveCfg = Release|x64
|
||||
{93BA1AE2-1344-4B95-993F-16314E4E1832}.Release|x64.Build.0 = Release|x64
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Debug|x64.Build.0 = Debug|x64
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Release|Win32.Build.0 = Release|Win32
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Release|x64.ActiveCfg = Release|x64
|
||||
{5287D317-A439-4C06-B49C-1D180B7A257B}.Release|x64.Build.0 = Release|x64
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Debug|x64.Build.0 = Debug|x64
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Release|Win32.Build.0 = Release|Win32
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Release|x64.ActiveCfg = Release|x64
|
||||
{6B2088ED-A867-4708-9067-92E75E092EB5}.Release|x64.Build.0 = Release|x64
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Debug|x64.Build.0 = Debug|x64
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Release|Win32.Build.0 = Release|Win32
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Release|x64.ActiveCfg = Release|x64
|
||||
{4851B238-5BD8-407F-A9C4-B7460E42BCE3}.Release|x64.Build.0 = Release|x64
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Debug|x64.Build.0 = Debug|x64
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Release|Win32.Build.0 = Release|Win32
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Release|x64.ActiveCfg = Release|x64
|
||||
{2FA33368-82C2-49B8-AC94-460A34C719C1}.Release|x64.Build.0 = Release|x64
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Debug|x64.Build.0 = Debug|x64
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Release|Win32.Build.0 = Release|Win32
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Release|x64.ActiveCfg = Release|x64
|
||||
{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}.Release|x64.Build.0 = Release|x64
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Debug|x64.Build.0 = Debug|x64
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Release|Win32.Build.0 = Release|Win32
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Release|x64.ActiveCfg = Release|x64
|
||||
{10767517-D9FC-4241-9DD9-805ECA12A584}.Release|x64.Build.0 = Release|x64
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Debug|x64.Build.0 = Debug|x64
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Release|Win32.Build.0 = Release|Win32
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Release|x64.ActiveCfg = Release|x64
|
||||
{C00818A7-D55D-48BE-9E32-09389E1DD4EB}.Release|x64.Build.0 = Release|x64
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Debug|x64.Build.0 = Debug|x64
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Release|Win32.Build.0 = Release|Win32
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Release|x64.ActiveCfg = Release|x64
|
||||
{E44BBCCF-7F0A-4969-988C-196A2B3EAA98}.Release|x64.Build.0 = Release|x64
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Debug|x64.Build.0 = Debug|x64
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Release|Win32.Build.0 = Release|Win32
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Release|x64.ActiveCfg = Release|x64
|
||||
{02C1C19C-5E65-420B-959C-145A0264F934}.Release|x64.Build.0 = Release|x64
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Debug|x64.Build.0 = Debug|x64
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Release|Win32.Build.0 = Release|Win32
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Release|x64.ActiveCfg = Release|x64
|
||||
{11155569-0F34-48BB-A2CB-5325486864EB}.Release|x64.Build.0 = Release|x64
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Debug|x64.Build.0 = Debug|x64
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Release|Win32.Build.0 = Release|Win32
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Release|x64.ActiveCfg = Release|x64
|
||||
{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}.Release|x64.Build.0 = Release|x64
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Debug|x64.Build.0 = Debug|x64
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Release|Win32.Build.0 = Release|Win32
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Release|x64.ActiveCfg = Release|x64
|
||||
{D397112D-1904-4BB2-AEA7-994095BF4A43}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
120
NI-VISA/Examples/C/General/FindRsrc.c
Normal file
120
NI-VISA/Examples/C/General/FindRsrc.c
Normal file
@ -0,0 +1,120 @@
|
||||
/*********************************************************************/
|
||||
/* This example demonstrates how you might query your system for */
|
||||
/* a particular instrument. This example queries for all */
|
||||
/* GPIB, serial or VXI instruments. Notice that VISA is able to */
|
||||
/* find GPIB and VXI instruments because the instruments have a */
|
||||
/* predefined protocol. But serial instruments do not. Hence, */
|
||||
/* VISA merely indicates that a serial port is available. */
|
||||
/* */
|
||||
/* The general flow of the code is */
|
||||
/* Open Resource Manager */
|
||||
/* Use viFindRsrc() to query for the first available instrument */
|
||||
/* Open a session to this device */
|
||||
/* Find the next instrument using viFindNext() */
|
||||
/* Open a session to this device. */
|
||||
/* Loop on finding the next instrument until all have been found*/
|
||||
/* Close all VISA Sessions */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static char instrDescriptor[VI_FIND_BUFLEN];
|
||||
static ViUInt32 numInstrs;
|
||||
static ViFindList findList;
|
||||
static ViSession defaultRM, instr;
|
||||
static ViStatus status;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* First we will need to open the default resource manager. */
|
||||
status = viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Find all the VISA resources in our system and store the number of resources
|
||||
* in the system in numInstrs. Notice the different query descriptions a
|
||||
* that are available.
|
||||
|
||||
Interface Expression
|
||||
--------------------------------------
|
||||
GPIB "GPIB[0-9]*::?*INSTR"
|
||||
VXI "VXI?*INSTR"
|
||||
GPIB-VXI "GPIB-VXI?*INSTR"
|
||||
Any VXI "?*VXI[0-9]*::?*INSTR"
|
||||
Serial "ASRL[0-9]*::?*INSTR"
|
||||
PXI "PXI?*INSTR"
|
||||
All instruments "?*INSTR"
|
||||
All resources "?*"
|
||||
*/
|
||||
status = viFindRsrc (defaultRM, "?*INSTR", &findList, &numInstrs, instrDescriptor);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred while finding resources.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
viClose (defaultRM);
|
||||
return status;
|
||||
}
|
||||
|
||||
printf("%d instruments, serial ports, and other resources found:\n\n",numInstrs);
|
||||
printf("%s \n",instrDescriptor);
|
||||
|
||||
/* Now we will open a session to the instrument we just found. */
|
||||
status = viOpen (defaultRM, instrDescriptor, VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred opening a session to %s\n",instrDescriptor);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now close the session we just opened. */
|
||||
/* In actuality, we would probably use an attribute to determine */
|
||||
/* if this is the instrument we are looking for. */
|
||||
viClose (instr);
|
||||
}
|
||||
|
||||
while (--numInstrs)
|
||||
{
|
||||
/* stay in this loop until we find all instruments */
|
||||
status = viFindNext (findList, instrDescriptor); /* find next desriptor */
|
||||
if (status < VI_SUCCESS)
|
||||
{ /* did we find the next resource? */
|
||||
printf ("An error occurred finding the next resource.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
viClose (defaultRM);
|
||||
return status;
|
||||
}
|
||||
printf("%s \n",instrDescriptor);
|
||||
|
||||
/* Now we will open a session to the instrument we just found */
|
||||
status = viOpen (defaultRM, instrDescriptor, VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred opening a session to %s\n",instrDescriptor);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Now close the session we just opened. */
|
||||
/* In actuality, we would probably use an attribute to determine */
|
||||
/* if this is the instrument we are looking for. */
|
||||
viClose (instr);
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
status = viClose(findList);
|
||||
status = viClose (defaultRM);
|
||||
printf ("\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
115
NI-VISA/Examples/C/General/FindRsrc_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/General/FindRsrc_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="FindRsrc" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=FindRsrc - 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 "FindRsrc_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 "FindRsrc_MSVC.mak" CFG="FindRsrc - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "FindRsrc - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "FindRsrc - 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)" == "FindRsrc - 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/FindRsrc.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "FindRsrc - 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/FindRsrc.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "FindRsrc - Win32 Release"
|
||||
# Name "FindRsrc - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\FindRsrc.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/General/FindRsrc_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/General/FindRsrc_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="FindRsrc"
|
||||
ProjectGUID="{93BA1AE2-1344-4B95-993F-16314E4E1832}"
|
||||
>
|
||||
<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)/FindRsrc_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)/FindRsrc_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)/FindRsrc.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/FindRsrc.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/FindRsrc.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/FindRsrc_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)/FindRsrc_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)/FindRsrc_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)/FindRsrc.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/FindRsrc.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/FindRsrc.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/FindRsrc_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)/FindRsrc_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)/FindRsrc_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)/FindRsrc.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/FindRsrc.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/FindRsrc.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/FindRsrc_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)/FindRsrc_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)/FindRsrc_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)/FindRsrc.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/FindRsrc.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/FindRsrc.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/FindRsrc_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="FindRsrc.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>
|
211
NI-VISA/Examples/C/General/Locking.c
Normal file
211
NI-VISA/Examples/C/General/Locking.c
Normal file
@ -0,0 +1,211 @@
|
||||
/********************************************************************/
|
||||
/* This example demonstrates VISA locking */
|
||||
/* */
|
||||
/* In VISA, applications can open multiple sessions to the same */
|
||||
/* resource simultaneously and access that resource through these */
|
||||
/* different sessions concurrently. */
|
||||
/* In some cases, an application may need to restrict other */
|
||||
/* sessions from accessing that resource. */
|
||||
/* For example, an application may need to execute a write and a */
|
||||
/* read operation as an atomic operation so that no other */
|
||||
/* operations intervene between the write and read operations. */
|
||||
/* If another application or even this same application were to */
|
||||
/* perform another write between this first write and read, then it */
|
||||
/* could put the instrument in an unstable state. */
|
||||
/* This is where locking becomes convenient. The application can */
|
||||
/* lock the resource before invoking the write operation and unlock */
|
||||
/* it after the read operation, to execute them as a single step. */
|
||||
/* This prevents other applications from accessing the resource */
|
||||
/* and prevents possible contention. VISA defines locking */
|
||||
/* to restrict accesses to resources for such special circumstances.*/
|
||||
/* */
|
||||
/* The VISA locking mechanism enforces arbitration of accesses to */
|
||||
/* resources on an individual basis. If a session locks a resource, */
|
||||
/* operations invoked by other sessions are returned with an error. */
|
||||
/* */
|
||||
/* This VI opens two sessions to an instrument and locks the first */
|
||||
/* session. The first session then writes the String to Write to */
|
||||
/* the instrument and reads a response of the desired length. */
|
||||
/* */
|
||||
/* The second session tries to do the same task but will not */
|
||||
/* succeed unless the first session is unlocked. */
|
||||
/* */
|
||||
/* The general flow of the code is */
|
||||
/* Open Resource Manager */
|
||||
/* Open 2 VISA sessions to an instrument */
|
||||
/* Lock the first session */
|
||||
/* Read and write to that instrument using the first session */
|
||||
/* Unlock the first session */
|
||||
/* Now read and write to the instrument with the second session*/
|
||||
/* Close the VISA Sessions */
|
||||
/********************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
/* Functions like strcpy are technically not secure because they do */
|
||||
/* not contain a 'length'. But we disable this warning for the VISA */
|
||||
/* examples since we never copy more than the actual buffer size. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr1, instr2;
|
||||
static ViUInt32 retCount;
|
||||
static ViUInt32 writeCount;
|
||||
static ViStatus status;
|
||||
static unsigned char buffer[100];
|
||||
static int cchar;
|
||||
static char stringinput[512];
|
||||
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the resource 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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will open a session to a GPIB instrument at address 2.
|
||||
* We must use the handle from viOpenDefaultRM and we must
|
||||
* also use a string that indicates which instrument to open. This
|
||||
* is called the instrument descriptor. The format for this string
|
||||
* can be found in the function panel by right clicking on the
|
||||
* description parameter. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later Visa functions. The two parameters in this
|
||||
* function which are reserved for future functionality.
|
||||
* These two parameters are given the value VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "GPIB0::2::INSTR", VI_NULL, VI_NULL, &instr1);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will open another session to a GPIB instrument at address 2.
|
||||
*/
|
||||
status = viOpen (defaultRM, "GPIB0::2::INSTR", VI_NULL, VI_NULL, &instr2);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a second session to the device.\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will lock the first session to the resource using the
|
||||
* viLock function. Notice that the locking command takes a parameter
|
||||
* which can be set to VI_EXCLUSIVE_LOCK or VI_SHARED_LOCK. The exclusive
|
||||
* lock will only let that session access the device until the
|
||||
* lock is released. The shared locking option uses the last two parameters
|
||||
* which are set to VI_NULL for the exclusive lock. The first of these
|
||||
* is a requested access key for the shared lock. The last parameter is
|
||||
* a return value with the actual key assigned to the lock. If the shared
|
||||
* lock is used the return actual key value can be used by another session
|
||||
* for the actual key parameter to gain access to the locked resource.
|
||||
* Please refer to the NI-VISA User Manual for more information.
|
||||
*/
|
||||
status = viLock (instr1, VI_EXCLUSIVE_LOCK, VI_TMO_IMMEDIATE, VI_NULL, VI_NULL);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error locking the session");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Now we will write the string "*IDN?\n" to the device and read back the
|
||||
* Response from the session that obtained a lock on the resource
|
||||
*/
|
||||
strcpy(stringinput,"*IDN?\n");
|
||||
status = viWrite (instr1, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error writing to the device\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will attempt to read back a response from the device to
|
||||
* the identification query that was sent. We will use the viRead
|
||||
* function to acquire the data. We will try to read back 100 bytes.
|
||||
* After the data has been read the response is displayed.
|
||||
*/
|
||||
status = viRead (instr1, buffer, 100, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error reading a response from the device\n");
|
||||
goto Close;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\nData read: %*s\n",retCount,buffer);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will ask the user if they want to unlock the resource.
|
||||
* Then we will try the same operations with the second session. If the
|
||||
* resource is not unlocked these operations will fail as would any attempts
|
||||
* to modify global attributes by the second session.
|
||||
*/
|
||||
printf("Do you wish to unlock the resource so the second session can also access it(y/n)?\n");
|
||||
cchar = getchar ();
|
||||
if (cchar == 'y' || cchar == 'Y')
|
||||
{
|
||||
status = viUnlock (instr1);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error unlocking the resource\n");
|
||||
goto Close;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will attempt the same read and write sequence we attempted with the first
|
||||
* session. If the lock was not removed this will fail
|
||||
*/
|
||||
status = viWrite (instr2, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount);
|
||||
if (status == VI_ERROR_RSRC_LOCKED)
|
||||
{
|
||||
printf("The resource is locked you can't write to it!\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will attempt to read back a response from the device to
|
||||
* the identification query that was sent. We will use the viRead
|
||||
* function to acquire the data. We will try to read back 100 bytes.
|
||||
* After the data has been read the response is displayed.
|
||||
*/
|
||||
status = viRead (instr2, buffer, 100, &retCount);
|
||||
if (status == VI_ERROR_RSRC_LOCKED)
|
||||
{
|
||||
printf("The resource is still locked you can't read from it!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("\nData read: %*s\n",retCount,buffer);
|
||||
}
|
||||
|
||||
Close:
|
||||
status = viClose(instr1);
|
||||
status = viClose(instr2);
|
||||
status = viClose(defaultRM);
|
||||
printf("Finished closing sessions.\nHit enter to continue.\n");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
115
NI-VISA/Examples/C/General/Locking_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/General/Locking_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="Locking" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=Locking - 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 "Locking_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 "Locking_MSVC.mak" CFG="Locking - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Locking - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "Locking - 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)" == "Locking - 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/Locking.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "Locking - 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/Locking.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Locking - Win32 Release"
|
||||
# Name "Locking - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Locking.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/General/Locking_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/General/Locking_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="Locking"
|
||||
ProjectGUID="{6B2088ED-A867-4708-9067-92E75E092EB5}"
|
||||
>
|
||||
<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)/Locking_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)/Locking_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)/Locking.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/Locking.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/Locking.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/Locking_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)/Locking_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)/Locking_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)/Locking.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/Locking.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/Locking.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/Locking_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)/Locking_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)/Locking_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)/Locking.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/Locking.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/Locking.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/Locking_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)/Locking_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)/Locking_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)/Locking.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/Locking.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/Locking.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/Locking_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="Locking.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>
|
136
NI-VISA/Examples/C/General/RdWrt.c
Normal file
136
NI-VISA/Examples/C/General/RdWrt.c
Normal file
@ -0,0 +1,136 @@
|
||||
/********************************************************************/
|
||||
/* Read and Write to an Instrument Example */
|
||||
/* */
|
||||
/* This code demonstrates synchronous read and write commands to a */
|
||||
/* GPIB, serial or message-based VXI instrument using VISA. */
|
||||
/* */
|
||||
/* The general flow of the code is */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA Session to an Instrument */
|
||||
/* Write the Identification Query Using viWrite */
|
||||
/* Try to Read a Response With viRead */
|
||||
/* Close the VISA Session */
|
||||
/********************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
/* Functions like strcpy are technically not secure because they do */
|
||||
/* not contain a 'length'. But we disable this warning for the VISA */
|
||||
/* examples since we never copy more than the actual buffer size. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr;
|
||||
static ViStatus status;
|
||||
static ViUInt32 retCount;
|
||||
static ViUInt32 writeCount;
|
||||
static unsigned char buffer[100];
|
||||
static char stringinput[512];
|
||||
|
||||
/*
|
||||
* In every source code or header file that you use it is necessary to prototype
|
||||
* your VISA variables at the beginning of the file. You need to declare the VISA
|
||||
* session, VISA integers, VISA strings, VISA pointers, and VISA floating variables.
|
||||
* Remember that if you are prototyping variables that are to be used as part of the
|
||||
* VISA session that need this prototyping. As an example, above retCount has been
|
||||
* prototyped as a static variable to this particular module. It is an integer of
|
||||
* bit length 32. If you are uncertain how to declare your VISA prototypes refer
|
||||
* to the VISA help under the Section titled Type Assignments Table. The VISA
|
||||
* help is located in your NI-VISA directory or folder.
|
||||
*/
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/*
|
||||
* First we must call viOpenDefaultRM to get the resource 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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to a device at Primary Address 2.
|
||||
* You can use any address for your instrument. In this example we are
|
||||
* using GPIB Primary Address 2.
|
||||
*
|
||||
* We must use the handle from viOpenDefaultRM and we must
|
||||
* also use a string that indicates 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 two parameters in this function which are left blank are
|
||||
* reserved for future functionality. These two parameters are
|
||||
* given the value VI_NULL.
|
||||
*
|
||||
* This example will also work for serial or VXI instruments by changing
|
||||
* the instrument descriptor from GPIB0::2::INSTR to ASRL1::INSTR or
|
||||
* VXI0::2::INSTR depending on the necessary descriptor for your
|
||||
* instrument.
|
||||
*/
|
||||
status = viOpen (defaultRM, "GPIB0::2::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set timeout value to 5000 milliseconds (5 seconds).
|
||||
*/
|
||||
status = viSetAttribute (instr, VI_ATTR_TMO_VALUE, 5000);
|
||||
|
||||
/*
|
||||
* At this point we now have a session open to the instrument at
|
||||
* Primary Address 2. We can use this session handle to write
|
||||
* an ASCII command to the instrument. We will use the viWrite function
|
||||
* to send the string "*IDN?", asking for the device's identification.
|
||||
*/
|
||||
strcpy(stringinput,"*IDN?");
|
||||
status = viWrite (instr, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error writing to the device\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will attempt to read back a response from the device to
|
||||
* the identification query that was sent. We will use the viRead
|
||||
* function to acquire the data. We will try to read back 100 bytes.
|
||||
* After the data has been read the response is displayed.
|
||||
*/
|
||||
status = viRead (instr, buffer, 100, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error reading a response from the device\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Data read: %*s\n",retCount,buffer);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Now we will close the session to the instrument using
|
||||
* viClose. This operation frees all system resources.
|
||||
*/
|
||||
Close:
|
||||
printf("Closing Sessions\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
status = viClose(instr);
|
||||
status = viClose(defaultRM);
|
||||
|
||||
return 0;
|
||||
}
|
115
NI-VISA/Examples/C/General/RdWrt_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/General/RdWrt_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="RdWrt" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=RdWrt - 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 "RdWrt_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 "RdWrt_MSVC.mak" CFG="RdWrt - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "RdWrt - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "RdWrt - 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)" == "RdWrt - 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/RdWrt.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "RdWrt - 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/RdWrt.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "RdWrt - Win32 Release"
|
||||
# Name "RdWrt - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RdWrt.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/General/RdWrt_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/General/RdWrt_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="RdWrt"
|
||||
ProjectGUID="{2FA33368-82C2-49B8-AC94-460A34C719C1}"
|
||||
>
|
||||
<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)/RdWrt_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)/RdWrt_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)/RdWrt.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrt.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrt.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrt_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)/RdWrt_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)/RdWrt_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)/RdWrt.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrt.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrt.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrt_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)/RdWrt_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)/RdWrt_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)/RdWrt.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrt.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrt.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrt_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)/RdWrt_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)/RdWrt_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)/RdWrt.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrt.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrt.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrt_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="RdWrt.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>
|
177
NI-VISA/Examples/C/Gpib/AsyncIO.c
Normal file
177
NI-VISA/Examples/C/Gpib/AsyncIO.c
Normal file
@ -0,0 +1,177 @@
|
||||
/**************************************************************************/
|
||||
/* Asynchronous I/O Completion Example */
|
||||
/* */
|
||||
/* This example shows how to use an asynchronous event handling function */
|
||||
/* that is called when an asynchronous input/output operation completes. */
|
||||
/* Compare this to viRead and viWrite which block the application until */
|
||||
/* either the call returns successfully or a timeout occurs. Read and */
|
||||
/* write operations can be quite slow sometimes, so these asynchronous */
|
||||
/* operations will allow you processor to perform other tasks. */
|
||||
/* The code uses VISA functions and sets a flag in the callback upon */
|
||||
/* completion of an asynchronous read from a GPIB device to break out of */
|
||||
/* an otherwise infinite loop. The flow of the code is as follows: */
|
||||
/* */
|
||||
/* Open A Session To The VISA Resource Manager */
|
||||
/* Open A Session To A GPIB Device */
|
||||
/* Install A Handler For Asynchronous IO Completion Events */
|
||||
/* Enable Asynchronous IO Completion Events */
|
||||
/* Write A Command To The Instrument */
|
||||
/* Call The Asynchronous Read Command */
|
||||
/* Start A Loop That Can Only Be Broken By A Handler Flag Or Timeout */
|
||||
/* Print Out The Returned Data */
|
||||
/* Close The Instrument Session */
|
||||
/* Close The Resource Manager Session */
|
||||
/**************************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
/* Functions like strcpy are technically not secure because they do */
|
||||
/* not contain a 'length'. But we disable this warning for the VISA */
|
||||
/* examples since we never copy more than the actual buffer size. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
/* Prototype for the event handler for asynchronous i/o completion */
|
||||
ViStatus _VI_FUNCH AsyncHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr userHandle);
|
||||
|
||||
#define READ_BUFFER_SIZE 4096
|
||||
|
||||
static ViJobId job;
|
||||
static unsigned char data[READ_BUFFER_SIZE];
|
||||
static ViAddr uhandle;
|
||||
static ViStatus status, StatusSession;
|
||||
static ViSession inst, Sessionparam;
|
||||
static ViEventType EventTypeparam;
|
||||
static ViAddr Addressparam;
|
||||
static ViUInt32 BytesToWrite;
|
||||
static ViSession defaultRM;
|
||||
static ViUInt32 rcount, RdCount;
|
||||
static volatile ViBoolean stopflag = VI_FALSE;
|
||||
static int letter;
|
||||
static char stringinput[256];
|
||||
|
||||
/*
|
||||
* The handler function. The instrument session, the type of event, and a
|
||||
* handle to the event are passed to the function along with a user handle
|
||||
* which is basically a label that could be used to reference the handler.
|
||||
* The only thing done in the handler is to set a flag that allows the
|
||||
* program to finish. Always return VI_SUCCESS from your handler.
|
||||
*/
|
||||
ViStatus _VI_FUNCH AsyncHandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr userHandle)
|
||||
{
|
||||
Sessionparam = vi;
|
||||
EventTypeparam = etype;
|
||||
Addressparam = userHandle;
|
||||
viGetAttribute (event, VI_ATTR_STATUS, &StatusSession);
|
||||
viGetAttribute (event, VI_ATTR_RET_COUNT, &RdCount);
|
||||
stopflag = VI_TRUE;
|
||||
return VI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int main (void)
|
||||
{
|
||||
/*
|
||||
* First we open a session to the VISA resource manager. We are
|
||||
* returned a handle to the resource manager session that we must
|
||||
* use to open sessions to specific instruments.
|
||||
*/
|
||||
status = viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Next we use the resource manager handle to open a session to a
|
||||
* GPIB instrument at device 2. A handle to this session is
|
||||
* returned in the handle inst. Please consult the NI-VISA User Manual
|
||||
* for the syntax for using other instruments.
|
||||
*/
|
||||
status = viOpen (defaultRM, "GPIB::2::INSTR", VI_NULL, VI_NULL, &inst);
|
||||
|
||||
/*
|
||||
* Now we install the handler for asynchronous i/o completion events.
|
||||
* To install the handler, we must pass our instrument session, the type of
|
||||
* event to handle, the handler function name and a user handle
|
||||
* which acts as a handle to the handler function.
|
||||
*/
|
||||
status = viInstallHandler (inst, VI_EVENT_IO_COMPLETION, AsyncHandler, uhandle);
|
||||
|
||||
/* Now we must actually enable the I/O completion event so that our
|
||||
* handler will see the events. Note, one of the parameters is
|
||||
* VI_HNDLR indicating that we want the events to be handled by
|
||||
* an asynchronous event handler. The alternate mechanism for handling
|
||||
* events is to queue them and read events off of the queue when
|
||||
* you want to check them in your program.
|
||||
*/
|
||||
status = viEnableEvent (inst, VI_EVENT_IO_COMPLETION, VI_HNDLR, VI_NULL);
|
||||
|
||||
/*
|
||||
* Now the VISA write command is used to send a request to the
|
||||
* instrument to generate a sine wave. This demonstrates the
|
||||
* synchronous read operation that blocks the application until viRead()
|
||||
* returns. Note that the command syntax is instrument specific.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Here you specify which string you wish to send to your instrument.
|
||||
* The command listed below is device specific. You may have to change
|
||||
* command to accommodate your instrument.
|
||||
*/
|
||||
strcpy(stringinput,"SOUR:FUNC SIN; SENS: DATA?\n");
|
||||
BytesToWrite = (ViUInt32)strlen(stringinput);
|
||||
status = viWrite (inst, (ViBuf)stringinput,BytesToWrite, &rcount);
|
||||
|
||||
/*
|
||||
* Next the asynchronous read command is called to read back the
|
||||
* date from the instrument. Immediately after this is called
|
||||
* the program goes into a loop which will terminate
|
||||
* on an i/o completion event triggering the asynchronous callback.
|
||||
* Note that the asynchronous read command returns a job id that is
|
||||
* a handle to the asynchronous command. We can use this handle
|
||||
* to terminate the read if too much time has passed.
|
||||
*/
|
||||
status = viReadAsync (inst, data, READ_BUFFER_SIZE - 1, &job);
|
||||
|
||||
printf("\n\nHit enter to continue.");
|
||||
letter = getchar();
|
||||
|
||||
/*
|
||||
* If the asynchronous callback was called and the flag was set
|
||||
* we print out the returned data otherwise we terminate the
|
||||
* asynchronous job.
|
||||
*/
|
||||
if (stopflag == VI_TRUE)
|
||||
{
|
||||
/* RdCount was set in the callback */
|
||||
/* Add a NULL terminator to the read buffer */
|
||||
data[RdCount] = '\0';
|
||||
printf ("Here is the data: %s", data);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = viTerminate (inst, VI_NULL, job);
|
||||
printf("The asynchronous read did not complete.\n");
|
||||
}
|
||||
|
||||
printf ("\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
/*
|
||||
* Now we close the instrument session and the resource manager
|
||||
* session to free up resources.
|
||||
*/
|
||||
status = viClose(inst);
|
||||
status = viClose(defaultRM);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Gpib/AsyncIO_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Gpib/AsyncIO_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="AsyncIO" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=AsyncIO - 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 "AsyncIO_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 "AsyncIO_MSVC.mak" CFG="AsyncIO - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "AsyncIO - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "AsyncIO - 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)" == "AsyncIO - 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/AsyncIO.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "AsyncIO - 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/AsyncIO.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "AsyncIO - Win32 Release"
|
||||
# Name "AsyncIO - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AsyncIO.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/Gpib/AsyncIO_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Gpib/AsyncIO_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="AsyncIO"
|
||||
ProjectGUID="{0DF1F546-0EB8-426B-AE08-3247ACC1F355}"
|
||||
>
|
||||
<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)/AsyncIO_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)/AsyncIO_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)/AsyncIO.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIO.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIO.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIO_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)/AsyncIO_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)/AsyncIO_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)/AsyncIO.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIO.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIO.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIO_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)/AsyncIO_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)/AsyncIO_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)/AsyncIO.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIO.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIO.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIO_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)/AsyncIO_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)/AsyncIO_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)/AsyncIO.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncIO.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncIO.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncIO_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="AsyncIO.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>
|
202
NI-VISA/Examples/C/Gpib/AsyncSRQ.c
Normal file
202
NI-VISA/Examples/C/Gpib/AsyncSRQ.c
Normal file
@ -0,0 +1,202 @@
|
||||
/**************************************************************************/
|
||||
/* Asynchronous SRQ Event Handling Example */
|
||||
/* */
|
||||
/* This example shows how to use an asynchronous event handling function */
|
||||
/* that is called when a service request (SRQ) is issued. */
|
||||
/* This code uses VISA functions and sets a flag in the handler for the */
|
||||
/* occurrence of a service request from a GPIB device to break out of */
|
||||
/* an otherwise infinite loop. The flow of the code is as follows: */
|
||||
/* */
|
||||
/* Open A Session To The VISA Resource Manager */
|
||||
/* Open A Session To A GPIB Device */
|
||||
/* Install An Event Handler For SRQ Events */
|
||||
/* Enable SRQ Events */
|
||||
/* Write A Command To The Instrument To Cause It To Generate An SRQ */
|
||||
/* Start An Infinite Loop That Can Only Be Stopped By A Handler Flag */
|
||||
/* Print Out The Data */
|
||||
/* Close The Instrument Session */
|
||||
/* Close The Resource Manager Session */
|
||||
/**************************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
/* Functions like strcpy are technically not secure because they do */
|
||||
/* not contain a 'length'. But we disable this warning for the VISA */
|
||||
/* examples since we never copy more than the actual buffer size. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
/* Prototype for the SRQ event handler */
|
||||
ViStatus _VI_FUNCH SRQhandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr userHandle);
|
||||
|
||||
#define READ_BUFFER_SIZE 4096
|
||||
|
||||
static unsigned char data[READ_BUFFER_SIZE];
|
||||
static ViAddr uhandle;
|
||||
static ViStatus status;
|
||||
static ViUInt32 BytesToRead;
|
||||
static ViSession inst;
|
||||
static ViSession defaultRM;
|
||||
static ViSession Sessionparam;
|
||||
static ViEventType EventTypeparam;
|
||||
static ViAddr Addressparam;
|
||||
static ViUInt32 rcount, rdcount=0;
|
||||
static volatile ViBoolean stopflag = VI_FALSE;
|
||||
static int letter;
|
||||
static char stringinput[256];
|
||||
|
||||
|
||||
/*
|
||||
* The instrument session, the type of event, and a handle to the event are
|
||||
* passed to the event handler function along with a user handle which is basically a
|
||||
* label that could be used to reference the handler.
|
||||
* First, the event handler calls viReadSTB() to get the serial poll byte from the
|
||||
* instrument. With GPIB SRQ events, viReadSTB() must be called otherwise
|
||||
* later SRQ events will not be detected. The handler then reads in the
|
||||
* data to a global variable and sets a flag that allows the program to
|
||||
* finish. This is an instrument specific implementation that requires
|
||||
* viWrite() and viRead() to be called here. Always return VI_SUCCESS from your handler.
|
||||
*/
|
||||
ViStatus _VI_FUNCH SRQhandler(ViSession vi, ViEventType etype, ViEvent event, ViAddr userHandle)
|
||||
{
|
||||
ViUInt16 stb;
|
||||
|
||||
Sessionparam = vi;
|
||||
EventTypeparam = etype;
|
||||
Addressparam = userHandle;
|
||||
|
||||
status = viReadSTB (inst, &stb);
|
||||
strcpy (stringinput,"SENS: DATA?\n");
|
||||
status = viWrite (vi, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &rcount);
|
||||
BytesToRead = READ_BUFFER_SIZE - 1;
|
||||
status = viRead (vi, data, BytesToRead, &rdcount);
|
||||
stopflag = VI_TRUE;
|
||||
|
||||
return VI_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/*
|
||||
* First we open a session to the VISA resource manager. We are
|
||||
* returned a handle to the resource manager session that we must
|
||||
* use to open sessions to specific instruments.
|
||||
*/
|
||||
status = viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Next we use the resource manager handle to open a session to a
|
||||
* GPIB instrument at address 2. A handle to this session is
|
||||
* returned in the handle inst.
|
||||
*/
|
||||
status = viOpen (defaultRM, "GPIB::2::INSTR", VI_NULL, VI_NULL, &inst);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the device simulator\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we install the handler for service request events.
|
||||
* We must pass our instrument session to the handler, the type of
|
||||
* event to handle, the handler function name and a user handle
|
||||
* which acts as a user-defined handle passed to the handler
|
||||
* function.
|
||||
*/
|
||||
status = viInstallHandler (inst, VI_EVENT_SERVICE_REQ, SRQhandler, uhandle);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("The event handler could not be successfully installed.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/* Now we must actually enable the service request event so that our
|
||||
* handler will see the events. Note that one of the parameters is
|
||||
* VI_HNDLR indicating that we want the SRQ events to be handled by
|
||||
* an asynchronous handler. The alternate mechanism for handling
|
||||
* events is to queue them and read events from the queue when
|
||||
* you want to dequeue them in your program.
|
||||
*/
|
||||
status = viEnableEvent (inst, VI_EVENT_SERVICE_REQ, VI_HNDLR, VI_NULL);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("The SRQ event could not be enabled.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now the VISA write function is used to instruct the
|
||||
* instrument to generate a sine wave and assert the SRQ line
|
||||
* when it is finished. Notice that this is specific to one
|
||||
* particular instrument.
|
||||
*/
|
||||
strcpy (stringinput,"*ESE 0x01; *SRE 0x20; SOUR:FUNC SIN; *OPC\n");
|
||||
status = viWrite (inst, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &rcount);
|
||||
|
||||
printf("The program has passed all of the other status tests.\n");
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error writing to the instrument.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
goto Close;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Now the program goes into a wait loop which will only terminate
|
||||
* if a service request event triggers the asynchronous callback.
|
||||
*/
|
||||
printf("Hit enter to continue.");
|
||||
letter = getchar();
|
||||
|
||||
/*
|
||||
* If the asynchronous event handler was called, then stopflag was set.
|
||||
* Now, we print out the data read back.
|
||||
*/
|
||||
if (stopflag == VI_TRUE)
|
||||
{
|
||||
/* rdcount was set in callback */
|
||||
/* Add a NULL terminator to the read buffer */
|
||||
data[rdcount] = '\0';
|
||||
printf ("Here is the data %s\n", data);
|
||||
printf ("Hit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we must uninstall the event handler, and close the session to
|
||||
* the instrument and the session to the resource manager.
|
||||
*/
|
||||
status = viUninstallHandler (inst, VI_EVENT_SERVICE_REQ, SRQhandler, uhandle);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("There was an error uninstalling the handler.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
}
|
||||
|
||||
Close:
|
||||
status = viClose (inst);
|
||||
status = viClose (defaultRM);
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Gpib/AsyncSRQ_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Gpib/AsyncSRQ_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="AsyncSRQ" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=AsyncSRQ - 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 "AsyncSRQ_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 "AsyncSRQ_MSVC.mak" CFG="AsyncSRQ - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "AsyncSRQ - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "AsyncSRQ - 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)" == "AsyncSRQ - 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/AsyncSRQ.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "AsyncSRQ - 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/AsyncSRQ.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "AsyncSRQ - Win32 Release"
|
||||
# Name "AsyncSRQ - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\AsyncSRQ.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/Gpib/AsyncSRQ_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Gpib/AsyncSRQ_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="AsyncSRQ"
|
||||
ProjectGUID="{FB2EAF25-2003-4295-A24B-2869DDF335D8}"
|
||||
>
|
||||
<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)/AsyncSRQ_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)/AsyncSRQ_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)/AsyncSRQ.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ_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)/AsyncSRQ_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)/AsyncSRQ_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)/AsyncSRQ.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ_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)/AsyncSRQ_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)/AsyncSRQ_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)/AsyncSRQ.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ_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)/AsyncSRQ_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)/AsyncSRQ_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)/AsyncSRQ.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/AsyncSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/AsyncSRQ_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="AsyncSRQ.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>
|
166
NI-VISA/Examples/C/Gpib/WaitSRQ.c
Normal file
166
NI-VISA/Examples/C/Gpib/WaitSRQ.c
Normal file
@ -0,0 +1,166 @@
|
||||
/**************************************************************************/
|
||||
/* Synchronous SRQ Event Handling Example */
|
||||
/* */
|
||||
/* This example shows how to enable VISA to detect SRQ events. */
|
||||
/* The program writes a command to a device and then waits to receive */
|
||||
/* an SRQ event before trying to read the response. */
|
||||
/* */
|
||||
/* Open A Session To The VISA Resource Manager */
|
||||
/* Open A Session To A GPIB Device */
|
||||
/* Enable SRQ Events */
|
||||
/* Write A Command To The Instrument */
|
||||
/* Wait to receive an SRQ event */
|
||||
/* Read the Data */
|
||||
/* Print Out The Data */
|
||||
/* Close The Instrument Session */
|
||||
/* Close The Resource Manager Session */
|
||||
/**************************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
/* Functions like strcpy are technically not secure because they do */
|
||||
/* not contain a 'length'. But we disable this warning for the VISA */
|
||||
/* examples since we never copy more than the actual buffer size. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession inst;
|
||||
static ViSession defaultRM;
|
||||
static ViUInt32 WaitTimeout = 30000; /* Timeout in milliseconds */
|
||||
static ViEvent ehandle;
|
||||
static ViEventType etype;
|
||||
static ViStatus status;
|
||||
static ViUInt32 rcount;
|
||||
static ViUInt16 statusByte;
|
||||
static unsigned char data[3000];
|
||||
static char stringinput[512], nextstringinput[512];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/*
|
||||
* First we open a session to the VISA resource manager. We are
|
||||
* returned a handle to the resource manager session that we must
|
||||
* use to open sessions to specific instruments.
|
||||
*/
|
||||
status = viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Next we use the resource manager handle to open a session to a
|
||||
* GPIB instrument at address 2. A handle to this session is
|
||||
* returned in the handle inst.
|
||||
*/
|
||||
status = viOpen (defaultRM, "GPIB::2::INSTR", VI_NULL, VI_NULL, &inst);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the device simulator");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
|
||||
/* Now we must enable the service request event so that VISA
|
||||
* will receive the events. Note: one of the parameters is
|
||||
* VI_QUEUE indicating that we want the events to be handled by
|
||||
* a synchronous event queue. The alternate mechanism for handling
|
||||
* events is to set up an asynchronous event handling function using
|
||||
* the VI_HNDLR option. The events go into a queue which by default
|
||||
* can hold 50 events. This maximum queue size can be changed with
|
||||
* an attribute but it must be called before the events are enabled.
|
||||
*/
|
||||
status = viEnableEvent (inst, VI_EVENT_SERVICE_REQ, VI_QUEUE, VI_NULL);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("The SRQ event could not be enabled");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now the VISA write command is used to send a request to the
|
||||
* instrument to generate a sine wave and assert the SRQ line
|
||||
* when it is finished. Notice that this is specific to one
|
||||
* particular instrument.
|
||||
*/
|
||||
strcpy(stringinput,"SRE 0x10; SOUR:FUNC SIN\n");
|
||||
status = viWrite (inst, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &rcount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Error writing to the instrument\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we wait for an SRQ event to be received by the event queue.
|
||||
* The timeout is in milliseconds and is set to 30000 or 30 seconds.
|
||||
* Notice that a handle to the event is returned by the viWaitOnEvent
|
||||
* call. This event handle can be used to obtain various
|
||||
* attributes of the event. Finally, the event handle should be closed
|
||||
* to free system resources.
|
||||
*/
|
||||
printf("\nWaiting for an SRQ Event\n\n");
|
||||
status = viWaitOnEvent (inst, VI_EVENT_SERVICE_REQ, WaitTimeout, &etype, &ehandle);
|
||||
|
||||
/*
|
||||
* If an SRQ event was received we first read the status byte with
|
||||
* the viReadSTB function. This should always be called after
|
||||
* receiving a GPIB SRQ event, or subsequent events will not be
|
||||
* received properly. Then the data is read and the event is closed
|
||||
* and the data is displayed. Otherwise sessions are closed and the
|
||||
* program terminates.
|
||||
*/
|
||||
if (status >= VI_SUCCESS)
|
||||
{
|
||||
status = viReadSTB (inst, &statusByte);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("There was an error reading the status byte");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
strcpy(nextstringinput,"SENS: DATA?\n");
|
||||
status = viWrite (inst, (ViBuf)nextstringinput, (ViUInt32)strlen(nextstringinput), &rcount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("There was an error writing the command to get the data");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
status = viRead (inst, data, 3000, &rcount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("There was an error reading the data");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
status = viClose (ehandle);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("There was an error closing the event handle");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
printf("Here is the data: %*s\n", rcount, data);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we must close the session to the instrument and the session
|
||||
* to the resource manager.
|
||||
*/
|
||||
Close:
|
||||
status = viClose (inst);
|
||||
status = viClose (defaultRM);
|
||||
printf ("Hit enter to continue.");
|
||||
fflush (stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Gpib/WaitSRQ_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Gpib/WaitSRQ_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="WaitSRQ" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=WaitSRQ - 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 "WaitSRQ_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 "WaitSRQ_MSVC.mak" CFG="WaitSRQ - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "WaitSRQ - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "WaitSRQ - 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)" == "WaitSRQ - 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/WaitSRQ.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "WaitSRQ - 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/WaitSRQ.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "WaitSRQ - Win32 Release"
|
||||
# Name "WaitSRQ - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\WaitSRQ.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/Gpib/WaitSRQ_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Gpib/WaitSRQ_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="WaitSRQ"
|
||||
ProjectGUID="{5C98A41B-F832-4AE9-BD75-A450FA2A45AA}"
|
||||
>
|
||||
<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)/WaitSRQ_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)/WaitSRQ_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)/WaitSRQ.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ_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)/WaitSRQ_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)/WaitSRQ_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)/WaitSRQ.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ_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)/WaitSRQ_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)/WaitSRQ_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)/WaitSRQ.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ_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)/WaitSRQ_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)/WaitSRQ_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)/WaitSRQ.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/WaitSRQ.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/WaitSRQ_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="WaitSRQ.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>
|
78
NI-VISA/Examples/C/PXI/ReserveTrig.c
Normal file
78
NI-VISA/Examples/C/PXI/ReserveTrig.c
Normal 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);
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/PXI/ReserveTrig_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/PXI/ReserveTrig_MSVC.dsp
Normal 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
|
501
NI-VISA/Examples/C/PXI/ReserveTrig_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/PXI/ReserveTrig_MSVC_VS2005.vcproj
Normal 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>
|
80
NI-VISA/Examples/C/PXI/RouteTrig.c
Normal file
80
NI-VISA/Examples/C/PXI/RouteTrig.c
Normal 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);
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/PXI/RouteTrig_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/PXI/RouteTrig_MSVC.dsp
Normal 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
|
501
NI-VISA/Examples/C/PXI/RouteTrig_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/PXI/RouteTrig_MSVC_VS2005.vcproj
Normal 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>
|
159
NI-VISA/Examples/C/Serial/RdWrtSrl.c
Normal file
159
NI-VISA/Examples/C/Serial/RdWrtSrl.c
Normal file
@ -0,0 +1,159 @@
|
||||
/********************************************************************/
|
||||
/* Read and Write to a Serial Instrument */
|
||||
/* */
|
||||
/* This code demonstrates sending synchronous read & write commands */
|
||||
/* through the serial port using VISA. */
|
||||
/* The example writes the "*IDN?\n" string to the serial port (COM1)*/
|
||||
/* and attempts to read back a result using the write and read */
|
||||
/* functions. */
|
||||
/* */
|
||||
/* The general flow of the code is */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA Session to an Instrument */
|
||||
/* Configure the Serial Port */
|
||||
/* Write the Identification Query Using viWrite */
|
||||
/* Try to Read a Response With viRead */
|
||||
/* Close the VISA Session */
|
||||
/********************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
/* Functions like strcpy are technically not secure because they do */
|
||||
/* not contain a 'length'. But we disable this warning for the VISA */
|
||||
/* examples since we never copy more than the actual buffer size. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr;
|
||||
static ViUInt32 retCount;
|
||||
static ViUInt32 writeCount;
|
||||
static ViStatus status;
|
||||
static unsigned char buffer[100];
|
||||
static char stringinput[512];
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will open a VISA session to the serial port (COM1).
|
||||
* We must use the handle from viOpenDefaultRM and we must
|
||||
* also use a string that indicates which instrument to open. This
|
||||
* is called the instrument descriptor. The format for this string
|
||||
* can be found in the function panel by right clicking on the
|
||||
* descriptor parameter. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The AccessMode and Timeout
|
||||
* parameters in this function are reserved for future
|
||||
* functionality. These two parameters are given the value VI_NULL.
|
||||
*/
|
||||
status = viOpen (defaultRM, "ASRL1::INSTR", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device.\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point we now have a session open to the serial instrument.
|
||||
* Now we need to configure the serial port:
|
||||
*/
|
||||
|
||||
/* Set the timeout to 5 seconds (5000 milliseconds). */
|
||||
status = viSetAttribute (instr, VI_ATTR_TMO_VALUE, 5000);
|
||||
|
||||
/* Set the baud rate to 4800 (default is 9600). */
|
||||
status = viSetAttribute (instr, VI_ATTR_ASRL_BAUD, 4800);
|
||||
|
||||
/* Set the number of data bits contained in each frame (from 5 to 8).
|
||||
* The data bits for each frame are located in the low-order bits of
|
||||
* every byte stored in memory.
|
||||
*/
|
||||
status = viSetAttribute (instr, VI_ATTR_ASRL_DATA_BITS, 8);
|
||||
|
||||
/* Specify parity. Options:
|
||||
* VI_ASRL_PAR_NONE - No parity bit exists,
|
||||
* VI_ASRL_PAR_ODD - Odd parity should be used,
|
||||
* VI_ASRL_PAR_EVEN - Even parity should be used,
|
||||
* VI_ASRL_PAR_MARK - Parity bit exists and is always 1,
|
||||
* VI_ASRL_PAR_SPACE - Parity bit exists and is always 0.
|
||||
*/
|
||||
status = viSetAttribute (instr, VI_ATTR_ASRL_PARITY, VI_ASRL_PAR_NONE);
|
||||
|
||||
/* Specify stop bit. Options:
|
||||
* VI_ASRL_STOP_ONE - 1 stop bit is used per frame,
|
||||
* VI_ASRL_STOP_ONE_5 - 1.5 stop bits are used per frame,
|
||||
* VI_ASRL_STOP_TWO - 2 stop bits are used per frame.
|
||||
*/
|
||||
status = viSetAttribute (instr, VI_ATTR_ASRL_STOP_BITS, VI_ASRL_STOP_ONE);
|
||||
|
||||
/* Specify that the read operation should terminate when a termination
|
||||
* character is received.
|
||||
*/
|
||||
status = viSetAttribute (instr, VI_ATTR_TERMCHAR_EN, VI_TRUE);
|
||||
|
||||
/* Set the termination character to 0xA
|
||||
*/
|
||||
status = viSetAttribute (instr, VI_ATTR_TERMCHAR, 0xA);
|
||||
|
||||
|
||||
/* We will use the viWrite function to send the device the string "*IDN?\n",
|
||||
* asking for the device's identification.
|
||||
*/
|
||||
strcpy (stringinput,"*IDN?\n");
|
||||
status = viWrite (instr, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Error writing to the device.\n");
|
||||
goto Close;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will attempt to read back a response from the device to
|
||||
* the identification query that was sent. We will use the viRead
|
||||
* function to acquire the data. We will try to read back 100 bytes.
|
||||
* This function will stop reading if it finds the termination character
|
||||
* before it reads 100 bytes.
|
||||
* After the data has been read the response is displayed.
|
||||
*/
|
||||
status = viRead (instr, buffer, 100, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Error reading a response from the device.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\nData read: %*s\n", retCount, buffer);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Now we will close the session to the instrument using
|
||||
* viClose. This operation frees all system resources.
|
||||
*/
|
||||
Close:
|
||||
status = viClose (instr);
|
||||
status = viClose (defaultRM);
|
||||
printf ("Hit enter to continue.");
|
||||
fflush (stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/Serial/RdWrtSrl_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/Serial/RdWrtSrl_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="RdWrtSrl" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=RdWrtSrl - 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 "RdWrtSrl_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 "RdWrtSrl_MSVC.mak" CFG="RdWrtSrl - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "RdWrtSrl - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "RdWrtSrl - 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)" == "RdWrtSrl - 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/RdWrtSrl.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "RdWrtSrl - 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/RdWrtSrl.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "RdWrtSrl - Win32 Release"
|
||||
# Name "RdWrtSrl - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RdWrtSrl.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/Serial/RdWrtSrl_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/Serial/RdWrtSrl_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="RdWrtSrl"
|
||||
ProjectGUID="{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}"
|
||||
>
|
||||
<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)/RdWrtSrl_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)/RdWrtSrl_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)/RdWrtSrl.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl_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)/RdWrtSrl_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)/RdWrtSrl_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)/RdWrtSrl.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl_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)/RdWrtSrl_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)/RdWrtSrl_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)/RdWrtSrl.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl_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)/RdWrtSrl_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)/RdWrtSrl_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)/RdWrtSrl.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtSrl.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtSrl_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="RdWrtSrl.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>
|
112
NI-VISA/Examples/C/TCPIP/TCPIP_MSVC.dsp
Normal file
112
NI-VISA/Examples/C/TCPIP/TCPIP_MSVC.dsp
Normal file
@ -0,0 +1,112 @@
|
||||
# Microsoft Developer Studio Project File - Name="TCPIP" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=TCPIP - 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 "TCPIP_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 "TCPIP_MSVC.mak" CFG="TCPIP - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "TCPIP - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "TCPIP - 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)" == "TCPIP - 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 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 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
|
||||
|
||||
!ELSEIF "$(CFG)" == "TCPIP - 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 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 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
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "TCPIP - Win32 Release"
|
||||
# Name "TCPIP - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\tcpip.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 "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=$(VXIPNPPATH)\WinNT\lib\msc\visa32.lib
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
493
NI-VISA/Examples/C/TCPIP/TCPIP_MSVC_VS2005.vcproj
Normal file
493
NI-VISA/Examples/C/TCPIP/TCPIP_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,493 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="TCPIP"
|
||||
ProjectGUID="{02C1C19C-5E65-420B-959C-145A0264F934}"
|
||||
>
|
||||
<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)/TCPIP_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)/TCPIP_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)/TCPIP_MSVC.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/TCPIP_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/TCPIP_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)/TCPIP_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)/TCPIP_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)/TCPIP_MSVC.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/TCPIP_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/TCPIP_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)/TCPIP_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)/TCPIP_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)/TCPIP_MSVC.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/TCPIP_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/TCPIP_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)/TCPIP_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)/TCPIP_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)/TCPIP_MSVC.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/TCPIP_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/TCPIP_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="tcpip.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="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
<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>
|
73
NI-VISA/Examples/C/TCPIP/tcpip.c
Normal file
73
NI-VISA/Examples/C/TCPIP/tcpip.c
Normal file
@ -0,0 +1,73 @@
|
||||
/*********************************************************************/
|
||||
/* This example demonstrates opening a simple TCPIP connection and */
|
||||
/* does a read and checks a few properties. */
|
||||
/* */
|
||||
/* The general flow of the code is */
|
||||
/* Open Resource Manager */
|
||||
/* Open a session to the TCP/IP site at NI */
|
||||
/* Perform a read, and check properties */
|
||||
/* Close all VISA Sessions */
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static char outputBuffer[VI_FIND_BUFLEN];
|
||||
static ViSession defaultRM, instr;
|
||||
static ViStatus status;
|
||||
static ViUInt32 count;
|
||||
static ViUInt16 portNo;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* First we will need to open the default resource manager. */
|
||||
status = viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Now we will open a session via TCP/IP to ni.com */
|
||||
status = viOpen (defaultRM, "TCPIP0::ftp.ni.com::21::SOCKET", VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred opening the session to TCPIP0::ftp.ni.com::21::SOCKET\n");
|
||||
viClose(defaultRM);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
viSetAttribute (instr, VI_ATTR_TCPIP_NODELAY, VI_TRUE);
|
||||
|
||||
status = viRead (instr, (ViBuf)outputBuffer, 25, &count);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("viRead failed with error code %x \n",status);
|
||||
viClose(defaultRM);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("The server response is:\n %s\n\n",outputBuffer);
|
||||
status = viGetAttribute (instr, VI_ATTR_TCPIP_ADDR, outputBuffer);
|
||||
printf(" Address: %s\n",outputBuffer);
|
||||
|
||||
status = viGetAttribute (instr, VI_ATTR_TCPIP_HOSTNAME, outputBuffer);
|
||||
printf(" Host Name: %s\n",outputBuffer);
|
||||
|
||||
status = viGetAttribute (instr, VI_ATTR_TCPIP_PORT, &portNo);
|
||||
printf(" Port: %d\n",portNo);
|
||||
|
||||
status = viGetAttribute (instr, VI_ATTR_RSRC_CLASS, outputBuffer);
|
||||
printf(" Resource Class: %s\n",outputBuffer);
|
||||
|
||||
status = viClose (instr);
|
||||
status = viClose (defaultRM);
|
||||
printf ("\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
143
NI-VISA/Examples/C/USB/RdWrtUSBTMC.c
Normal file
143
NI-VISA/Examples/C/USB/RdWrtUSBTMC.c
Normal file
@ -0,0 +1,143 @@
|
||||
/********************************************************************/
|
||||
/* Read and Write to a USBTMC Instrument */
|
||||
/* */
|
||||
/* This code demonstrates sending synchronous read & write commands */
|
||||
/* to an USB Test & Measurement Class (USBTMC) instrument using */
|
||||
/* NI-VISA */
|
||||
/* The example writes the "*IDN?\n" string to all the USBTMC */
|
||||
/* devices connected to the system and attempts to read back */
|
||||
/* results using the write and read functions. */
|
||||
/* */
|
||||
/* The general flow of the code is */
|
||||
/* Open Resource Manager */
|
||||
/* Open VISA Session to an Instrument */
|
||||
/* Write the Identification Query Using viWrite */
|
||||
/* Try to Read a Response With viRead */
|
||||
/* Close the VISA Session */
|
||||
/********************************************************************/
|
||||
|
||||
#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
|
||||
/* Functions like strcpy are technically not secure because they do */
|
||||
/* not contain a 'length'. But we disable this warning for the VISA */
|
||||
/* examples since we never copy more than the actual buffer size. */
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
static ViSession defaultRM;
|
||||
static ViSession instr;
|
||||
static ViUInt32 numInstrs;
|
||||
static ViFindList findList;
|
||||
static ViUInt32 retCount;
|
||||
static ViUInt32 writeCount;
|
||||
static ViStatus status;
|
||||
static char instrResourceString[VI_FIND_BUFLEN];
|
||||
|
||||
static unsigned char buffer[100];
|
||||
static char stringinput[512];
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
|
||||
/* Find all the USB TMC VISA resources in our system and store the */
|
||||
/* number of resources in the system in numInstrs. */
|
||||
status = viFindRsrc (defaultRM, "USB?*INSTR", &findList, &numInstrs, instrResourceString);
|
||||
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred while finding resources.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
viClose (defaultRM);
|
||||
return status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will open VISA sessions to all USB TMC instruments.
|
||||
* We must use the handle from viOpenDefaultRM and we must
|
||||
* also use a string that indicates which instrument to open. This
|
||||
* is called the instrument descriptor. The format for this string
|
||||
* can be found in the function panel by right clicking on the
|
||||
* descriptor parameter. After opening a session to the
|
||||
* device, we will get a handle to the instrument which we
|
||||
* will use in later VISA functions. The AccessMode and Timeout
|
||||
* parameters in this function are reserved for future
|
||||
* functionality. These two parameters are given the value VI_NULL.
|
||||
*/
|
||||
|
||||
for (i=0; i<numInstrs; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
viFindNext (findList, instrResourceString);
|
||||
|
||||
status = viOpen (defaultRM, instrResourceString, VI_NULL, VI_NULL, &instr);
|
||||
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Cannot open a session to the device %d.\n", i+1);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point we now have a session open to the USB TMC instrument.
|
||||
* We will now use the viWrite function to send the device the string "*IDN?\n",
|
||||
* asking for the device's identification.
|
||||
*/
|
||||
strcpy (stringinput,"*IDN?\n");
|
||||
status = viWrite (instr, (ViBuf)stringinput, (ViUInt32)strlen(stringinput), &writeCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Error writing to the device %d.\n", i+1);
|
||||
status = viClose (instr);
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we will attempt to read back a response from the device to
|
||||
* the identification query that was sent. We will use the viRead
|
||||
* function to acquire the data. We will try to read back 100 bytes.
|
||||
* This function will stop reading if it finds the termination character
|
||||
* before it reads 100 bytes.
|
||||
* After the data has been read the response is displayed.
|
||||
*/
|
||||
status = viRead (instr, buffer, 100, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("Error reading a response from the device %d.\n", i+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
printf ("\nDevice %d: %*s\n", i+1, retCount, buffer);
|
||||
}
|
||||
status = viClose (instr);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Now we will close the session to the instrument using
|
||||
* viClose. This operation frees all system resources.
|
||||
*/
|
||||
status = viClose (defaultRM);
|
||||
printf ("Hit enter to continue.");
|
||||
fflush (stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
115
NI-VISA/Examples/C/USB/RdWrtUSBTMC_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/USB/RdWrtUSBTMC_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="RdWrtUSBTMC" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=RdWrtUSBTMC - 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 "RdWrtUSBTMC_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 "RdWrtUSBTMC_MSVC.mak" CFG="RdWrtUSBTMC - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "RdWrtUSBTMC - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "RdWrtUSBTMC - 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)" == "RdWrtUSBTMC - 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/RdWrtUSBTMC.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "RdWrtUSBTMC - 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/RdWrtUSBTMC.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "RdWrtUSBTMC - Win32 Release"
|
||||
# Name "RdWrtUSBTMC - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\RdWrtUSBTMC.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/USB/RdWrtUSBTMC_MSVC_VS2005.vcproj
Normal file
501
NI-VISA/Examples/C/USB/RdWrtUSBTMC_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,501 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="RdWrtUSBTMC"
|
||||
ProjectGUID="{373DBF7A-ADAD-43D1-B9A1-DDC7421C5B4F}"
|
||||
>
|
||||
<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)/RdWrtUSBTMC_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)/RdWrtUSBTMC_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)/RdWrtUSBTMC.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC_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)/RdWrtUSBTMC_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)/RdWrtUSBTMC_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)/RdWrtUSBTMC.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC_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)/RdWrtUSBTMC_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)/RdWrtUSBTMC_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)/RdWrtUSBTMC.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC_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)/RdWrtUSBTMC_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)/RdWrtUSBTMC_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)/RdWrtUSBTMC.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.pdb"
|
||||
GenerateMapFile="true"
|
||||
MapFileName="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC.map"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/RdWrtUSBTMC_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="RdWrtUSBTMC.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>
|
410
NI-VISA/Examples/C/USB/USBDescriptors.c
Normal file
410
NI-VISA/Examples/C/USB/USBDescriptors.c
Normal file
@ -0,0 +1,410 @@
|
||||
/*********************************************************************/
|
||||
/* This example demonstrates how you may query the USB RAW devices */
|
||||
/* and list the descriptors associated with those devices. */
|
||||
/* */
|
||||
/* The general flow of the code is */
|
||||
/* Open Resource Manager */
|
||||
/* Use viFindRsrc() to query available USB RAW instrument */
|
||||
/* Open a session to the device found */
|
||||
/* Display the descriptors for this device */
|
||||
/* Repeat process with the next instrument using viFindNext() */
|
||||
/* Close all VISA Sessions */
|
||||
/*********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "visa.h"
|
||||
|
||||
/* Defines */
|
||||
#define USB_REQUESTTYPE_GET_DESCRIPTOR 0x80
|
||||
#define USB_REQUEST_GET_DESCRIPTOR 6
|
||||
#define USB_DESCRIPTOR_TYPE_DEVICE 0x01
|
||||
#define USB_DESCRIPTOR_TYPE_CONFIG 0x02
|
||||
#define USB_DESCRIPTOR_TYPE_STRING 0x03
|
||||
#define USB_DESCRIPTOR_TYPE_INTERFACE 0x04
|
||||
#define USB_DESCRIPTOR_TYPE_ENDPOINT 0x05
|
||||
#define USB_DESCRIPTOR_LANGUAGE_ENGLISH 0x0409
|
||||
|
||||
/* Typedefs */
|
||||
typedef struct {
|
||||
ViUInt8 bLength;
|
||||
ViUInt8 bDescriptorType;
|
||||
ViUInt16 bcdUSB;
|
||||
ViUInt8 bDeviceClass;
|
||||
ViUInt8 bDeviceSubClass;
|
||||
ViUInt8 bDeviceProtocol;
|
||||
ViUInt8 bMaxPacketSize0;
|
||||
ViUInt16 idVendor;
|
||||
ViUInt16 idProduct;
|
||||
ViUInt16 bcdDevice;
|
||||
ViUInt8 iManufacturer;
|
||||
ViUInt8 iProduct;
|
||||
ViUInt8 iSerialNumber;
|
||||
ViUInt8 bNumConfigurations;
|
||||
} tUsbDeviceDesc;
|
||||
|
||||
typedef struct {
|
||||
ViUInt8 bLength;
|
||||
ViUInt8 bDescriptorType;
|
||||
ViUInt16 wTotalLength;
|
||||
ViUInt8 bNumInterfaces;
|
||||
ViUInt8 bConfigurationValue;
|
||||
ViUInt8 iConfiguration;
|
||||
ViUInt8 bmAttributes;
|
||||
ViUInt8 MaxPower;
|
||||
} tUsbConfigDesc;
|
||||
|
||||
typedef struct {
|
||||
ViUInt8 bLength;
|
||||
ViUInt8 bDescriptorType;
|
||||
ViUInt8 bInterfaceNumber;
|
||||
ViUInt8 bAlternateSetting;
|
||||
ViUInt8 bNumEndpoints;
|
||||
ViUInt8 bInterfaceClass;
|
||||
ViUInt8 bInterfaceSubClass;
|
||||
ViUInt8 bInterfaceProtocol;
|
||||
ViUInt8 iInterface;
|
||||
} tUsbInterfaceDesc;
|
||||
|
||||
typedef struct {
|
||||
ViUInt8 bLength;
|
||||
ViUInt8 bDescriptorType;
|
||||
ViUInt8 bEndpointAddress;
|
||||
ViUInt8 bmAttributes;
|
||||
ViUInt16 wMaxPacketSize;
|
||||
ViUInt8 bInterval;
|
||||
} tUsbEndpointDesc ;
|
||||
|
||||
typedef struct {
|
||||
ViUInt8 bLength;
|
||||
ViUInt8 bDescriptorType;
|
||||
} tUsbCommonDesc;
|
||||
|
||||
/* Prototypes */
|
||||
void GetStringDescriptor(ViUInt8 stringIndex, ViString stringDesc);
|
||||
void DisplayEndPointTransferType(ViUInt8 bmAttr);
|
||||
void DisplayDeviceDescriptor(ViSession instrHandle);
|
||||
void DisplayConfigDescriptor(ViSession instrHandle);
|
||||
void TraverseConfigDescriptor(ViChar* configDesc);
|
||||
|
||||
/* Variables */
|
||||
static char instrDescriptor[VI_FIND_BUFLEN];
|
||||
static ViUInt32 numInstrs;
|
||||
static ViFindList findList;
|
||||
static ViSession defaultRM, instr;
|
||||
static ViStatus status;
|
||||
|
||||
int main(void)
|
||||
{
|
||||
/* First we will need to open the default resource manager. */
|
||||
status = viOpenDefaultRM (&defaultRM);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("Could not open a session to the VISA Resource Manager!\n");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* Find all the RAW USB VISA resources in our system and store the */
|
||||
/* number of resources in the system in numInstrs. */
|
||||
status = viFindRsrc (defaultRM, "USB?*RAW", &findList, &numInstrs, instrDescriptor);
|
||||
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred while finding resources.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
viClose (defaultRM);
|
||||
return status;
|
||||
}
|
||||
|
||||
printf("%d USB RAW instruments found:\n\n",numInstrs);
|
||||
printf("%s \n\n",instrDescriptor);
|
||||
|
||||
/* Now we will open a session to the instrument we just found. */
|
||||
status = viOpen (defaultRM, instrDescriptor, VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred opening a session to %s\n",instrDescriptor);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayDeviceDescriptor(instr);
|
||||
DisplayConfigDescriptor(instr);
|
||||
viClose (instr);
|
||||
}
|
||||
|
||||
while (--numInstrs)
|
||||
{
|
||||
/* stay in this loop until we find all instruments */
|
||||
status = viFindNext (findList, instrDescriptor); /* find next desriptor */
|
||||
if (status < VI_SUCCESS)
|
||||
{ /* did we find the next resource? */
|
||||
printf ("An error occurred finding the next resource.\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
viClose (defaultRM);
|
||||
return status;
|
||||
}
|
||||
printf("%s \n",instrDescriptor);
|
||||
|
||||
/* Now we will open a session to the instrument we just found */
|
||||
status = viOpen (defaultRM, instrDescriptor, VI_NULL, VI_NULL, &instr);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf ("An error occurred opening a session to %s\n",instrDescriptor);
|
||||
}
|
||||
else
|
||||
{
|
||||
DisplayDeviceDescriptor(instr);
|
||||
DisplayConfigDescriptor(instr);
|
||||
viClose (instr);
|
||||
}
|
||||
} /* end while */
|
||||
|
||||
status = viClose(findList);
|
||||
status = viClose(defaultRM);
|
||||
printf ("\nHit enter to continue.");
|
||||
fflush(stdin);
|
||||
getchar();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*********************************************************************/
|
||||
/* Retrieve the string descriptor for the device */
|
||||
/* stringIndex: input parameter containing the index for the string */
|
||||
/* descriptor */
|
||||
/* stringDesc: output buffer to hold the string descriptor */
|
||||
/*********************************************************************/
|
||||
|
||||
void GetStringDescriptor(ViUInt8 stringIndex, ViString stringDesc)
|
||||
{
|
||||
ViUInt16 inBuffer[VI_FIND_BUFLEN];
|
||||
ViUInt16 stringDescLen;
|
||||
ViUInt16 retCount;
|
||||
ViUInt16 i;
|
||||
tUsbCommonDesc inBufferHeader;
|
||||
ViStatus status;
|
||||
|
||||
/* Query the length of the string package */
|
||||
status = viUsbControlIn (instr, USB_REQUESTTYPE_GET_DESCRIPTOR, USB_REQUEST_GET_DESCRIPTOR,
|
||||
USB_DESCRIPTOR_TYPE_STRING << 8 | stringIndex, USB_DESCRIPTOR_LANGUAGE_ENGLISH, 2, (ViPBuf)&inBufferHeader, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("An error occured when retrieving string descriptor header.\n");
|
||||
}
|
||||
|
||||
if (inBufferHeader.bLength > sizeof(inBuffer))
|
||||
{
|
||||
stringDesc[0] = '\0';
|
||||
printf ("String descriptor size %hu greater than maximum supported size %hu\n",inBufferHeader.bLength,sizeof(inBuffer));
|
||||
return;
|
||||
}
|
||||
|
||||
/* Query the String Descriptor */
|
||||
status = viUsbControlIn (instr, USB_REQUESTTYPE_GET_DESCRIPTOR, USB_REQUEST_GET_DESCRIPTOR,
|
||||
USB_DESCRIPTOR_TYPE_STRING << 8 | stringIndex, USB_DESCRIPTOR_LANGUAGE_ENGLISH, inBufferHeader.bLength,
|
||||
(ViPBuf)inBuffer, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("An error occured when retrieving string descriptor.\n");
|
||||
}
|
||||
|
||||
/* Reformat the string */
|
||||
stringDescLen = (inBufferHeader.bLength / 2) - 1;
|
||||
|
||||
for (i = 0; i < stringDescLen; ++i)
|
||||
{
|
||||
stringDesc[i] = (ViChar)inBuffer[i+1];
|
||||
}
|
||||
|
||||
/* Append End of the String */
|
||||
stringDesc[stringDescLen]='\0';
|
||||
}
|
||||
|
||||
/*********************************************************************/
|
||||
/* Print the Endpoint Transfer Type to console output */
|
||||
/* bmAttr: bmAttribute value for the Endpoint */
|
||||
/*********************************************************************/
|
||||
void DisplayEndPointTransferType(ViUInt8 bmAttr)
|
||||
{
|
||||
switch (bmAttr & 0x03)
|
||||
{
|
||||
case 0:
|
||||
printf("Control");
|
||||
break;
|
||||
case 1:
|
||||
printf("Isochronous");
|
||||
break;
|
||||
case 2:
|
||||
printf("Bulk");
|
||||
break;
|
||||
case 3:
|
||||
printf("Interrupt");
|
||||
break;
|
||||
default:
|
||||
printf("Unrecognized Type");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
/*********************************************************************/
|
||||
/* This function queries the device descriptor using the instrument */
|
||||
/* handle that is passed in. Then it print the device descriptor to */
|
||||
/* console output */
|
||||
/*********************************************************************/
|
||||
void DisplayDeviceDescriptor(ViSession instrHandle)
|
||||
{
|
||||
ViUInt16 retCount;
|
||||
ViChar stringDesc[VI_FIND_BUFLEN];
|
||||
tUsbDeviceDesc deviceDesc;
|
||||
ViStatus status;
|
||||
|
||||
/* Get Device Descriptor */
|
||||
status = viUsbControlIn (instrHandle, USB_REQUESTTYPE_GET_DESCRIPTOR, USB_REQUEST_GET_DESCRIPTOR,
|
||||
USB_DESCRIPTOR_TYPE_DEVICE << 8, 0, sizeof(tUsbDeviceDesc), (ViPBuf)&deviceDesc, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("An error occured when retrieving device descriptor.\n");
|
||||
}
|
||||
|
||||
/* Display Device Descriptor */
|
||||
printf("*********************\n");
|
||||
printf("* Device Descriptor *\n");
|
||||
printf("*********************\n");
|
||||
printf("bcdUSB:\t\t\t 0x%04X\n",deviceDesc.bcdUSB);
|
||||
printf("bDeviceClass:\t\t 0x%02X\n",deviceDesc.bDeviceClass);
|
||||
printf("bDeviceSubClass:\t 0x%02X\n",deviceDesc.bDeviceSubClass);
|
||||
printf("bDeviceProtocol:\t 0x%02X\n", deviceDesc.bDeviceProtocol);
|
||||
printf("bMaxPacketSize0:\t 0x%02X\n", deviceDesc.bMaxPacketSize0);
|
||||
printf("idVendor:\t\t 0x%04X\n", deviceDesc.idVendor);
|
||||
printf("idProduct:\t\t 0x%04X\n", deviceDesc.idProduct);
|
||||
printf("bcdDevice:\t\t 0x%04X\n", deviceDesc.bcdDevice);
|
||||
|
||||
/* A few Device Descriptor items also could include String Descriptors */
|
||||
printf("iManufacturer:\t\t 0x%02X\n", deviceDesc.iManufacturer);
|
||||
if (deviceDesc.iManufacturer != 0)
|
||||
{
|
||||
GetStringDescriptor(deviceDesc.iManufacturer,stringDesc);
|
||||
printf("\t\t\t \"%s\"\n",stringDesc);
|
||||
}
|
||||
|
||||
printf("iProduct:\t\t 0x%02X\n", deviceDesc.iProduct);
|
||||
if (deviceDesc.iProduct != 0)
|
||||
{
|
||||
GetStringDescriptor(deviceDesc.iProduct,stringDesc);
|
||||
printf("\t\t\t \"%s\"\n",stringDesc);
|
||||
}
|
||||
|
||||
printf("iSerialNumber:\t\t 0x%02X\n", deviceDesc.iSerialNumber);
|
||||
if (deviceDesc.iSerialNumber != 0)
|
||||
{
|
||||
GetStringDescriptor(deviceDesc.iSerialNumber,stringDesc);
|
||||
printf("\t\t\t \"%s\"\n",stringDesc);
|
||||
}
|
||||
|
||||
printf("bNumConfigurations:\t 0x%02X\n", deviceDesc.bNumConfigurations);
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
/*********************************************************************/
|
||||
/* This function queries the config descriptor using the instrument */
|
||||
/* handle that is passed in. Then it print the config descriptor to */
|
||||
/* console output */
|
||||
/*********************************************************************/
|
||||
void DisplayConfigDescriptor(ViSession instrHandle)
|
||||
{
|
||||
tUsbConfigDesc configDescOnly;
|
||||
ViStatus status;
|
||||
ViUInt16 retCount;
|
||||
ViChar configDescComplete[2048];
|
||||
|
||||
/* Retrieve the config descriptor */
|
||||
status = viUsbControlIn(instrHandle, USB_REQUESTTYPE_GET_DESCRIPTOR, USB_REQUEST_GET_DESCRIPTOR,
|
||||
USB_DESCRIPTOR_TYPE_CONFIG << 8, 0, sizeof(tUsbConfigDesc),
|
||||
(ViPBuf)&configDescOnly, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("An error occured when retrieving configuration descriptor.\n");
|
||||
}
|
||||
|
||||
if (configDescOnly.wTotalLength > 2048)
|
||||
{
|
||||
printf("Actual size of complete configuration descriptor (%lu) is greater than maximum buffer size (%lu)\n", configDescOnly.wTotalLength, 2048);
|
||||
return;
|
||||
}
|
||||
/* Retrieve the entire config descriptors */
|
||||
status = viUsbControlIn(instrHandle, USB_REQUESTTYPE_GET_DESCRIPTOR, USB_REQUEST_GET_DESCRIPTOR,
|
||||
USB_DESCRIPTOR_TYPE_CONFIG << 8, 0, configDescOnly.wTotalLength,
|
||||
(ViPBuf)configDescComplete, &retCount);
|
||||
if (status < VI_SUCCESS)
|
||||
{
|
||||
printf("An error occured when retrieving configuration descriptor.\n");
|
||||
}
|
||||
|
||||
/* Traverse and Display the entire config descriptor */
|
||||
printf("****************************\n");
|
||||
printf("* Configuration Descriptor *\n");
|
||||
printf("****************************\n");
|
||||
printf("wTotalLength:\t\t 0x%04X\n", configDescOnly.wTotalLength);
|
||||
printf("bNumInterfaces:\t\t 0x%02X\n", configDescOnly.bNumInterfaces);
|
||||
printf("bConfigurationValue:\t 0x%02X\n", configDescOnly.bConfigurationValue);
|
||||
printf("iConfiguration:\t\t 0x%02X\n", configDescOnly.iConfiguration);
|
||||
printf("bmAttributes:\t\t 0x%02X\n", configDescOnly.bmAttributes);
|
||||
printf("MaxPower:\t\t 0x%02X\n\n", configDescOnly.MaxPower);
|
||||
|
||||
TraverseConfigDescriptor(configDescComplete);
|
||||
}
|
||||
|
||||
/*********************************************************************/
|
||||
/* This function parses the complete config descriptor. */
|
||||
/* Then it print the device descriptor to console output. */
|
||||
/*********************************************************************/
|
||||
void TraverseConfigDescriptor(ViChar* pConfigDesc)
|
||||
{
|
||||
ViUInt16 currentOffset = ((tUsbConfigDesc *)pConfigDesc)->bLength; /* Skip over the config descriptor */
|
||||
ViUInt16 totalSize = ((tUsbConfigDesc *)pConfigDesc)->wTotalLength;
|
||||
tUsbInterfaceDesc * pInterfaceDesc;
|
||||
tUsbEndpointDesc * pEndpointDesc;
|
||||
|
||||
while (currentOffset < totalSize)
|
||||
{
|
||||
/* Interface Descriptor */
|
||||
if (((tUsbCommonDesc *)(pConfigDesc + currentOffset))->bDescriptorType == USB_DESCRIPTOR_TYPE_INTERFACE)
|
||||
{
|
||||
pInterfaceDesc = (tUsbInterfaceDesc *)(pConfigDesc + currentOffset);
|
||||
printf("************************\n");
|
||||
printf("* Interface Descriptor *\n");
|
||||
printf("************************\n");
|
||||
printf("bInterfaceNumber:\t 0x%02X\n",pInterfaceDesc->bInterfaceNumber);
|
||||
printf("bAlternatedSetting:\t 0x%02X\n",pInterfaceDesc->bAlternateSetting);
|
||||
printf("bNumEndpoints:\t\t 0x%02X\n",pInterfaceDesc->bNumEndpoints);
|
||||
printf("bInterfaceClass:\t 0x%02X\n",pInterfaceDesc->bInterfaceClass);
|
||||
printf("bInterfaceSubClass:\t 0x%02X\n",pInterfaceDesc->bInterfaceSubClass);
|
||||
printf("bInterfaceProtocol:\t 0x%02X\n",pInterfaceDesc->bInterfaceProtocol);
|
||||
printf("bInterface:\t\t 0x%02X\n",pInterfaceDesc->iInterface);
|
||||
printf("\n");
|
||||
}
|
||||
/* Endpoint Descriptor */
|
||||
else if (((tUsbCommonDesc *)(pConfigDesc + currentOffset))->bDescriptorType == USB_DESCRIPTOR_TYPE_ENDPOINT)
|
||||
{
|
||||
pEndpointDesc = (tUsbEndpointDesc *)(pConfigDesc + currentOffset);
|
||||
printf("***********************\n");
|
||||
printf("* Endpoint Descriptor *\n");
|
||||
printf("***********************\n");
|
||||
printf("bEndpointAddress:\t 0x%02X\n",pEndpointDesc->bEndpointAddress);
|
||||
printf("Transfer Type:\t\t ");
|
||||
DisplayEndPointTransferType(pEndpointDesc->bmAttributes);
|
||||
printf("wMaxPacketSize:\t\t 0x%02X\n",pEndpointDesc->wMaxPacketSize);
|
||||
printf("bInterval:\t\t 0x%02X\n",pEndpointDesc->bInterval);
|
||||
printf("\n");
|
||||
}
|
||||
/* update the iterator */
|
||||
currentOffset += ((tUsbCommonDesc *)(pConfigDesc + currentOffset))->bLength;
|
||||
}
|
||||
}
|
||||
|
115
NI-VISA/Examples/C/USB/USBDescriptors_MSVC.dsp
Normal file
115
NI-VISA/Examples/C/USB/USBDescriptors_MSVC.dsp
Normal file
@ -0,0 +1,115 @@
|
||||
# Microsoft Developer Studio Project File - Name="USBDescriptors" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=USBDescriptors - 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 "USBDescriptors_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 "USBDescriptors_MSVC.mak" CFG="USBDescriptors - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "USBDescriptors - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "USBDescriptors - 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)" == "USBDescriptors - 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/USBDescriptors.exe"
|
||||
|
||||
!ELSEIF "$(CFG)" == "USBDescriptors - 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/USBDescriptors.exe" /pdbtype:sept
|
||||
# SUBTRACT LINK32 /pdb:none
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "USBDescriptors - Win32 Release"
|
||||
# Name "USBDescriptors - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\USBDescriptors.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
|
493
NI-VISA/Examples/C/USB/USBDescriptors_MSVC_VS2005.vcproj
Normal file
493
NI-VISA/Examples/C/USB/USBDescriptors_MSVC_VS2005.vcproj
Normal file
@ -0,0 +1,493 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="USBDescriptors"
|
||||
ProjectGUID="{02C1C19C-5E65-420B-959C-145A0264F934}"
|
||||
>
|
||||
<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)/USBDescriptors_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)/USBDescriptors_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)/USBDescriptors_MSVC.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_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)/USBDescriptors_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)/USBDescriptors_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)/USBDescriptors_MSVC.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_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)/USBDescriptors_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)/USBDescriptors_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)/USBDescriptors_MSVC.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_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)/USBDescriptors_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)/USBDescriptors_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)/USBDescriptors_MSVC.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_MSVC.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
SuppressStartupBanner="true"
|
||||
OutputFile="$(PlatformName)\$(ConfigurationName)/USBDescriptors_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="USBDescriptors.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="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
<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>
|
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