├── .gitignore ├── README.md ├── S01-CyclicIO ├── TwinCAT Project with cyclic IO.sln └── TwinCAT Project with cyclic IO │ ├── TwinCAT Project with cyclic IO.tsproj │ └── Untitled1 │ ├── Module1.cpp │ ├── Module1.h │ ├── Resource.h │ ├── TcPch.cpp │ ├── TcPch.h │ ├── Untitled1.rc │ ├── Untitled1.tmc │ ├── Untitled1.vcxproj │ ├── Untitled1.vcxproj.filters │ ├── Untitled1.vcxproj.user │ ├── Untitled1ClassFactory.cpp │ ├── Untitled1ClassFactory.h │ ├── Untitled1Ctrl.cpp │ ├── Untitled1Ctrl.h │ ├── Untitled1Driver.cpp │ ├── Untitled1Driver.h │ ├── Untitled1Interfaces.h │ ├── Untitled1Services.h │ ├── Untitled1W32.cpp │ ├── Untitled1W32.def │ └── Untitled1W32.idl ├── S02-CyclicIOTask ├── TwinCAT Project with Cyclic IOTaskImage Access.sln └── TwinCAT Project with Cyclic IOTaskImage Access │ ├── TcIoTaskImageAccessDrv │ ├── IoTaskImageAccessModule.cpp │ ├── IoTaskImageAccessModule.h │ ├── Resource.h │ ├── TcIoTaskImageAccessDrv.aps │ ├── TcIoTaskImageAccessDrv.rc │ ├── TcIoTaskImageAccessDrv.tmc │ ├── TcIoTaskImageAccessDrv.vcxproj │ ├── TcIoTaskImageAccessDrv.vcxproj.filters │ ├── TcIoTaskImageAccessDrv.vcxproj.user │ ├── TcIoTaskImageAccessDrvClassFactory.cpp │ ├── TcIoTaskImageAccessDrvClassFactory.h │ ├── TcIoTaskImageAccessDrvCtrl.cpp │ ├── TcIoTaskImageAccessDrvCtrl.h │ ├── TcIoTaskImageAccessDrvDriver.cpp │ ├── TcIoTaskImageAccessDrvDriver.h │ ├── TcIoTaskImageAccessDrvInterfaces.h │ ├── TcIoTaskImageAccessDrvServices.h │ ├── TcIoTaskImageAccessDrvW32.cpp │ ├── TcIoTaskImageAccessDrvW32.def │ ├── TcIoTaskImageAccessDrvW32.idl │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project with Cyclic IOTaskImage Access.tsproj ├── S03-ADSClient ├── AdsClient │ ├── ClassDiagram1.cd │ ├── Form1.Designer.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── adsClientVisu.csproj │ └── app.config └── S03-AdsClientUI.sln ├── S05-CoEAccess ├── TwinCAT Project with CoE Access │ ├── TcAccessCoESdoViaAdsDrv │ │ ├── Resource.h │ │ ├── TcAccessCoESdoViaAdsDrv.rc │ │ ├── TcAccessCoESdoViaAdsDrv.tmc │ │ ├── TcAccessCoESdoViaAdsDrv.vcxproj │ │ ├── TcAccessCoESdoViaAdsDrv.vcxproj.filters │ │ ├── TcAccessCoESdoViaAdsDrv.vcxproj.user │ │ ├── TcAccessCoESdoViaAdsDrvClassFactory.cpp │ │ ├── TcAccessCoESdoViaAdsDrvClassFactory.h │ │ ├── TcAccessCoESdoViaAdsDrvCtrl.cpp │ │ ├── TcAccessCoESdoViaAdsDrvCtrl.h │ │ ├── TcAccessCoESdoViaAdsDrvDriver.cpp │ │ ├── TcAccessCoESdoViaAdsDrvDriver.h │ │ ├── TcAccessCoESdoViaAdsDrvInterfaces.h │ │ ├── TcAccessCoESdoViaAdsDrvServices.h │ │ ├── TcAccessCoESdoViaAdsDrvW32.cpp │ │ ├── TcAccessCoESdoViaAdsDrvW32.def │ │ ├── TcAccessCoESdoViaAdsDrvW32.idl │ │ ├── TcPch.cpp │ │ ├── TcPch.h │ │ ├── TcSdoAccessModul.cpp │ │ ├── TcSdoAccessModul.h │ │ └── TcSdoAccessModulAds.h │ ├── TwinCAT-Project-with-SdoAccess-via-Ads.tsproj │ └── TwinCAT-Project-with-SdoAccess-via-Ads.tsproj.bak └── TwinCAT-Project-with-SdoAccess-via-Ads.sln ├── S06-SymbolUploadClient ├── S06-TwinCAT-ADS-UI-Client.sln └── S06-TwinCAT-ADS-UI-Client │ ├── App.ico │ ├── AssemblyInfo.cs │ ├── Form1.cs │ ├── Form1.resx │ ├── Properties │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── TC3 S06 AdsSymbolSample.csproj │ ├── TC3 S06 AdsSymbolSample.csproj.user │ ├── app.config │ └── obj │ └── Debug │ ├── AdsSymbolSample.Properties.Resources.resources │ ├── AdsSymbolSample.exe │ ├── AdsSymbolSample.pdb │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ ├── GenerateResource.read.1.tlog │ ├── GenerateResource.write.1.tlog │ ├── ResolveAssemblyReference.cache │ ├── Sample06.Form1.resources │ └── TC3 S06 AdsSymbolSample.csproj.FileListAbsolute.txt ├── S07-AdsNotifications ├── TwinCAT AdsNotification.sln └── TwinCAT Project AdsNotifications │ ├── Receiver │ ├── ModuleReceiver.cpp │ ├── ModuleReceiver.h │ ├── ModuleReceiverAds.h │ ├── Receiver.rc │ ├── Receiver.tmc │ ├── Receiver.vcxproj │ ├── Receiver.vcxproj.filters │ ├── Receiver.vcxproj.user │ ├── ReceiverClassFactory.cpp │ ├── ReceiverClassFactory.h │ ├── ReceiverCtrl.cpp │ ├── ReceiverCtrl.h │ ├── ReceiverDriver.cpp │ ├── ReceiverDriver.h │ ├── ReceiverInterfaces.h │ ├── ReceiverServices.h │ ├── ReceiverW32.cpp │ ├── ReceiverW32.def │ ├── ReceiverW32.idl │ ├── Resource.h │ ├── TcPch.cpp │ └── TcPch.h │ ├── TwinCAT AdsNotification.tsproj │ └── VarProvider │ ├── ExternalTypes.tmc │ ├── POUs │ └── MAIN.TcPOU │ ├── PlcTask.TcTTO │ ├── Untitled2 Instance Mappings.xml │ ├── VarProvider.bootinfo │ ├── VarProvider.compileinfo │ ├── VarProvider.plcProj │ ├── VarProvider.tmc │ └── VarProvider.tpy ├── S08-ADSRPC ├── TwinCAT Project1.sln └── TwinCAT RPCSample │ ├── SampleRPC │ ├── SampleRPC.cpp │ ├── SampleRPC.vcxproj │ └── SampleRPC.vcxproj.user │ └── TwinCAT Project1 │ ├── TwinCAT Project1.tsproj │ └── Untitled1 │ ├── Module1.cpp │ ├── Module1.h │ ├── Resource.h │ ├── TcPch.cpp │ ├── TcPch.h │ ├── Untitled1.rc │ ├── Untitled1.tmc │ ├── Untitled1.vcxproj │ ├── Untitled1.vcxproj.filters │ ├── Untitled1.vcxproj.user │ ├── Untitled1ClassFactory.cpp │ ├── Untitled1ClassFactory.h │ ├── Untitled1Ctrl.cpp │ ├── Untitled1Ctrl.h │ ├── Untitled1Driver.cpp │ ├── Untitled1Driver.h │ ├── Untitled1Interfaces.h │ ├── Untitled1Services.h │ ├── Untitled1W32.cpp │ ├── Untitled1W32.def │ └── Untitled1W32.idl ├── S10-Mod2ModDataPointer ├── Readme.txt ├── TwinCAT Project with DataPointer.sln └── TwinCAT Project with DataPointer │ ├── TcDataPointerSampleDrv │ ├── ModuleDataAccessA.cpp │ ├── ModuleDataAccessA.h │ ├── ModuleDataAccessB.cpp │ ├── ModuleDataAccessB.h │ ├── ModuleDataInOut.cpp │ ├── ModuleDataInOut.h │ ├── ModuleDataProvider.cpp │ ├── ModuleDataProvider.h │ ├── Resource.h │ ├── TcDataPointerSampleDrv.rc │ ├── TcDataPointerSampleDrv.tmc │ ├── TcDataPointerSampleDrv.vcxproj │ ├── TcDataPointerSampleDrv.vcxproj.filters │ ├── TcDataPointerSampleDrv.vcxproj.user │ ├── TcDataPointerSampleDrvClassFactory.cpp │ ├── TcDataPointerSampleDrvClassFactory.h │ ├── TcDataPointerSampleDrvCtrl.cpp │ ├── TcDataPointerSampleDrvCtrl.h │ ├── TcDataPointerSampleDrvDriver.cpp │ ├── TcDataPointerSampleDrvDriver.h │ ├── TcDataPointerSampleDrvInterfaces.h │ ├── TcDataPointerSampleDrvServices.h │ ├── TcDataPointerSampleDrvW32.cpp │ ├── TcDataPointerSampleDrvW32.def │ ├── TcDataPointerSampleDrvW32.idl │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project with DataPointer.tsproj ├── S11a-Mod2ModCS ├── TwinCAT Project Concurrent DA │ ├── TcConcurrentDADrv │ │ ├── ModuleDataProvider.cpp │ │ ├── ModuleDataProvider.h │ │ ├── ModuleDataRead.cpp │ │ ├── ModuleDataRead.h │ │ ├── ModuleDataWrite.cpp │ │ ├── ModuleDataWrite.h │ │ ├── Resource.h │ │ ├── TcConcurrentDADrv.aps │ │ ├── TcConcurrentDADrv.rc │ │ ├── TcConcurrentDADrv.tmc │ │ ├── TcConcurrentDADrv.vcxproj │ │ ├── TcConcurrentDADrv.vcxproj.filters │ │ ├── TcConcurrentDADrv.vcxproj.user │ │ ├── TcConcurrentDADrvClassFactory.cpp │ │ ├── TcConcurrentDADrvClassFactory.h │ │ ├── TcConcurrentDADrvCtrl.cpp │ │ ├── TcConcurrentDADrvCtrl.h │ │ ├── TcConcurrentDADrvDriver.cpp │ │ ├── TcConcurrentDADrvDriver.h │ │ ├── TcConcurrentDADrvInterfaces.h │ │ ├── TcConcurrentDADrvServices.h │ │ ├── TcConcurrentDADrvW32.cpp │ │ ├── TcConcurrentDADrvW32.def │ │ ├── TcConcurrentDADrvW32.idl │ │ ├── TcPch.cpp │ │ └── TcPch.h │ └── TwinCAT Project Concurrent DA.tsproj └── TwinCAT Project with concurrent DA.sln ├── S12-Mod2ModIOMapping ├── TwinCAT Project ModuleCom IOMapping.sln └── TwinCAT Project ModuleCom IOMapping │ ├── InToOut │ ├── InToOut.rc │ ├── InToOut.tmc │ ├── InToOut.vcxproj │ ├── InToOut.vcxproj.filters │ ├── InToOut.vcxproj.user │ ├── InToOutClassFactory.cpp │ ├── InToOutClassFactory.h │ ├── InToOutCtrl.cpp │ ├── InToOutCtrl.h │ ├── InToOutDriver.cpp │ ├── InToOutDriver.h │ ├── InToOutInterfaces.h │ ├── InToOutServices.h │ ├── InToOutW32.cpp │ ├── InToOutW32.def │ ├── InToOutW32.idl │ ├── ModuleInToOut.cpp │ ├── ModuleInToOut.h │ ├── Resource.h │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project ModuleCom IOMapping.tsproj ├── S19-FileIOSync ├── TwinCAT Project Sync FileAccess.sln └── TwinCAT Project Sync FileAccess │ ├── TcFileTestDrv │ ├── Resource.h │ ├── TcFileTestDrv.aps │ ├── TcFileTestDrv.cpp │ ├── TcFileTestDrv.h │ ├── TcFileTestDrv.rc │ ├── TcFileTestDrv.tmc │ ├── TcFileTestDrv.vcxproj │ ├── TcFileTestDrv.vcxproj.filters │ ├── TcFileTestDrv.vcxproj.user │ ├── TcFileTestDrvClassFactory.cpp │ ├── TcFileTestDrvClassFactory.h │ ├── TcFileTestDrvCtrl.cpp │ ├── TcFileTestDrvCtrl.h │ ├── TcFileTestDrvDriver.cpp │ ├── TcFileTestDrvDriver.h │ ├── TcFileTestDrvInterfaces.h │ ├── TcFileTestDrvServices.h │ ├── TcFileTestDrvW32.cpp │ ├── TcFileTestDrvW32.def │ ├── TcFileTestDrvW32.idl │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project Sync FileAccess.tsproj ├── S20-FileIOWrite ├── TwinCAT Project with Async Buffer Writing.sln └── TwinCAT Project with Async Buffer Writing │ ├── TcAsyncBufferWritingDrv │ ├── Resource.h │ ├── TcAsyncBufferWritingDrv.rc │ ├── TcAsyncBufferWritingDrv.tmc │ ├── TcAsyncBufferWritingDrv.vcxproj │ ├── TcAsyncBufferWritingDrv.vcxproj.filters │ ├── TcAsyncBufferWritingDrv.vcxproj.user │ ├── TcAsyncBufferWritingDrv.vcxproj.vspscc │ ├── TcAsyncBufferWritingDrvClassFactory.cpp │ ├── TcAsyncBufferWritingDrvClassFactory.h │ ├── TcAsyncBufferWritingDrvCtrl.cpp │ ├── TcAsyncBufferWritingDrvCtrl.h │ ├── TcAsyncBufferWritingDrvDriver.cpp │ ├── TcAsyncBufferWritingDrvDriver.h │ ├── TcAsyncBufferWritingDrvInterfaces.h │ ├── TcAsyncBufferWritingDrvServices.h │ ├── TcAsyncBufferWritingDrvW32.cpp │ ├── TcAsyncBufferWritingDrvW32.def │ ├── TcAsyncBufferWritingDrvW32.idl │ ├── TcAsyncBufferWritingModule.cpp │ ├── TcAsyncBufferWritingModule.h │ ├── TcFsmFile.h │ ├── TcFsmFileClose.cpp │ ├── TcFsmFileClose.h │ ├── TcFsmFileOpen.cpp │ ├── TcFsmFileOpen.h │ ├── TcFsmFileWrite.cpp │ ├── TcFsmFileWrite.h │ ├── TcFsmFileWriter.cpp │ ├── TcFsmFileWriter.h │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project with Async Buffer Writing.tsproj ├── S22-ADD ├── TwinCAT Project with DPRAM.sln └── TwinCAT Project with DPRAM │ ├── TcPciIoDrv │ ├── ModuleDPRAM.cpp │ ├── ModuleDPRAM.h │ ├── Resource.h │ ├── TcPch.cpp │ ├── TcPch.h │ ├── TcPciIoDrv.rc │ ├── TcPciIoDrv.tmc │ ├── TcPciIoDrv.vcxproj │ ├── TcPciIoDrv.vcxproj.filters │ ├── TcPciIoDrv.vcxproj.user │ ├── TcPciIoDrvClassFactory.cpp │ ├── TcPciIoDrvClassFactory.h │ ├── TcPciIoDrvCtrl.cpp │ ├── TcPciIoDrvCtrl.h │ ├── TcPciIoDrvDriver.cpp │ ├── TcPciIoDrvDriver.h │ ├── TcPciIoDrvInterfaces.h │ ├── TcPciIoDrvServices.h │ ├── TcPciIoDrvW32.cpp │ ├── TcPciIoDrvW32.def │ └── TcPciIoDrvW32.idl │ └── TwinCAT Project with DPRAM.tsproj ├── S23-SEH ├── TwinCAT SEHProject.sln └── TwinCAT SEHProject │ ├── SEHSample │ ├── Resource.h │ ├── SEHModule.cpp │ ├── SEHModule.h │ ├── SEHSample.rc │ ├── SEHSample.tmc │ ├── SEHSample.vcxproj │ ├── SEHSample.vcxproj.filters │ ├── SEHSample.vcxproj.user │ ├── SEHSampleClassFactory.cpp │ ├── SEHSampleClassFactory.h │ ├── SEHSampleCtrl.cpp │ ├── SEHSampleCtrl.h │ ├── SEHSampleDriver.cpp │ ├── SEHSampleDriver.h │ ├── SEHSampleInterfaces.h │ ├── SEHSampleServices.h │ ├── SEHSampleW32.cpp │ ├── SEHSampleW32.def │ ├── SEHSampleW32.idl │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT SEHProject.tsproj ├── S25-StaticLibrary ├── TwinCAT Static Library.sln └── TwinCAT Static Library │ ├── DriverUsingStaticLib │ ├── DriverUsingStaticLib.rc │ ├── DriverUsingStaticLib.tmc │ ├── DriverUsingStaticLib.vcxproj │ ├── DriverUsingStaticLib.vcxproj.filters │ ├── DriverUsingStaticLib.vcxproj.user │ ├── DriverUsingStaticLibClassFactory.cpp │ ├── DriverUsingStaticLibClassFactory.h │ ├── DriverUsingStaticLibCtrl.cpp │ ├── DriverUsingStaticLibCtrl.h │ ├── DriverUsingStaticLibDriver.cpp │ ├── DriverUsingStaticLibDriver.h │ ├── DriverUsingStaticLibInterfaces.h │ ├── DriverUsingStaticLibServices.h │ ├── DriverUsingStaticLibW32.cpp │ ├── DriverUsingStaticLibW32.def │ ├── DriverUsingStaticLibW32.idl │ ├── ModuleUsingStaticLib.cpp │ ├── ModuleUsingStaticLib.h │ ├── Resource.h │ ├── TcPch.cpp │ └── TcPch.h │ ├── StaticLib │ ├── ClassDiagram1.cd │ ├── MultiplicationClass.cpp │ ├── MultiplicationClass.h │ ├── StaticFunction.cpp │ ├── StaticFunction.h │ ├── StaticLib.tmc │ ├── StaticLib.vcxproj │ ├── StaticLib.vcxproj.filters │ ├── StaticLib.vcxproj.user │ ├── StaticLibInterfaces.h │ ├── StaticLibServices.h │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Static Library.tsproj ├── S26-SortOrder ├── TwinCAT Project with SortOrder.sln └── TwinCAT Project with SortOrder │ ├── SortOrder │ ├── Resource.h │ ├── SortOrder.rc │ ├── SortOrder.tmc │ ├── SortOrder.vcxproj │ ├── SortOrder.vcxproj.filters │ ├── SortOrder.vcxproj.user │ ├── SortOrderClassFactory.cpp │ ├── SortOrderClassFactory.h │ ├── SortOrderCtrl.cpp │ ├── SortOrderCtrl.h │ ├── SortOrderDriver.cpp │ ├── SortOrderDriver.h │ ├── SortOrderInterfaces.h │ ├── SortOrderModule.cpp │ ├── SortOrderModule.h │ ├── SortOrderServices.h │ ├── SortOrderW32.cpp │ ├── SortOrderW32.def │ ├── SortOrderW32.idl │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project with SortOrder.tsproj ├── S30-Timing ├── TwinCAT Project with StopWatch.sln └── TwinCAT Project with StopWatch │ ├── TcStopWatchSample │ ├── Resource.h │ ├── StopWatchModule.cpp │ ├── StopWatchModule.h │ ├── TcPch.cpp │ ├── TcPch.h │ ├── TcStopWatchSample.rc │ ├── TcStopWatchSample.tmc │ ├── TcStopWatchSample.vcxproj │ ├── TcStopWatchSample.vcxproj.filters │ ├── TcStopWatchSample.vcxproj.user │ ├── TcStopWatchSampleClassFactory.cpp │ ├── TcStopWatchSampleClassFactory.h │ ├── TcStopWatchSampleCtrl.cpp │ ├── TcStopWatchSampleCtrl.h │ ├── TcStopWatchSampleDriver.cpp │ ├── TcStopWatchSampleDriver.h │ ├── TcStopWatchSampleInterfaces.h │ ├── TcStopWatchSampleServices.h │ ├── TcStopWatchSampleW32.cpp │ ├── TcStopWatchSampleW32.def │ └── TcStopWatchSampleW32.idl │ └── TwinCAT Project with StopWatch.tsproj ├── S31-CTON ├── TwinCAT Project CTON.sln └── TwinCAT Project CTON │ ├── TON │ ├── Module1.cpp │ ├── Module1.h │ ├── Resource.h │ ├── TON.cpp │ ├── TON.h │ ├── TON.rc │ ├── TON.tmc │ ├── TON.vcxproj │ ├── TON.vcxproj.filters │ ├── TON.vcxproj.user │ ├── TONClassFactory.cpp │ ├── TONClassFactory.h │ ├── TONCtrl.cpp │ ├── TONCtrl.h │ ├── TONDriver.cpp │ ├── TONDriver.h │ ├── TONInterfaces.h │ ├── TONServices.h │ ├── TONW32.cpp │ ├── TONW32.def │ ├── TONW32.idl │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project CTON.tsproj ├── S35-AccessEthernet ├── TwinCAT Project with Ethernet.sln └── TwinCAT Project with Ethernet │ ├── TcEthernetSample │ ├── ModuleARP.cpp │ ├── ModuleARP.h │ ├── Resource.h │ ├── TcEthernetSample.rc │ ├── TcEthernetSample.tmc │ ├── TcEthernetSample.vcxproj │ ├── TcEthernetSample.vcxproj.filters │ ├── TcEthernetSample.vcxproj.user │ ├── TcEthernetSample.vcxproj.vspscc │ ├── TcEthernetSampleClassFactory.cpp │ ├── TcEthernetSampleClassFactory.h │ ├── TcEthernetSampleCtrl.cpp │ ├── TcEthernetSampleCtrl.h │ ├── TcEthernetSampleDriver.cpp │ ├── TcEthernetSampleDriver.h │ ├── TcEthernetSampleInterfaces.h │ ├── TcEthernetSampleServices.h │ ├── TcEthernetSampleW32.cpp │ ├── TcEthernetSampleW32.def │ ├── TcEthernetSampleW32.idl │ ├── TcPch.cpp │ └── TcPch.h │ └── TwinCAT Project with Ethernet.tsproj ├── S37-ArchiveData ├── TwinCAT Project with TComObjArchive.sln └── TwinCAT Project with TComObjArchive │ ├── TcTComObjArchiveDrv │ ├── ModuleArchive.cpp │ ├── ModuleArchive.h │ ├── Resource.h │ ├── TcPch.cpp │ ├── TcPch.h │ ├── TcTComObjArchiveDrv.rc │ ├── TcTComObjArchiveDrv.tmc │ ├── TcTComObjArchiveDrv.vcxproj │ ├── TcTComObjArchiveDrv.vcxproj.filters │ ├── TcTComObjArchiveDrv.vcxproj.user │ ├── TcTComObjArchiveDrvClassFactory.cpp │ ├── TcTComObjArchiveDrvClassFactory.h │ ├── TcTComObjArchiveDrvCtrl.cpp │ ├── TcTComObjArchiveDrvCtrl.h │ ├── TcTComObjArchiveDrvDriver.cpp │ ├── TcTComObjArchiveDrvDriver.h │ ├── TcTComObjArchiveDrvInterfaces.h │ ├── TcTComObjArchiveDrvServices.h │ ├── TcTComObjArchiveDrvW32.cpp │ ├── TcTComObjArchiveDrvW32.def │ └── TcTComObjArchiveDrvW32.idl │ └── TwinCAT Project with TComObjArchive.tsproj ├── TwinCAT Project CppToPlc.tszip └── TwinCAT Project PLC calling C-Method.tszip /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Untitled1.rc 4 | #define IDS_UNTITLED1 100 5 | #define IDR_UNTITLED1CTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1ClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1ClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "Untitled1ClassFactory.h" 7 | #include "Untitled1Services.h" 8 | #include "Module1.h" 9 | 10 | BEGIN_CLASS_MAP(CUntitled1ClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_Untitled1CModule1, SRVNAME_UNTITLED1 "!CModule1", CModule1) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CUntitled1ClassFactory::CUntitled1ClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_UNTITLED1)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1ClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CUntitled1ClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CUntitled1ClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1Ctrl.cpp: -------------------------------------------------------------------------------- 1 | // Untitled1Ctrl.cpp : Implementation of CTcUntitled1Ctrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "Untitled1W32.h" 6 | #include "Untitled1Ctrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CUntitled1Ctrl 10 | 11 | CUntitled1Ctrl::CUntitled1Ctrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CUntitled1Ctrl::~CUntitled1Ctrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1Ctrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Ctrl.h 3 | 4 | #ifndef __UNTITLED1CTRL_H__ 5 | #define __UNTITLED1CTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define UNTITLED1DRV_NAME "UNTITLED1" 11 | 12 | #include "resource.h" // main symbols 13 | #include "Untitled1W32.h" 14 | #include "TcBase.h" 15 | #include "Untitled1ClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CUntitled1Ctrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public IUntitled1Ctrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CUntitled1Ctrl(); 26 | virtual ~CUntitled1Ctrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_UNTITLED1CTRL) 29 | DECLARE_NOT_AGGREGATABLE(CUntitled1Ctrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CUntitled1Ctrl) 34 | COM_INTERFACE_ENTRY(IUntitled1Ctrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __UNTITLED1CTRL_H__ 42 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1Driver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Driver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "Untitled1Driver.h" 7 | #include "Untitled1ClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(UNTITLED1DRV) 10 | 11 | IOSTATUS CUntitled1Driver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CUntitled1ClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CUntitled1Driver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CUntitled1Driver::UNTITLED1DRV_GetVersion( ) 25 | { 26 | return( (UNTITLED1DRV_Major << 8) | UNTITLED1DRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1Driver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Driver.h 3 | 4 | #ifndef __UNTITLED1DRIVER_H__ 5 | #define __UNTITLED1DRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define UNTITLED1DRV_NAME "UNTITLED1" 14 | #define UNTITLED1DRV_Major 1 15 | #define UNTITLED1DRV_Minor 0 16 | 17 | #define DEVICE_CLASS CUntitled1Driver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CUntitled1Driver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl UNTITLED1DRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(UNTITLED1DRV) 35 | VxD_Service( UNTITLED1DRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __UNTITLED1DRIVER_H__ -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1Interfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Interfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "Untitled1Services.h" 9 | 10 | /// 11 | /// 12 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1Services.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Services.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_Untitled1 = 0x3F000000; 9 | #define SRVNAME_UNTITLED1 "Untitled1" 10 | 11 | /// 12 | const CTCID CID_Untitled1CModule1 = {0xe5932aec,0x6c12,0x447a,{0x91,0x9d,0x2f,0xa1,0xe0,0x49,0x18,0xb3}}; 13 | /// 14 | 15 | /// 16 | const PTCID PID_Module1Parameter = 0x00000001; 17 | /// 18 | 19 | /// 20 | typedef struct _Module1Parameter 21 | { 22 | ULONG data1; 23 | ULONG data2; 24 | double data3; 25 | } Module1Parameter, *PModule1Parameter; 26 | 27 | typedef struct _Module1Inputs 28 | { 29 | ULONG Value; 30 | ULONG Status; 31 | ULONG Data; 32 | } Module1Inputs, *PModule1Inputs; 33 | 34 | typedef struct _Module1Outputs 35 | { 36 | ULONG Value; 37 | ULONG Control; 38 | ULONG Data; 39 | } Module1Outputs, *PModule1Outputs; 40 | 41 | /// 42 | 43 | 44 | 45 | /// 46 | /// 47 | -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1W32.def: -------------------------------------------------------------------------------- 1 | ; UNTITLED1W32.def : Declares the module parameters. 2 | 3 | LIBRARY "Untitled1W32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S01-CyclicIO/TwinCAT Project with cyclic IO/Untitled1/Untitled1W32.idl: -------------------------------------------------------------------------------- 1 | // Untitled1W32.idl : IDL source for Untitled1W32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (Untitled1W32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("IUntitled1 Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface IUntitled1Ctrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("Untitled1W32 1.0 Type Library") 24 | ] 25 | library UNTITLED1W32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("Untitled1Ctrl Class") 33 | ] 34 | coclass Untitled1Ctrl 35 | { 36 | [default] interface IUntitled1Ctrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcIoTaskImageAccessDrv.rc 4 | #define IDS_TCIOTASKIMAGEACCESSDRV 100 5 | #define IDR_TCIOTASKIMAGEACCESSDRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrv.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrv.aps -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcIoTaskImageAccessDrvClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcIoTaskImageAccessDrvClassFactory.h" 7 | #include "TcIoTaskImageAccessDrvServices.h" 8 | #include "IoTaskImageAccessModule.h" 9 | 10 | BEGIN_CLASS_MAP(CTcIoTaskImageAccessDrvClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_TcIoTaskImageAccessDrvCIoTaskImageAccessModule, SRVNAME_TCIOTASKIMAGEACCESSDRV "!CIoTaskImageAccessModule", CIoTaskImageAccessModule) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CTcIoTaskImageAccessDrvClassFactory::CTcIoTaskImageAccessDrvClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCIOTASKIMAGEACCESSDRV)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcIoTaskImageAccessDrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcIoTaskImageAccessDrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcIoTaskImageAccessDrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcIoTaskImageAccessDrvCtrl.cpp : Implementation of CTcTcIoTaskImageAccessDrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcIoTaskImageAccessDrvW32.h" 6 | #include "TcIoTaskImageAccessDrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcIoTaskImageAccessDrvCtrl 10 | 11 | CTcIoTaskImageAccessDrvCtrl::CTcIoTaskImageAccessDrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcIoTaskImageAccessDrvCtrl::~CTcIoTaskImageAccessDrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcIoTaskImageAccessDrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcIoTaskImageAccessDrvDriver.h" 7 | #include "TcIoTaskImageAccessDrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCIOTASKIMAGEACCESSDRVDRV) 10 | 11 | IOSTATUS CTcIoTaskImageAccessDrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcIoTaskImageAccessDrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcIoTaskImageAccessDrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcIoTaskImageAccessDrvDriver::TCIOTASKIMAGEACCESSDRVDRV_GetVersion( ) 25 | { 26 | return( (TCIOTASKIMAGEACCESSDRVDRV_Major << 8) | TCIOTASKIMAGEACCESSDRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcIoTaskImageAccessDrvDriver.h 3 | 4 | #ifndef __TCIOTASKIMAGEACCESSDRVDRIVER_H__ 5 | #define __TCIOTASKIMAGEACCESSDRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCIOTASKIMAGEACCESSDRVDRV_NAME "TCIOTASKIMAGEACCESSDRV" 14 | #define TCIOTASKIMAGEACCESSDRVDRV_Major 1 15 | #define TCIOTASKIMAGEACCESSDRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcIoTaskImageAccessDrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcIoTaskImageAccessDrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCIOTASKIMAGEACCESSDRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCIOTASKIMAGEACCESSDRVDRV) 35 | VxD_Service( TCIOTASKIMAGEACCESSDRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCIOTASKIMAGEACCESSDRVDRIVER_H__ -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcIoTaskImageAccessDrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcIoTaskImageAccessDrvServices.h" 9 | 10 | /// 11 | /// 12 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcIoTaskImageAccessDrvServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_TcIoTaskImageAccessDrv = 0x3F000000; 9 | #define SRVNAME_TCIOTASKIMAGEACCESSDRV "TcIoTaskImageAccessDrv" 10 | 11 | /// 12 | const CTCID CID_TcIoTaskImageAccessDrvCIoTaskImageAccessModule = {0x545521df,0x888c,0x4d86,{0xa1,0x0d,0x2f,0x1c,0xef,0x24,0x04,0x6a}}; 13 | /// 14 | 15 | /// 16 | const PTCID PID_IoTaskImageAccessModuleIoTaskImage = 0x00000001; 17 | /// 18 | 19 | /// 20 | /// 21 | 22 | 23 | 24 | /// 25 | /// 26 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCIOTASKIMAGEACCESSDRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcIoTaskImageAccessDrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcIoTaskImageAccessDrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcIoTaskImageAccessDrvW32.idl : IDL source for TcIoTaskImageAccessDrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcIoTaskImageAccessDrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcIoTaskImageAccessDrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcIoTaskImageAccessDrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcIoTaskImageAccessDrvW32 1.0 Type Library") 24 | ] 25 | library TCIOTASKIMAGEACCESSDRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcIoTaskImageAccessDrvCtrl Class") 33 | ] 34 | coclass TcIoTaskImageAccessDrvCtrl 35 | { 36 | [default] interface ITcIoTaskImageAccessDrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | //tutorial code 15 | #ifdef _ATL_STATIC_REGISTRY 16 | #include 17 | #include 18 | #endif 19 | #ifdef WIN32_RUNTIME 20 | #include 21 | #endif -------------------------------------------------------------------------------- /S02-CyclicIOTask/TwinCAT Project with Cyclic IOTaskImage Access/TcIoTaskImageAccessDrv/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S03-ADSClient/AdsClient/ClassDiagram1.cd: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /S03-ADSClient/AdsClient/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Windows.Forms; 5 | 6 | namespace adsClientVisu 7 | { 8 | static class Program 9 | { 10 | /// 11 | /// The main entry point for the application. 12 | /// 13 | [STAThread] 14 | static void Main() 15 | { 16 | Application.EnableVisualStyles(); 17 | Application.SetCompatibleTextRenderingDefault(false); 18 | Application.Run(new form()); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /S03-ADSClient/AdsClient/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace adsClientVisu.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /S03-ADSClient/AdsClient/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /S03-ADSClient/AdsClient/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /S03-ADSClient/S03-AdsClientUI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "adsClientVisu", "AdsClient\adsClientVisu.csproj", "{0D06F741-BBFC-4F8B-905E-4EE1F8E17F98}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {0D06F741-BBFC-4F8B-905E-4EE1F8E17F98}.Debug|x86.ActiveCfg = Debug|x86 13 | {0D06F741-BBFC-4F8B-905E-4EE1F8E17F98}.Debug|x86.Build.0 = Debug|x86 14 | {0D06F741-BBFC-4F8B-905E-4EE1F8E17F98}.Release|x86.ActiveCfg = Release|x86 15 | {0D06F741-BBFC-4F8B-905E-4EE1F8E17F98}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcAccessCoESdoViaAdsDrv.rc 4 | #define IDS_TCACCESSCOESDOVIAADSDRV 100 5 | #define IDR_TCACCESSCOESDOVIAADSDRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAccessCoESdoViaAdsDrvClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcAccessCoESdoViaAdsDrvClassFactory.h" 7 | #include "TcAccessCoESdoViaAdsDrvServices.h" 8 | #include "TcSdoAccessModul.h" 9 | 10 | BEGIN_CLASS_MAP(CTcAccessCoESdoViaAdsDrvClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_TcAccessCoESdoViaAdsDrvCTcSdoAccessModul, SRVNAME_TCACCESSCOESDOVIAADSDRV "!CTcSdoAccessModul", CTcSdoAccessModul) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CTcAccessCoESdoViaAdsDrvClassFactory::CTcAccessCoESdoViaAdsDrvClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCACCESSCOESDOVIAADSDRV)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAccessCoESdoViaAdsDrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcAccessCoESdoViaAdsDrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcAccessCoESdoViaAdsDrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcAccessCoESdoViaAdsDrvCtrl.cpp : Implementation of CTcTcAccessCoESdoViaAdsDrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcAccessCoESdoViaAdsDrvW32.h" 6 | #include "TcAccessCoESdoViaAdsDrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcAccessCoESdoViaAdsDrvCtrl 10 | 11 | CTcAccessCoESdoViaAdsDrvCtrl::CTcAccessCoESdoViaAdsDrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcAccessCoESdoViaAdsDrvCtrl::~CTcAccessCoESdoViaAdsDrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAccessCoESdoViaAdsDrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcAccessCoESdoViaAdsDrvDriver.h" 7 | #include "TcAccessCoESdoViaAdsDrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCACCESSCOESDOVIAADSDRVDRV) 10 | 11 | IOSTATUS CTcAccessCoESdoViaAdsDrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcAccessCoESdoViaAdsDrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcAccessCoESdoViaAdsDrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcAccessCoESdoViaAdsDrvDriver::TCACCESSCOESDOVIAADSDRVDRV_GetVersion( ) 25 | { 26 | return( (TCACCESSCOESDOVIAADSDRVDRV_Major << 8) | TCACCESSCOESDOVIAADSDRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAccessCoESdoViaAdsDrvDriver.h 3 | 4 | #ifndef __TCACCESSCOESDOVIAADSDRVDRIVER_H__ 5 | #define __TCACCESSCOESDOVIAADSDRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCACCESSCOESDOVIAADSDRVDRV_NAME "TCACCESSCOESDOVIAADSDRV" 14 | #define TCACCESSCOESDOVIAADSDRVDRV_Major 1 15 | #define TCACCESSCOESDOVIAADSDRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcAccessCoESdoViaAdsDrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcAccessCoESdoViaAdsDrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCACCESSCOESDOVIAADSDRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCACCESSCOESDOVIAADSDRVDRV) 35 | VxD_Service( TCACCESSCOESDOVIAADSDRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCACCESSCOESDOVIAADSDRVDRIVER_H__ -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAccessCoESdoViaAdsDrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcAccessCoESdoViaAdsDrvServices.h" 9 | 10 | /// 11 | /// 12 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCACCESSCOESDOVIAADSDRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcAccessCoESdoViaAdsDrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcAccessCoESdoViaAdsDrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcAccessCoESdoViaAdsDrvW32.idl : IDL source for TcAccessCoESdoViaAdsDrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcAccessCoESdoViaAdsDrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcAccessCoESdoViaAdsDrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcAccessCoESdoViaAdsDrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcAccessCoESdoViaAdsDrvW32 1.0 Type Library") 24 | ] 25 | library TCACCESSCOESDOVIAADSDRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcAccessCoESdoViaAdsDrvCtrl Class") 33 | ] 34 | coclass TcAccessCoESdoViaAdsDrvCtrl 35 | { 36 | [default] interface ITcAccessCoESdoViaAdsDrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S05-CoEAccess/TwinCAT Project with CoE Access/TcAccessCoESdoViaAdsDrv/TcSdoAccessModulAds.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TcDef.h" 4 | 5 | enum TcSdoAccessModulIndexGroups : ULONG 6 | { 7 | TcSdoAccessModulIndexGroup1 = 0x00000001, 8 | TcSdoAccessModulIndexGroup2 = 0x00000002 9 | }; 10 | 11 | enum TcSdoAccessModulIndexOffsets : ULONG 12 | { 13 | TcSdoAccessModulIndexOffset1 = 0x00000001, 14 | TcSdoAccessModulIndexOffset2 = 0x00000002 15 | }; 16 | -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TC3 S06 AdsSymbolSample", "S06-TwinCAT-ADS-UI-Client\TC3 S06 AdsSymbolSample.csproj", "{200C9205-3DAE-4C99-B709-6BBF40680B09}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {200C9205-3DAE-4C99-B709-6BBF40680B09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {200C9205-3DAE-4C99-B709-6BBF40680B09}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {200C9205-3DAE-4C99-B709-6BBF40680B09}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {200C9205-3DAE-4C99-B709-6BBF40680B09}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/App.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/App.ico -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.269 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace AdsSymbolSample.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/TC3 S06 AdsSymbolSample.csproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | publish\ 5 | 6 | 7 | 8 | 9 | 10 | en-US 11 | false 12 | 13 | -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/AdsSymbolSample.Properties.Resources.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/AdsSymbolSample.Properties.Resources.resources -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/AdsSymbolSample.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/AdsSymbolSample.exe -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/AdsSymbolSample.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/AdsSymbolSample.pdb -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/GenerateResource.read.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/GenerateResource.read.1.tlog -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/GenerateResource.write.1.tlog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/GenerateResource.write.1.tlog -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/ResolveAssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/ResolveAssemblyReference.cache -------------------------------------------------------------------------------- /S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/Sample06.Form1.resources: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S06-SymbolUploadClient/S06-TwinCAT-ADS-UI-Client/obj/Debug/Sample06.Form1.resources -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ModuleReceiverAds.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TcDef.h" 4 | 5 | enum ModuleReceiverIndexGroups : ULONG 6 | { 7 | ModuleReceiverIndexGroup1 = 0x00000001, 8 | ModuleReceiverIndexGroup2 = 0x00000002 9 | }; 10 | 11 | enum ModuleReceiverIndexOffsets : ULONG 12 | { 13 | ModuleReceiverIndexOffset1 = 0x00000001, 14 | ModuleReceiverIndexOffset2 = 0x00000002 15 | }; 16 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/Receiver.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // ReceiverClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "ReceiverClassFactory.h" 7 | #include "ReceiverServices.h" 8 | #include "ModuleReceiver.h" 9 | 10 | BEGIN_CLASS_MAP(CReceiverClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_ReceiverCModuleReceiver, SRVNAME_RECEIVER "!CModuleReceiver", CModuleReceiver) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CReceiverClassFactory::CReceiverClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_RECEIVER)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Receiver.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CReceiverClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CReceiverClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverCtrl.cpp: -------------------------------------------------------------------------------- 1 | // ReceiverCtrl.cpp : Implementation of CTcReceiverCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "ReceiverW32.h" 6 | #include "ReceiverCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CReceiverCtrl 10 | 11 | CReceiverCtrl::CReceiverCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CReceiverCtrl::~CReceiverCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverCtrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // ReceiverCtrl.h 3 | 4 | #ifndef __RECEIVERCTRL_H__ 5 | #define __RECEIVERCTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define RECEIVERDRV_NAME "RECEIVER" 11 | 12 | #include "resource.h" // main symbols 13 | #include "ReceiverW32.h" 14 | #include "TcBase.h" 15 | #include "ReceiverClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CReceiverCtrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public IReceiverCtrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CReceiverCtrl(); 26 | virtual ~CReceiverCtrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_RECEIVERCTRL) 29 | DECLARE_NOT_AGGREGATABLE(CReceiverCtrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CReceiverCtrl) 34 | COM_INTERFACE_ENTRY(IReceiverCtrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __RECEIVERCTRL_H__ 42 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // ReceiverDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "ReceiverDriver.h" 7 | #include "ReceiverClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(RECEIVERDRV) 10 | 11 | IOSTATUS CReceiverDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CReceiverClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CReceiverDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CReceiverDriver::RECEIVERDRV_GetVersion( ) 25 | { 26 | return( (RECEIVERDRV_Major << 8) | RECEIVERDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // ReceiverDriver.h 3 | 4 | #ifndef __RECEIVERDRIVER_H__ 5 | #define __RECEIVERDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define RECEIVERDRV_NAME "RECEIVER" 14 | #define RECEIVERDRV_Major 1 15 | #define RECEIVERDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CReceiverDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CReceiverDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl RECEIVERDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(RECEIVERDRV) 35 | VxD_Service( RECEIVERDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __RECEIVERDRIVER_H__ -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // ReceiverInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "ReceiverServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverW32.def: -------------------------------------------------------------------------------- 1 | ; RECEIVERW32.def : Declares the module parameters. 2 | 3 | LIBRARY "ReceiverW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/ReceiverW32.idl: -------------------------------------------------------------------------------- 1 | // ReceiverW32.idl : IDL source for ReceiverW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (ReceiverW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("IReceiver Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface IReceiverCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("ReceiverW32 1.0 Type Library") 24 | ] 25 | library RECEIVERW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("ReceiverCtrl Class") 33 | ] 34 | coclass ReceiverCtrl 35 | { 36 | [default] interface IReceiverCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Receiver.rc 4 | #define IDS_RECEIVER 100 5 | #define IDR_RECEIVERCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/Receiver/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/VarProvider/POUs/MAIN.TcPOU: -------------------------------------------------------------------------------- 1 |  2 | 3 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/VarProvider/PlcTask.TcTTO: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 10000 5 | 20 6 | 7 | MAIN 8 | 9 | {692c8a8c-ee5f-4e25-b73a-ce9745d87d99} 10 | {9039fbc4-d1e8-4f10-aac9-63d930f3fd15} 11 | {8a81c7e2-4adb-4246-928d-dab74c19d195} 12 | {efb1e530-0463-4ae2-8c95-fd69b943dfc5} 13 | {87fc8141-ccd4-4433-94e9-b570956be7f4} 14 | 15 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/VarProvider/Untitled2 Instance Mappings.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/VarProvider/VarProvider.bootinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S07-AdsNotifications/TwinCAT Project AdsNotifications/VarProvider/VarProvider.bootinfo -------------------------------------------------------------------------------- /S07-AdsNotifications/TwinCAT Project AdsNotifications/VarProvider/VarProvider.compileinfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S07-AdsNotifications/TwinCAT Project AdsNotifications/VarProvider/VarProvider.compileinfo -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/SampleRPC/SampleRPC.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Untitled1.rc 4 | #define IDS_UNTITLED1 100 5 | #define IDR_UNTITLED1CTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TwincatRemoteDebugger 5 | 6 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1ClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1ClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "Untitled1ClassFactory.h" 7 | #include "Untitled1Services.h" 8 | #include "Untitled1Version.h" 9 | #include "Module1.h" 10 | 11 | BEGIN_CLASS_MAP(CUntitled1ClassFactory) 12 | /// 13 | CLASS_ENTRY(CID_Untitled1CModule1, SRVNAME_UNTITLED1 "!CModule1", CModule1) 14 | /// 15 | END_CLASS_MAP() 16 | 17 | CUntitled1ClassFactory::CUntitled1ClassFactory() : CObjClassFactory() 18 | { 19 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_UNTITLED1)); 20 | #if defined(TCDBG_UNIT_VERSION) 21 | TcDbgUnitSetVersion(TCDBG_UNIT_VERSION(Untitled1)); 22 | #endif //defined(TCDBG_UNIT_VERSION) 23 | } 24 | 25 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1ClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CUntitled1ClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CUntitled1ClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1Ctrl.cpp: -------------------------------------------------------------------------------- 1 | // Untitled1Ctrl.cpp : Implementation of CTcUntitled1Ctrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "Untitled1W32.h" 6 | #include "Untitled1Ctrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CUntitled1Ctrl 10 | 11 | CUntitled1Ctrl::CUntitled1Ctrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CUntitled1Ctrl::~CUntitled1Ctrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1Ctrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Ctrl.h 3 | 4 | #ifndef __UNTITLED1CTRL_H__ 5 | #define __UNTITLED1CTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define UNTITLED1DRV_NAME "UNTITLED1" 11 | 12 | #include "resource.h" // main symbols 13 | #include "Untitled1W32.h" 14 | #include "TcBase.h" 15 | #include "Untitled1ClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CUntitled1Ctrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public IUntitled1Ctrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CUntitled1Ctrl(); 26 | virtual ~CUntitled1Ctrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_UNTITLED1CTRL) 29 | DECLARE_NOT_AGGREGATABLE(CUntitled1Ctrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CUntitled1Ctrl) 34 | COM_INTERFACE_ENTRY(IUntitled1Ctrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __UNTITLED1CTRL_H__ 42 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1Driver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Driver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "Untitled1Driver.h" 7 | #include "Untitled1ClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(UNTITLED1DRV) 10 | 11 | IOSTATUS CUntitled1Driver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CUntitled1ClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CUntitled1Driver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CUntitled1Driver::UNTITLED1DRV_GetVersion( ) 25 | { 26 | return( (UNTITLED1DRV_Major << 8) | UNTITLED1DRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1Driver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // Untitled1Driver.h 3 | 4 | #ifndef __UNTITLED1DRIVER_H__ 5 | #define __UNTITLED1DRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define UNTITLED1DRV_NAME "UNTITLED1" 14 | #define UNTITLED1DRV_Major 1 15 | #define UNTITLED1DRV_Minor 0 16 | 17 | #define DEVICE_CLASS CUntitled1Driver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CUntitled1Driver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl UNTITLED1DRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(UNTITLED1DRV) 35 | VxD_Service( UNTITLED1DRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __UNTITLED1DRIVER_H__ -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1W32.def: -------------------------------------------------------------------------------- 1 | ; UNTITLED1W32.def : Declares the module parameters. 2 | 3 | LIBRARY "Untitled1W32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S08-ADSRPC/TwinCAT RPCSample/TwinCAT Project1/Untitled1/Untitled1W32.idl: -------------------------------------------------------------------------------- 1 | // Untitled1W32.idl : IDL source for Untitled1W32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (Untitled1W32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("IUntitled1 Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface IUntitled1Ctrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("Untitled1W32 1.0 Type Library") 24 | ] 25 | library UNTITLED1W32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("Untitled1Ctrl Class") 33 | ] 34 | coclass Untitled1Ctrl 35 | { 36 | [default] interface IUntitled1Ctrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/ModuleDataInOut.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // ModuleDataInOut.h 3 | #pragma once 4 | 5 | #include "TcDataPointerSampleDrvInterfaces.h" 6 | 7 | class CModuleDataInOut 8 | : public ITComObject 9 | , public ITcADI 10 | , public ITcWatchSource 11 | /// 12 | /// 13 | { 14 | public: 15 | DECLARE_IUNKNOWN() 16 | DECLARE_IPERSIST(CID_TcDataPointerSampleDrvCModuleDataInOut) 17 | DECLARE_ITCOMOBJECT_LOCKOP() 18 | DECLARE_ITCADI() 19 | DECLARE_ITCWATCHSOURCE() 20 | DECLARE_OBJPARAWATCH_MAP() 21 | DECLARE_OBJDATAAREA_MAP() 22 | 23 | CModuleDataInOut(); 24 | virtual ~CModuleDataInOut(); 25 | 26 | /// 27 | /// 28 | 29 | protected: 30 | DECLARE_ITCOMOBJECT_SETSTATE(); 31 | 32 | /// 33 | ModuleDataInOutInputSource m_InputSource; 34 | ModuleDataInOutOutputDestination m_OutputDestination; 35 | /// 36 | }; 37 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcDataPointerSampleDrv.rc 4 | #define IDS_TCDATAPOINTERSAMPLEDRV 100 5 | #define IDR_TCDATAPOINTERSAMPLEDRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TwincatRemoteDebugger 5 | 6 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcDataPointerSampleDrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcDataPointerSampleDrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcDataPointerSampleDrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcDataPointerSampleDrvCtrl.cpp : Implementation of CTcTcDataPointerSampleDrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcDataPointerSampleDrvW32.h" 6 | #include "TcDataPointerSampleDrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcDataPointerSampleDrvCtrl 10 | 11 | CTcDataPointerSampleDrvCtrl::CTcDataPointerSampleDrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcDataPointerSampleDrvCtrl::~CTcDataPointerSampleDrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcDataPointerSampleDrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcDataPointerSampleDrvDriver.h" 7 | #include "TcDataPointerSampleDrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCDATAPOINTERSAMPLEDRVDRV) 10 | 11 | IOSTATUS CTcDataPointerSampleDrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcDataPointerSampleDrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcDataPointerSampleDrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcDataPointerSampleDrvDriver::TCDATAPOINTERSAMPLEDRVDRV_GetVersion( ) 25 | { 26 | return( (TCDATAPOINTERSAMPLEDRVDRV_Major << 8) | TCDATAPOINTERSAMPLEDRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcDataPointerSampleDrvDriver.h 3 | 4 | #ifndef __TCDATAPOINTERSAMPLEDRVDRIVER_H__ 5 | #define __TCDATAPOINTERSAMPLEDRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCDATAPOINTERSAMPLEDRVDRV_NAME "TCDATAPOINTERSAMPLEDRV" 14 | #define TCDATAPOINTERSAMPLEDRVDRV_Major 1 15 | #define TCDATAPOINTERSAMPLEDRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcDataPointerSampleDrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcDataPointerSampleDrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCDATAPOINTERSAMPLEDRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCDATAPOINTERSAMPLEDRVDRV) 35 | VxD_Service( TCDATAPOINTERSAMPLEDRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCDATAPOINTERSAMPLEDRVDRIVER_H__ -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcDataPointerSampleDrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcDataPointerSampleDrvServices.h" 9 | 10 | /// 11 | /// 12 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCDATAPOINTERSAMPLEDRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcDataPointerSampleDrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcDataPointerSampleDrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcDataPointerSampleDrvW32.idl : IDL source for TcDataPointerSampleDrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcDataPointerSampleDrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcDataPointerSampleDrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcDataPointerSampleDrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcDataPointerSampleDrvW32 1.0 Type Library") 24 | ] 25 | library TCDATAPOINTERSAMPLEDRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcDataPointerSampleDrvCtrl Class") 33 | ] 34 | coclass TcDataPointerSampleDrvCtrl 35 | { 36 | [default] interface ITcDataPointerSampleDrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S10-Mod2ModDataPointer/TwinCAT Project with DataPointer/TcDataPointerSampleDrv/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/ModuleDataProvider.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // ModuleDataProvider.h 3 | #pragma once 4 | 5 | #include "TcConcurrentDADrvInterfaces.h" 6 | #include "TcRtInterfaces.h" 7 | 8 | class CModuleDataProvider 9 | : public ITComObject 10 | , public ITcADI 11 | , public ITcWatchSource 12 | /// 13 | , public IDataRead 14 | , public IDataWrite 15 | /// 16 | { 17 | public: 18 | DECLARE_IUNKNOWN() 19 | DECLARE_IPERSIST(CID_TcConcurrentDADrvCModuleDataProvider) 20 | DECLARE_ITCOMOBJECT_LOCKOP() 21 | DECLARE_ITCADI() 22 | DECLARE_ITCWATCHSOURCE() 23 | DECLARE_OBJPARAWATCH_MAP() 24 | DECLARE_OBJDATAAREA_MAP() 25 | 26 | CModuleDataProvider(); 27 | virtual ~CModuleDataProvider(); 28 | 29 | /// 30 | // IDataRead 31 | virtual HRESULT TCOMAPI Retrieve(DataTypeCustom* pData); 32 | 33 | // IDataWrite 34 | virtual HRESULT TCOMAPI Store(DataTypeCustom* pData); 35 | 36 | /// 37 | 38 | protected: 39 | DECLARE_ITCOMOBJECT_SETSTATE(); 40 | 41 | /// 42 | ModuleDataProviderProvided m_Provided; 43 | /// 44 | 45 | CCriticalSectionInstance m_csInstance; 46 | }; 47 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcConcurrentDADrv.rc 4 | #define IDS_TCCONCURRENTDADRV 100 5 | #define IDR_TCCONCURRENTDADRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrv.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrv.aps -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TwincatRemoteDebugger 5 | 6 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcConcurrentDADrvClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcConcurrentDADrvClassFactory.h" 7 | #include "TcConcurrentDADrvServices.h" 8 | #include "ModuleDataWrite.h" 9 | #include "ModuleDataRead.h" 10 | #include "ModuleDataProvider.h" 11 | 12 | BEGIN_CLASS_MAP(CTcConcurrentDADrvClassFactory) 13 | /// 14 | CLASS_ENTRY(CID_TcConcurrentDADrvCModuleDataWrite, SRVNAME_TCCONCURRENTDADRV "!CModuleDataWrite", CModuleDataWrite) 15 | CLASS_ENTRY(CID_TcConcurrentDADrvCModuleDataRead, SRVNAME_TCCONCURRENTDADRV "!CModuleDataRead", CModuleDataRead) 16 | CLASS_ENTRY(CID_TcConcurrentDADrvCModuleDataProvider, SRVNAME_TCCONCURRENTDADRV "!CModuleDataProvider", CModuleDataProvider) 17 | /// 18 | END_CLASS_MAP() 19 | 20 | CTcConcurrentDADrvClassFactory::CTcConcurrentDADrvClassFactory() : CObjClassFactory() 21 | { 22 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCCONCURRENTDADRV)); 23 | } 24 | 25 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcConcurrentDADrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcConcurrentDADrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcConcurrentDADrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcConcurrentDADrvCtrl.cpp : Implementation of CTcTcConcurrentDADrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcConcurrentDADrvW32.h" 6 | #include "TcConcurrentDADrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcConcurrentDADrvCtrl 10 | 11 | CTcConcurrentDADrvCtrl::CTcConcurrentDADrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcConcurrentDADrvCtrl::~CTcConcurrentDADrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcConcurrentDADrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcConcurrentDADrvDriver.h" 7 | #include "TcConcurrentDADrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCCONCURRENTDADRVDRV) 10 | 11 | IOSTATUS CTcConcurrentDADrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcConcurrentDADrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcConcurrentDADrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcConcurrentDADrvDriver::TCCONCURRENTDADRVDRV_GetVersion( ) 25 | { 26 | return( (TCCONCURRENTDADRVDRV_Major << 8) | TCCONCURRENTDADRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcConcurrentDADrvDriver.h 3 | 4 | #ifndef __TCCONCURRENTDADRVDRIVER_H__ 5 | #define __TCCONCURRENTDADRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCCONCURRENTDADRVDRV_NAME "TCCONCURRENTDADRV" 14 | #define TCCONCURRENTDADRVDRV_Major 1 15 | #define TCCONCURRENTDADRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcConcurrentDADrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcConcurrentDADrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCCONCURRENTDADRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCCONCURRENTDADRVDRV) 35 | VxD_Service( TCCONCURRENTDADRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCCONCURRENTDADRVDRIVER_H__ -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcConcurrentDADrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcConcurrentDADrvServices.h" 9 | 10 | /// 11 | #if !defined(_TC_TYPE_6663D11C_9744_493C_B1AF_05E9C6C02C9F_INCLUDED_) 12 | #define _TC_TYPE_6663D11C_9744_493C_B1AF_05E9C6C02C9F_INCLUDED_ 13 | struct __declspec(novtable) IDataWrite : public ITcUnknown 14 | { 15 | virtual HRESULT TCOMAPI Store(DataTypeCustom* pData)=0; 16 | }; 17 | _TCOM_SMARTPTR_TYPEDEF(IDataWrite, IID_IDataWrite); 18 | #endif // !defined(_TC_TYPE_6663D11C_9744_493C_B1AF_05E9C6C02C9F_INCLUDED_) 19 | 20 | #if !defined(_TC_TYPE_2E73160F_C0F2_496E_A5AD_3578A6AF14EF_INCLUDED_) 21 | #define _TC_TYPE_2E73160F_C0F2_496E_A5AD_3578A6AF14EF_INCLUDED_ 22 | struct __declspec(novtable) IDataRead : public ITcUnknown 23 | { 24 | virtual HRESULT TCOMAPI Retrieve(DataTypeCustom* pData)=0; 25 | }; 26 | _TCOM_SMARTPTR_TYPEDEF(IDataRead, IID_IDataRead); 27 | #endif // !defined(_TC_TYPE_2E73160F_C0F2_496E_A5AD_3578A6AF14EF_INCLUDED_) 28 | 29 | /// 30 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCCONCURRENTDADRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcConcurrentDADrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcConcurrentDADrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcConcurrentDADrvW32.idl : IDL source for TcConcurrentDADrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcConcurrentDADrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcConcurrentDADrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcConcurrentDADrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcConcurrentDADrvW32 1.0 Type Library") 24 | ] 25 | library TCCONCURRENTDADRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcConcurrentDADrvCtrl Class") 33 | ] 34 | coclass TcConcurrentDADrvCtrl 35 | { 36 | [default] interface ITcConcurrentDADrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S11a-Mod2ModCS/TwinCAT Project Concurrent DA/TcConcurrentDADrv/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOut.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // InToOutClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "InToOutClassFactory.h" 7 | #include "InToOutServices.h" 8 | #include "ModuleInToOut.h" 9 | 10 | BEGIN_CLASS_MAP(CInToOutClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_InToOutCModuleInToOut, SRVNAME_INTOOUT "!CModuleInToOut", CModuleInToOut) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CInToOutClassFactory::CInToOutClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_INTOOUT)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // InToOut.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CInToOutClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CInToOutClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutCtrl.cpp: -------------------------------------------------------------------------------- 1 | // InToOutCtrl.cpp : Implementation of CTcInToOutCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "InToOutW32.h" 6 | #include "InToOutCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CInToOutCtrl 10 | 11 | CInToOutCtrl::CInToOutCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CInToOutCtrl::~CInToOutCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutCtrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // InToOutCtrl.h 3 | 4 | #ifndef __INTOOUTCTRL_H__ 5 | #define __INTOOUTCTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define INTOOUTDRV_NAME "INTOOUT" 11 | 12 | #include "resource.h" // main symbols 13 | #include "InToOutW32.h" 14 | #include "TcBase.h" 15 | #include "InToOutClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CInToOutCtrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public IInToOutCtrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CInToOutCtrl(); 26 | virtual ~CInToOutCtrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_INTOOUTCTRL) 29 | DECLARE_NOT_AGGREGATABLE(CInToOutCtrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CInToOutCtrl) 34 | COM_INTERFACE_ENTRY(IInToOutCtrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __INTOOUTCTRL_H__ 42 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // InToOutDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "InToOutDriver.h" 7 | #include "InToOutClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(INTOOUTDRV) 10 | 11 | IOSTATUS CInToOutDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CInToOutClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CInToOutDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CInToOutDriver::INTOOUTDRV_GetVersion( ) 25 | { 26 | return( (INTOOUTDRV_Major << 8) | INTOOUTDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // InToOutDriver.h 3 | 4 | #ifndef __INTOOUTDRIVER_H__ 5 | #define __INTOOUTDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define INTOOUTDRV_NAME "INTOOUT" 14 | #define INTOOUTDRV_Major 1 15 | #define INTOOUTDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CInToOutDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CInToOutDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl INTOOUTDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(INTOOUTDRV) 35 | VxD_Service( INTOOUTDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __INTOOUTDRIVER_H__ -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // InToOutInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "InToOutServices.h" 9 | 10 | /// 11 | /// 12 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // InToOutServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_InToOut = 0x3F000000; 9 | #define SRVNAME_INTOOUT "InToOut" 10 | 11 | /// 12 | const CTCID CID_InToOutCModuleInToOut = {0xd5f52841,0xf281,0x4452,{0xab,0x82,0x50,0xfd,0x93,0xe3,0x38,0x77}}; 13 | /// 14 | 15 | /// 16 | const PTCID PID_ModuleInToOutParameter = 0x00000001; 17 | /// 18 | 19 | /// 20 | typedef struct _ModuleInToOutParameter 21 | { 22 | ULONG data1; 23 | ULONG data2; 24 | double data3; 25 | } ModuleInToOutParameter, *PModuleInToOutParameter; 26 | 27 | typedef struct _ModuleInToOutInputs 28 | { 29 | ULONG Value; 30 | } ModuleInToOutInputs, *PModuleInToOutInputs; 31 | 32 | typedef struct _ModuleInToOutOutputs 33 | { 34 | ULONG Value; 35 | } ModuleInToOutOutputs, *PModuleInToOutOutputs; 36 | 37 | /// 38 | 39 | 40 | 41 | /// 42 | /// 43 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutW32.def: -------------------------------------------------------------------------------- 1 | ; INTOOUTW32.def : Declares the module parameters. 2 | 3 | LIBRARY "InToOutW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/InToOutW32.idl: -------------------------------------------------------------------------------- 1 | // InToOutW32.idl : IDL source for InToOutW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (InToOutW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("IInToOut Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface IInToOutCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("InToOutW32 1.0 Type Library") 24 | ] 25 | library INTOOUTW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("InToOutCtrl Class") 33 | ] 34 | coclass InToOutCtrl 35 | { 36 | [default] interface IInToOutCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by InToOut.rc 4 | #define IDS_INTOOUT 100 5 | #define IDR_INTOOUTCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S12-Mod2ModIOMapping/TwinCAT Project ModuleCom IOMapping/InToOut/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcFileTestDrv.rc 4 | #define IDS_TCFILETESTDRV 100 5 | #define IDR_TCFILETESTDRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrv.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrv.aps -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcFileTestDrvClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcFileTestDrvClassFactory.h" 7 | #include "TcFileTestDrvServices.h" 8 | #include "TcFileTestDrv.h" 9 | 10 | BEGIN_CLASS_MAP(CTcFileTestDrvClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_TcFileTestDrvCTcFileTestDrv, SRVNAME_TCFILETESTDRV "!CTcFileTestDrv", CTcFileTestDrv) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CTcFileTestDrvClassFactory::CTcFileTestDrvClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCFILETESTDRV)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcFileTestDrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcFileTestDrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcFileTestDrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcFileTestDrvCtrl.cpp : Implementation of CTcTcFileTestDrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcFileTestDrvW32.h" 6 | #include "TcFileTestDrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcFileTestDrvCtrl 10 | 11 | CTcFileTestDrvCtrl::CTcFileTestDrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcFileTestDrvCtrl::~CTcFileTestDrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvCtrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcFileTestDrvCtrl.h 3 | 4 | #ifndef __TCFILETESTDRVCTRL_H__ 5 | #define __TCFILETESTDRVCTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define TCFILETESTDRVDRV_NAME "TCFILETESTDRV" 11 | 12 | #include "resource.h" // main symbols 13 | #include "TcFileTestDrvW32.h" 14 | #include "TcBase.h" 15 | #include "TcFileTestDrvClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CTcFileTestDrvCtrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public ITcFileTestDrvCtrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CTcFileTestDrvCtrl(); 26 | virtual ~CTcFileTestDrvCtrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_TCFILETESTDRVCTRL) 29 | DECLARE_NOT_AGGREGATABLE(CTcFileTestDrvCtrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CTcFileTestDrvCtrl) 34 | COM_INTERFACE_ENTRY(ITcFileTestDrvCtrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __TCFILETESTDRVCTRL_H__ 42 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcFileTestDrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcFileTestDrvDriver.h" 7 | #include "TcFileTestDrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCFILETESTDRVDRV) 10 | 11 | IOSTATUS CTcFileTestDrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcFileTestDrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcFileTestDrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcFileTestDrvDriver::TCFILETESTDRVDRV_GetVersion( ) 25 | { 26 | return( (TCFILETESTDRVDRV_Major << 8) | TCFILETESTDRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcFileTestDrvDriver.h 3 | 4 | #ifndef __TCFILETESTDRVDRIVER_H__ 5 | #define __TCFILETESTDRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCFILETESTDRVDRV_NAME "TCFILETESTDRV" 14 | #define TCFILETESTDRVDRV_Major 1 15 | #define TCFILETESTDRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcFileTestDrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcFileTestDrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCFILETESTDRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCFILETESTDRVDRV) 35 | VxD_Service( TCFILETESTDRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCFILETESTDRVDRIVER_H__ -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcFileTestDrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "TcFileTestDrvServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcFileTestDrvServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_TcFileTestDrv = 0x3F000000; 9 | #define SRVNAME_TCFILETESTDRV "TcFileTestDrv" 10 | 11 | /// 12 | const CTCID CID_TcFileTestDrvCTcFileTestDrv = {0xdcf83596,0x249e,0x46f1,{0x92,0x3a,0xbd,0xf8,0xe6,0xbd,0x08,0x07}}; 13 | /// 14 | 15 | /// 16 | const PTCID PID_TcFileTestDrvParameter = 0x00000001; 17 | /// 18 | 19 | /// 20 | typedef struct _TcFileTestDrvParameter 21 | { 22 | ULONG data1; 23 | ULONG data2; 24 | double data3; 25 | } TcFileTestDrvParameter, *PTcFileTestDrvParameter; 26 | 27 | typedef struct _TcFileTestDrvInputs 28 | { 29 | ULONG Value; 30 | ULONG Status; 31 | ULONG Data; 32 | } TcFileTestDrvInputs, *PTcFileTestDrvInputs; 33 | 34 | typedef struct _TcFileTestDrvOutputs 35 | { 36 | ULONG Value; 37 | ULONG Control; 38 | ULONG Data; 39 | } TcFileTestDrvOutputs, *PTcFileTestDrvOutputs; 40 | 41 | /// 42 | 43 | 44 | 45 | /// 46 | /// 47 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCFILETESTDRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcFileTestDrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcFileTestDrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcFileTestDrvW32.idl : IDL source for TcFileTestDrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcFileTestDrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcFileTestDrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcFileTestDrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcFileTestDrvW32 1.0 Type Library") 24 | ] 25 | library TCFILETESTDRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcFileTestDrvCtrl Class") 33 | ] 34 | coclass TcFileTestDrvCtrl 35 | { 36 | [default] interface ITcFileTestDrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | #ifdef _ATL_STATIC_REGISTRY 15 | #include 16 | #include 17 | #endif 18 | #ifdef WIN32_RUNTIME 19 | #include 20 | #endif -------------------------------------------------------------------------------- /S19-FileIOSync/TwinCAT Project Sync FileAccess/TcFileTestDrv/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | 10 | 11 | //sample code 12 | #if defined(TC_ENVIROMENT_UM) || defined(TC_ENVIROMENT_CE) 13 | #include 14 | extern CComModule _Module; 15 | #include 16 | #endif //WIN32_RUNTIME 17 | //sample code end 18 | 19 | 20 | #include "TcBase.h" 21 | #include "TcError.h" 22 | #include "OsBase.h" 23 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcAsyncBufferWritingDrv.rc 4 | #define IDS_TCASYNCBUFFERWRITINGDRV 100 5 | #define IDR_TCASYNCBUFFERWRITINGDRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrv.vcxproj.vspscc: -------------------------------------------------------------------------------- 1 | "" 2 | { 3 | "FILE_VERSION" = "9237" 4 | "ENLISTMENT_CHOICE" = "NEVER" 5 | "PROJECT_FILE_RELATIVE_PATH" = "" 6 | "NUMBER_OF_EXCLUDED_FILES" = "0" 7 | "ORIGINAL_PROJECT_FILE_PATH" = "" 8 | "NUMBER_OF_NESTED_PROJECTS" = "0" 9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" 10 | } 11 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAsyncBufferWritingDrvClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcAsyncBufferWritingDrvClassFactory.h" 7 | #include "TcAsyncBufferWritingDrvServices.h" 8 | #include "TcAsyncBufferWritingModule.h" 9 | 10 | BEGIN_CLASS_MAP(CTcAsyncBufferWritingDrvClassFactory) 11 | CLASS_ENTRY(CID_TcAsyncBufferWritingDrvCTcAsyncBufferWritingModule, SRVNAME_TCASYNCBUFFERWRITINGDRV "!CTcAsyncBufferWritingModule", CTcAsyncBufferWritingModule) 12 | /// 13 | CLASS_ENTRY(CID_TcAsyncBufferWritingDrvCTcAsyncBufferWritingModule, SRVNAME_TCASYNCBUFFERWRITINGDRV "!CTcAsyncBufferWritingModule", CTcAsyncBufferWritingModule) 14 | /// 15 | END_CLASS_MAP() 16 | 17 | CTcAsyncBufferWritingDrvClassFactory::CTcAsyncBufferWritingDrvClassFactory() : CObjClassFactory() 18 | { 19 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCASYNCBUFFERWRITINGDRV)); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAsyncBufferWritingDrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcAsyncBufferWritingDrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcAsyncBufferWritingDrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcAsyncBufferWritingDrvCtrl.cpp : Implementation of CTcTcAsyncBufferWritingDrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcAsyncBufferWritingDrvW32.h" 6 | #include "TcAsyncBufferWritingDrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcAsyncBufferWritingDrvCtrl 10 | 11 | CTcAsyncBufferWritingDrvCtrl::CTcAsyncBufferWritingDrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcAsyncBufferWritingDrvCtrl::~CTcAsyncBufferWritingDrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAsyncBufferWritingDrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcAsyncBufferWritingDrvDriver.h" 7 | #include "TcAsyncBufferWritingDrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCASYNCBUFFERWRITINGDRVDRV) 10 | 11 | IOSTATUS CTcAsyncBufferWritingDrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcAsyncBufferWritingDrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcAsyncBufferWritingDrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcAsyncBufferWritingDrvDriver::TCASYNCBUFFERWRITINGDRVDRV_GetVersion( ) 25 | { 26 | return( (TCASYNCBUFFERWRITINGDRVDRV_Major << 8) | TCASYNCBUFFERWRITINGDRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAsyncBufferWritingDrvDriver.h 3 | 4 | #ifndef __TCASYNCBUFFERWRITINGDRVDRIVER_H__ 5 | #define __TCASYNCBUFFERWRITINGDRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCASYNCBUFFERWRITINGDRVDRV_NAME "TCASYNCBUFFERWRITINGDRV" 14 | #define TCASYNCBUFFERWRITINGDRVDRV_Major 1 15 | #define TCASYNCBUFFERWRITINGDRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcAsyncBufferWritingDrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcAsyncBufferWritingDrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCASYNCBUFFERWRITINGDRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCASYNCBUFFERWRITINGDRVDRV) 35 | VxD_Service( TCASYNCBUFFERWRITINGDRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCASYNCBUFFERWRITINGDRVDRIVER_H__ -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcAsyncBufferWritingDrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcAsyncBufferWritingDrvServices.h" 8 | 9 | // defining new interfaces provided by this driver 10 | /* for example 11 | struct __declspec(novtable) ITcAsyncBufferWritingDrvShortName : public ITcUnknown 12 | { 13 | virtual ULONG TCOMAPI DoSomething(ULONG value1, UINT value2=0)=0; 14 | TCOMMETHOD(DoSomethingElse(PVOID ptr)); 15 | }; 16 | _TCOM_SMARTPTR_TYPEDEF(ITcAsyncBufferWritingDrvShortName, IID_ITcAsyncBufferWritingDrvShortName); 17 | */ 18 | 19 | 20 | /// 21 | /// 22 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCASYNCBUFFERWRITINGDRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcAsyncBufferWritingDrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcAsyncBufferWritingDrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcAsyncBufferWritingDrvW32.idl : IDL source for TcAsyncBufferWritingDrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcAsyncBufferWritingDrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcAsyncBufferWritingDrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcAsyncBufferWritingDrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcAsyncBufferWritingDrvW32 1.0 Type Library") 24 | ] 25 | library TCASYNCBUFFERWRITINGDRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcAsyncBufferWritingDrvCtrl Class") 33 | ] 34 | coclass TcAsyncBufferWritingDrvCtrl 35 | { 36 | [default] interface ITcAsyncBufferWritingDrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcFsmFileClose.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TcFileAccessInterfaces.h" 4 | #include "TcFsmFile.h" 5 | 6 | enum eFileCloseState 7 | { 8 | FileCloseError, 9 | FileCloseInit, 10 | FileCloseCheck, 11 | FileCloseFinished 12 | }; 13 | 14 | class CTcFsmFileClose : public TTcFsmFile 15 | { 16 | public: 17 | CTcFsmFileClose(); 18 | HRESULT Init 19 | ( 20 | ITComObjectServer* ipSrv, 21 | ITcFileAccessAsync* ipFileAccessAsync, 22 | TcFileHandle hFile 23 | ); 24 | HRESULT Eval(); 25 | 26 | private: 27 | TcFileHandle m_hFileClose; 28 | }; -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcFsmFileOpen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TcFileAccessInterfaces.h" 4 | #include "TcFsmFile.h" 5 | 6 | enum eFileOpenState 7 | { 8 | FileOpenError, 9 | FileOpenInit, 10 | FileOpenCheck, 11 | FileOpenFinished 12 | }; 13 | 14 | class CTcFsmFileOpen : public TTcFsmFile 15 | { 16 | public: 17 | CTcFsmFileOpen(); 18 | HRESULT Init 19 | ( 20 | ITComObjectServer* ipSrv, 21 | ITcFileAccessAsync* ipFileAccessAsync, 22 | PCCH szFileName, 23 | TcFileAccessMode mode 24 | ); 25 | HRESULT Eval(); 26 | 27 | // output 28 | TcFileHandle GetFileHandle() const { return m_hFileOpen; } 29 | 30 | private: 31 | PCCH m_szFileOpenName; 32 | TcFileAccessMode m_Mode; 33 | TcFileHandle m_hFileOpen; 34 | }; -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcFsmFileWrite.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TcFileAccessInterfaces.h" 4 | #include "TcFsmFile.h" 5 | 6 | enum eFileWriteState 7 | { 8 | FileWriteError, 9 | FileWriteInit, 10 | FileWriteCheck, 11 | FileWriteFinished 12 | }; 13 | 14 | class CTcFsmFileWrite : public TTcFsmFile 15 | { 16 | public: 17 | CTcFsmFileWrite(); 18 | HRESULT Init 19 | ( 20 | ITComObjectServer* ipSrv, 21 | ITcFileAccessAsync* ipFileAccessAsync, 22 | TcFileHandle hFileWrite, 23 | PBYTE pFileWriteBuffer, 24 | ULONG nWriteBuffer 25 | ); 26 | HRESULT Eval(); 27 | 28 | // output 29 | UINT GetFileWriteActually() const { return m_nFileWriteActually; } 30 | 31 | private: 32 | TcFileHandle m_hFileWrite; 33 | PBYTE m_pFileWriteBuffer; 34 | UINT m_nFileWriteBuffer; 35 | UINT m_nFileWriteActually; 36 | }; -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcFsmFileWriter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TcFileAccessInterfaces.h" 4 | #include "TcFsmFile.h" 5 | #include "TcFsmFileOpen.h" 6 | #include "TcFsmFileWrite.h" 7 | #include "TcFsmFileClose.h" 8 | 9 | 10 | enum eStateFileWriter 11 | { 12 | FileWriterError, 13 | FileWriterOpen, 14 | FileWriterWrite, 15 | FileWriterClose, 16 | FileWriterErrorCleanup, 17 | FileWriterFinished 18 | }; 19 | 20 | class CTcFsmFileWriter : public TTcFsmFile 21 | { 22 | public: 23 | CTcFsmFileWriter(); 24 | HRESULT Init 25 | ( 26 | ITComObjectServer* ipSrv, 27 | ITcFileAccessAsync* ipFileAccessAsync, 28 | PCCH szFilename, 29 | PBYTE pBuffer, 30 | ULONG nBuffer 31 | ); 32 | HRESULT Eval(); 33 | 34 | ULONG GetBytesWrittenTotal() { return m_nBytesWrittenTotal; } 35 | 36 | private: 37 | PCCH m_szFilename; 38 | TcFileHandle m_hFileWriter; 39 | PBYTE m_pFileWriterBuffer; 40 | ULONG m_nFileWriterBuffer; 41 | ULONG m_nBytesWrittenTotal; 42 | 43 | CTcFsmFileOpen m_fsmFileOpen; 44 | CTcFsmFileWrite m_fsmFileWrite; 45 | CTcFsmFileClose m_fsmFileClose; 46 | }; -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | // TcPch.cpp : source file that includes just the standard includes 2 | // TcPch.pch will be the pre-compiled header 3 | // TcPch.obj will contain the pre-compiled type information 4 | 5 | #include "TcPch.h" 6 | #pragma hdrstop 7 | #ifdef _ATL_STATIC_REGISTRY 8 | #include 9 | #include 10 | #endif 11 | #ifdef WIN32_RUNTIME 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /S20-FileIOWrite/TwinCAT Project with Async Buffer Writing/TcAsyncBufferWritingDrv/TcPch.h: -------------------------------------------------------------------------------- 1 | // TcPch.h : include file for TwinCAT standard include files, 2 | // or project specific include files that are used frequently, 3 | // but are changed infrequently 4 | 5 | #pragma once 6 | 7 | #include "TcDef.h" 8 | 9 | #if defined(TC_ENVIROMENT_UM) || defined(TC_ENVIROMENT_CE) 10 | #include 11 | extern CComModule _Module; 12 | #include 13 | #endif //WIN32_RUNTIME 14 | 15 | #include "TcBase.h" 16 | #include "TcError.h" 17 | #include "OsBase.h" 18 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcPciIoDrv.rc 4 | #define IDS_TCPCIIODRV 100 5 | #define IDR_TCPCIIODRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPciIoDrvClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcPciIoDrvClassFactory.h" 7 | #include "TcPciIoDrvServices.h" 8 | #include "ModuleDPRAM.h" 9 | 10 | BEGIN_CLASS_MAP(CTcPciIoDrvClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_TcPciIoDrvCModuleDPRAM, SRVNAME_TCPCIIODRV "!CModuleDPRAM", CModuleDPRAM) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CTcPciIoDrvClassFactory::CTcPciIoDrvClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCPCIIODRV)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPciIoDrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcPciIoDrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcPciIoDrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcPciIoDrvCtrl.cpp : Implementation of CTcTcPciIoDrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcPciIoDrvW32.h" 6 | #include "TcPciIoDrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcPciIoDrvCtrl 10 | 11 | CTcPciIoDrvCtrl::CTcPciIoDrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcPciIoDrvCtrl::~CTcPciIoDrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvCtrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPciIoDrvCtrl.h 3 | 4 | #ifndef __TCPCIIODRVCTRL_H__ 5 | #define __TCPCIIODRVCTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define TCPCIIODRVDRV_NAME "TCPCIIODRV" 11 | 12 | #include "resource.h" // main symbols 13 | #include "TcPciIoDrvW32.h" 14 | #include "TcBase.h" 15 | #include "TcPciIoDrvClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CTcPciIoDrvCtrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public ITcPciIoDrvCtrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CTcPciIoDrvCtrl(); 26 | virtual ~CTcPciIoDrvCtrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_TCPCIIODRVCTRL) 29 | DECLARE_NOT_AGGREGATABLE(CTcPciIoDrvCtrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CTcPciIoDrvCtrl) 34 | COM_INTERFACE_ENTRY(ITcPciIoDrvCtrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __TCPCIIODRVCTRL_H__ 42 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPciIoDrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcPciIoDrvDriver.h" 7 | #include "TcPciIoDrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCPCIIODRVDRV) 10 | 11 | IOSTATUS CTcPciIoDrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcPciIoDrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcPciIoDrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcPciIoDrvDriver::TCPCIIODRVDRV_GetVersion( ) 25 | { 26 | return( (TCPCIIODRVDRV_Major << 8) | TCPCIIODRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPciIoDrvDriver.h 3 | 4 | #ifndef __TCPCIIODRVDRIVER_H__ 5 | #define __TCPCIIODRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCPCIIODRVDRV_NAME "TCPCIIODRV" 14 | #define TCPCIIODRVDRV_Major 1 15 | #define TCPCIIODRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcPciIoDrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcPciIoDrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCPCIIODRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCPCIIODRVDRV) 35 | VxD_Service( TCPCIIODRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCPCIIODRVDRIVER_H__ -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPciIoDrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "TcPciIoDrvServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPciIoDrvServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_TcPciIoDrv = 0x3F000000; 9 | #define SRVNAME_TCPCIIODRV "TcPciIoDrv" 10 | 11 | /// 12 | const CTCID CID_TcPciIoDrvCModuleDPRAM = {0x304c8854,0x7aa5,0x4c0b,{0x92,0xaa,0x87,0xa2,0x42,0xf4,0x31,0x73}}; 13 | /// 14 | 15 | /// 16 | const PTCID PID_ModuleDPRAMParameter = 0x00000001; 17 | const PTCID PID_ModuleDPRAMPciDeviceAdi = 0x03002030; 18 | /// 19 | 20 | /// 21 | typedef struct _ModuleDPRAMParameter 22 | { 23 | ULONG ByteOffsetInput; 24 | ULONG ByteOffsetOutput; 25 | } ModuleDPRAMParameter, *PModuleDPRAMParameter; 26 | 27 | typedef struct _ModuleDPRAMInputs 28 | { 29 | ULONG Value; 30 | } ModuleDPRAMInputs, *PModuleDPRAMInputs; 31 | 32 | typedef struct _ModuleDPRAMOutputs 33 | { 34 | ULONG Value; 35 | } ModuleDPRAMOutputs, *PModuleDPRAMOutputs; 36 | 37 | /// 38 | 39 | 40 | 41 | /// 42 | /// 43 | -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCPCIIODRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcPciIoDrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S22-ADD/TwinCAT Project with DPRAM/TcPciIoDrv/TcPciIoDrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcPciIoDrvW32.idl : IDL source for TcPciIoDrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcPciIoDrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcPciIoDrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcPciIoDrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcPciIoDrvW32 1.0 Type Library") 24 | ] 25 | library TCPCIIODRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcPciIoDrvCtrl Class") 33 | ] 34 | coclass TcPciIoDrvCtrl 35 | { 36 | [default] interface ITcPciIoDrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by SEHSample.rc 4 | #define IDS_SEHSAMPLE 100 5 | #define IDR_SEHSAMPLECTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSample.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SEHSampleClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "SEHSampleClassFactory.h" 7 | #include "SEHSampleServices.h" 8 | #include "SEHSampleVersion.h" 9 | #include "SEHModule.h" 10 | 11 | BEGIN_CLASS_MAP(CSEHSampleClassFactory) 12 | /// 13 | CLASS_ENTRY(CID_SEHSampleCSEHModule, SRVNAME_SEHSAMPLE "!CSEHModule", CSEHModule) 14 | /// 15 | END_CLASS_MAP() 16 | 17 | CSEHSampleClassFactory::CSEHSampleClassFactory() : CObjClassFactory() 18 | { 19 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_SEHSAMPLE)); 20 | #if defined(TCDBG_UNIT_VERSION) 21 | TcDbgUnitSetVersion(TCDBG_UNIT_VERSION(SEHSample)); 22 | #endif //defined(TCDBG_UNIT_VERSION) 23 | } 24 | 25 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SEHSample.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CSEHSampleClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CSEHSampleClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleCtrl.cpp: -------------------------------------------------------------------------------- 1 | // SEHSampleCtrl.cpp : Implementation of CTcSEHSampleCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "SEHSampleW32.h" 6 | #include "SEHSampleCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CSEHSampleCtrl 10 | 11 | CSEHSampleCtrl::CSEHSampleCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CSEHSampleCtrl::~CSEHSampleCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleCtrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SEHSampleCtrl.h 3 | 4 | #ifndef __SEHSAMPLECTRL_H__ 5 | #define __SEHSAMPLECTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define SEHSAMPLEDRV_NAME "SEHSAMPLE" 11 | 12 | #include "resource.h" // main symbols 13 | #include "SEHSampleW32.h" 14 | #include "TcBase.h" 15 | #include "SEHSampleClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CSEHSampleCtrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public ISEHSampleCtrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CSEHSampleCtrl(); 26 | virtual ~CSEHSampleCtrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_SEHSAMPLECTRL) 29 | DECLARE_NOT_AGGREGATABLE(CSEHSampleCtrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CSEHSampleCtrl) 34 | COM_INTERFACE_ENTRY(ISEHSampleCtrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __SEHSAMPLECTRL_H__ 42 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SEHSampleDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "SEHSampleDriver.h" 7 | #include "SEHSampleClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(SEHSAMPLEDRV) 10 | 11 | IOSTATUS CSEHSampleDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CSEHSampleClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CSEHSampleDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CSEHSampleDriver::SEHSAMPLEDRV_GetVersion( ) 25 | { 26 | return( (SEHSAMPLEDRV_Major << 8) | SEHSAMPLEDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SEHSampleDriver.h 3 | 4 | #ifndef __SEHSAMPLEDRIVER_H__ 5 | #define __SEHSAMPLEDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define SEHSAMPLEDRV_NAME "SEHSAMPLE" 14 | #define SEHSAMPLEDRV_Major 1 15 | #define SEHSAMPLEDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CSEHSampleDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CSEHSampleDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl SEHSAMPLEDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(SEHSAMPLEDRV) 35 | VxD_Service( SEHSAMPLEDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __SEHSAMPLEDRIVER_H__ -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SEHSampleInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "SEHSampleServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SEHSampleServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_SEHSample = 0x3F000000; 9 | #define SRVNAME_SEHSAMPLE "SEHSample" 10 | 11 | /// 12 | const CTCID CID_SEHSampleCSEHModule = {0x24f48ecb,0x4871,0x44d7,{0x8d,0xd7,0x9b,0x15,0xee,0xd8,0x34,0x07}}; 13 | /// 14 | 15 | /// 16 | const PTCID PID_SEHModuleSampleType = 0x00000001; 17 | /// 18 | 19 | /// 20 | #if !defined(_TC_TYPE_A4C8CAA0_5C8F_4B63_8C06_A0237315DF79_INCLUDED_) 21 | #define _TC_TYPE_A4C8CAA0_5C8F_4B63_8C06_A0237315DF79_INCLUDED_ 22 | enum ESampleType : SHORT { 23 | SampleType_NullPtr = 0, 24 | SampleType_NullPtrFilter = 1, 25 | SampleType_Finally = 2, 26 | SampleType_CustomException = 3, 27 | SampleType_ContinueException = 4, 28 | SampleType_None = 5 29 | }; 30 | #endif // !defined(_TC_TYPE_A4C8CAA0_5C8F_4B63_8C06_A0237315DF79_INCLUDED_) 31 | 32 | /// 33 | 34 | 35 | 36 | /// 37 | /// 38 | 39 | /// 40 | /// 41 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleW32.def: -------------------------------------------------------------------------------- 1 | ; SEHSAMPLEW32.def : Declares the module parameters. 2 | 3 | LIBRARY "SEHSampleW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/SEHSampleW32.idl: -------------------------------------------------------------------------------- 1 | // SEHSampleW32.idl : IDL source for SEHSampleW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (SEHSampleW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ISEHSample Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ISEHSampleCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("SEHSampleW32 1.0 Type Library") 24 | ] 25 | library SEHSAMPLEW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("SEHSampleCtrl Class") 33 | ] 34 | coclass SEHSampleCtrl 35 | { 36 | [default] interface ISEHSampleCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S23-SEH/TwinCAT SEHProject/SEHSample/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // DriverUsingStaticLibClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "DriverUsingStaticLibClassFactory.h" 7 | #include "DriverUsingStaticLibServices.h" 8 | #include "ModuleUsingStaticLib.h" 9 | 10 | BEGIN_CLASS_MAP(CDriverUsingStaticLibClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_DriverUsingStaticLibCModuleUsingStaticLib, SRVNAME_DRIVERUSINGSTATICLIB "!CModuleUsingStaticLib", CModuleUsingStaticLib) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CDriverUsingStaticLibClassFactory::CDriverUsingStaticLibClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_DRIVERUSINGSTATICLIB)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // DriverUsingStaticLib.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CDriverUsingStaticLibClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CDriverUsingStaticLibClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibCtrl.cpp: -------------------------------------------------------------------------------- 1 | // DriverUsingStaticLibCtrl.cpp : Implementation of CTcDriverUsingStaticLibCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "DriverUsingStaticLibW32.h" 6 | #include "DriverUsingStaticLibCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CDriverUsingStaticLibCtrl 10 | 11 | CDriverUsingStaticLibCtrl::CDriverUsingStaticLibCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CDriverUsingStaticLibCtrl::~CDriverUsingStaticLibCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // DriverUsingStaticLibDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "DriverUsingStaticLibDriver.h" 7 | #include "DriverUsingStaticLibClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(DRIVERUSINGSTATICLIBDRV) 10 | 11 | IOSTATUS CDriverUsingStaticLibDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CDriverUsingStaticLibClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CDriverUsingStaticLibDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CDriverUsingStaticLibDriver::DRIVERUSINGSTATICLIBDRV_GetVersion( ) 25 | { 26 | return( (DRIVERUSINGSTATICLIBDRV_Major << 8) | DRIVERUSINGSTATICLIBDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // DriverUsingStaticLibDriver.h 3 | 4 | #ifndef __DRIVERUSINGSTATICLIBDRIVER_H__ 5 | #define __DRIVERUSINGSTATICLIBDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define DRIVERUSINGSTATICLIBDRV_NAME "DRIVERUSINGSTATICLIB" 14 | #define DRIVERUSINGSTATICLIBDRV_Major 1 15 | #define DRIVERUSINGSTATICLIBDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CDriverUsingStaticLibDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CDriverUsingStaticLibDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl DRIVERUSINGSTATICLIBDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(DRIVERUSINGSTATICLIBDRV) 35 | VxD_Service( DRIVERUSINGSTATICLIBDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __DRIVERUSINGSTATICLIBDRIVER_H__ -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // DriverUsingStaticLibInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "DriverUsingStaticLibServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibW32.def: -------------------------------------------------------------------------------- 1 | ; DRIVERUSINGSTATICLIBW32.def : Declares the module parameters. 2 | 3 | LIBRARY "DriverUsingStaticLibW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/DriverUsingStaticLibW32.idl: -------------------------------------------------------------------------------- 1 | // DriverUsingStaticLibW32.idl : IDL source for DriverUsingStaticLibW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (DriverUsingStaticLibW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("IDriverUsingStaticLib Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface IDriverUsingStaticLibCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("DriverUsingStaticLibW32 1.0 Type Library") 24 | ] 25 | library DRIVERUSINGSTATICLIBW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("DriverUsingStaticLibCtrl Class") 33 | ] 34 | coclass DriverUsingStaticLibCtrl 35 | { 36 | [default] interface IDriverUsingStaticLibCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by DriverUsingStaticLib.rc 4 | #define IDS_DRIVERUSINGSTATICLIB 100 5 | #define IDR_DRIVERUSINGSTATICLIBCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/DriverUsingStaticLib/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/ClassDiagram1.cd: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/MultiplicationClass.cpp: -------------------------------------------------------------------------------- 1 | #include "TcPch.h" 2 | #pragma hdrstop 3 | 4 | #include "MultiplicationClass.h" 5 | 6 | 7 | IMPLEMENT_IUNKNOWN() 8 | 9 | BEGIN_INTERFACE_MAP(MultiplicationClass) 10 | INTERFACE_ENTRY(IID_ITcUnknown, ITcUnknown) 11 | END_INTERFACE_MAP() 12 | 13 | MultiplicationClass::MultiplicationClass(void) 14 | { 15 | } 16 | 17 | 18 | MultiplicationClass::~MultiplicationClass(void) 19 | { 20 | } 21 | 22 | HRESULT TCOMAPI MultiplicationClass::SampleMultiplicationMethod(ULONG Parameter1, ULONG Parameter2, ULONG& Parameter3) 23 | { 24 | 25 | Parameter3 = Parameter1 * Parameter2; 26 | return S_OK; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/MultiplicationClass.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "StaticLibInterfaces.h" 3 | 4 | class MultiplicationClass : 5 | public ISampleInterface 6 | { 7 | public: 8 | 9 | DECLARE_IUNKNOWN() 10 | 11 | MultiplicationClass(void); 12 | 13 | ~MultiplicationClass(void); 14 | 15 | HRESULT TCOMAPI SampleMultiplicationMethod(ULONG Parameter1, ULONG Parameter2, ULONG& Parameter3); 16 | }; 17 | 18 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/StaticFunction.cpp: -------------------------------------------------------------------------------- 1 | #include "TcPch.h" 2 | #pragma hdrstop 3 | 4 | #include "StaticFunction.h" 5 | 6 | HRESULT ComputeSomething(ULONG value1, ULONG value2, ULONG& result) 7 | { 8 | HRESULT hr = S_OK; 9 | 10 | result = value1 + value2; 11 | 12 | return hr; 13 | } -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/StaticFunction.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "TcServices.h" 3 | extern HRESULT ComputeSomething(ULONG value1, ULONG value2, ULONG& result); 4 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/StaticLib.tmc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | C++ Module Vendor 5 | 6 | ISampleInterfaceITcUnknownSampleMultiplicationMethodHRESULTParameter1UDINTParameter2UDINTParameter3UDINT 7 | 8 | 9 | C++ 10 | C++ Modules 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/StaticLib.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/StaticLibInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // StaticLibInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "StaticLibServices.h" 9 | 10 | /// 11 | #if !defined(_TC_TYPE_6D2C52FF_48FF_4FAC_A000_482A66F82627_INCLUDED_) 12 | #define _TC_TYPE_6D2C52FF_48FF_4FAC_A000_482A66F82627_INCLUDED_ 13 | struct __declspec(novtable) ISampleInterface : public ITcUnknown 14 | { 15 | virtual HRESULT TCOMAPI SampleMultiplicationMethod(ULONG Parameter1, ULONG Parameter2, ULONG& Parameter3)=0; 16 | }; 17 | _TCOM_SMARTPTR_TYPEDEF(ISampleInterface, IID_ISampleInterface); 18 | #endif // !defined(_TC_TYPE_6D2C52FF_48FF_4FAC_A000_482A66F82627_INCLUDED_) 19 | 20 | /// 21 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/StaticLibServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // StaticLibServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_StaticLib = 0x3F000000; 9 | #define SRVNAME_STATICLIB "StaticLib" 10 | 11 | /// 12 | /// 13 | 14 | /// 15 | /// 16 | 17 | /// 18 | /// 19 | 20 | 21 | 22 | /// 23 | TCOM_DECL_INTERFACE("6d2c52ff-48ff-4fac-a000-482a66f82627", ISampleInterface) 24 | /// 25 | -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | 15 | #include "TcDef.h" 16 | #include "TcBase.h" 17 | #include "TcError.h" 18 | #include "OsBase.h" -------------------------------------------------------------------------------- /S25-StaticLibrary/TwinCAT Static Library/StaticLib/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by SortOrder.rc 4 | #define IDS_SORTORDER 100 5 | #define IDR_SORTORDERCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrder.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SortOrderClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "SortOrderClassFactory.h" 7 | #include "SortOrderServices.h" 8 | #include "SortOrderVersion.h" 9 | #include "SortOrderModule.h" 10 | 11 | BEGIN_CLASS_MAP(CSortOrderClassFactory) 12 | /// 13 | CLASS_ENTRY(CID_SortOrderCSortOrderModule, SRVNAME_SORTORDER "!CSortOrderModule", CSortOrderModule) 14 | /// 15 | END_CLASS_MAP() 16 | 17 | CSortOrderClassFactory::CSortOrderClassFactory() : CObjClassFactory() 18 | { 19 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_SORTORDER)); 20 | #if defined(TCDBG_UNIT_VERSION) 21 | TcDbgUnitSetVersion(TCDBG_UNIT_VERSION(SortOrder)); 22 | #endif //defined(TCDBG_UNIT_VERSION) 23 | } 24 | 25 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SortOrder.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CSortOrderClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CSortOrderClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderCtrl.cpp: -------------------------------------------------------------------------------- 1 | // SortOrderCtrl.cpp : Implementation of CTcSortOrderCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "SortOrderW32.h" 6 | #include "SortOrderCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CSortOrderCtrl 10 | 11 | CSortOrderCtrl::CSortOrderCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CSortOrderCtrl::~CSortOrderCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderCtrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SortOrderCtrl.h 3 | 4 | #ifndef __SORTORDERCTRL_H__ 5 | #define __SORTORDERCTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define SORTORDERDRV_NAME "SORTORDER" 11 | 12 | #include "resource.h" // main symbols 13 | #include "SortOrderW32.h" 14 | #include "TcBase.h" 15 | #include "SortOrderClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CSortOrderCtrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public ISortOrderCtrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CSortOrderCtrl(); 26 | virtual ~CSortOrderCtrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_SORTORDERCTRL) 29 | DECLARE_NOT_AGGREGATABLE(CSortOrderCtrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CSortOrderCtrl) 34 | COM_INTERFACE_ENTRY(ISortOrderCtrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __SORTORDERCTRL_H__ 42 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SortOrderDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "SortOrderDriver.h" 7 | #include "SortOrderClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(SORTORDERDRV) 10 | 11 | IOSTATUS CSortOrderDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CSortOrderClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CSortOrderDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CSortOrderDriver::SORTORDERDRV_GetVersion( ) 25 | { 26 | return( (SORTORDERDRV_Major << 8) | SORTORDERDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SortOrderDriver.h 3 | 4 | #ifndef __SORTORDERDRIVER_H__ 5 | #define __SORTORDERDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define SORTORDERDRV_NAME "SORTORDER" 14 | #define SORTORDERDRV_Major 1 15 | #define SORTORDERDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CSortOrderDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CSortOrderDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl SORTORDERDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(SORTORDERDRV) 35 | VxD_Service( SORTORDERDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __SORTORDERDRIVER_H__ -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SortOrderInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "SortOrderServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // SortOrderServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_SortOrder = 0x3F000000; 9 | #define SRVNAME_SORTORDER "SortOrder" 10 | 11 | /// 12 | const CTCID CID_SortOrderCSortOrderModule = {0x58adfa45,0x9d80,0x4e33,{0x9e,0x4a,0x8d,0x1e,0x8b,0x79,0xa1,0x2c}}; 13 | /// 14 | 15 | /// 16 | /// 17 | 18 | /// 19 | typedef struct _SortOrderModuleInputs 20 | { 21 | ULONG Value; 22 | ULONG Status; 23 | ULONG Data; 24 | } SortOrderModuleInputs, *PSortOrderModuleInputs; 25 | 26 | typedef struct _SortOrderModuleOutputs 27 | { 28 | ULONG Value; 29 | ULONG Control; 30 | ULONG Data; 31 | } SortOrderModuleOutputs, *PSortOrderModuleOutputs; 32 | 33 | /// 34 | 35 | 36 | 37 | /// 38 | #define ADI_SortOrderModuleInputs 0 39 | #define ADI_SortOrderModuleOutputs 1 40 | /// 41 | 42 | /// 43 | /// 44 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderW32.def: -------------------------------------------------------------------------------- 1 | ; SORTORDERW32.def : Declares the module parameters. 2 | 3 | LIBRARY "SortOrderW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/SortOrderW32.idl: -------------------------------------------------------------------------------- 1 | // SortOrderW32.idl : IDL source for SortOrderW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (SortOrderW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ISortOrder Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ISortOrderCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("SortOrderW32 1.0 Type Library") 24 | ] 25 | library SORTORDERW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("SortOrderCtrl Class") 33 | ] 34 | coclass SortOrderCtrl 35 | { 36 | [default] interface ISortOrderCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S26-SortOrder/TwinCAT Project with SortOrder/SortOrder/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcStopWatchSample.rc 4 | #define IDS_TCSTOPWATCHSAMPLE 100 5 | #define IDR_TCSTOPWATCHSAMPLECTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSample.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TwincatRemoteDebugger 5 | 6 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcStopWatchSampleClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcStopWatchSampleClassFactory.h" 7 | #include "TcStopWatchSampleServices.h" 8 | #include "StopWatchModule.h" 9 | 10 | BEGIN_CLASS_MAP(CTcStopWatchSampleClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_TcStopWatchSampleCStopWatchModule, SRVNAME_TCSTOPWATCHSAMPLE "!CStopWatchModule", CStopWatchModule) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CTcStopWatchSampleClassFactory::CTcStopWatchSampleClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCSTOPWATCHSAMPLE)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcStopWatchSample.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcStopWatchSampleClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcStopWatchSampleClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcStopWatchSampleCtrl.cpp : Implementation of CTcTcStopWatchSampleCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcStopWatchSampleW32.h" 6 | #include "TcStopWatchSampleCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcStopWatchSampleCtrl 10 | 11 | CTcStopWatchSampleCtrl::CTcStopWatchSampleCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcStopWatchSampleCtrl::~CTcStopWatchSampleCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcStopWatchSampleDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcStopWatchSampleDriver.h" 7 | #include "TcStopWatchSampleClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCSTOPWATCHSAMPLEDRV) 10 | 11 | IOSTATUS CTcStopWatchSampleDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcStopWatchSampleClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcStopWatchSampleDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcStopWatchSampleDriver::TCSTOPWATCHSAMPLEDRV_GetVersion( ) 25 | { 26 | return( (TCSTOPWATCHSAMPLEDRV_Major << 8) | TCSTOPWATCHSAMPLEDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcStopWatchSampleDriver.h 3 | 4 | #ifndef __TCSTOPWATCHSAMPLEDRIVER_H__ 5 | #define __TCSTOPWATCHSAMPLEDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCSTOPWATCHSAMPLEDRV_NAME "TCSTOPWATCHSAMPLE" 14 | #define TCSTOPWATCHSAMPLEDRV_Major 1 15 | #define TCSTOPWATCHSAMPLEDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcStopWatchSampleDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcStopWatchSampleDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCSTOPWATCHSAMPLEDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCSTOPWATCHSAMPLEDRV) 35 | VxD_Service( TCSTOPWATCHSAMPLEDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCSTOPWATCHSAMPLEDRIVER_H__ -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcStopWatchSampleInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcStopWatchSampleServices.h" 9 | 10 | // defining new interfaces provided by this driver 11 | /* for example 12 | struct __declspec(novtable) ITcStopWatchSampleShortName : public ITcUnknown 13 | { 14 | virtual ULONG TCOMAPI DoSomething(ULONG value1, UINT value2=0)=0; 15 | TCOMMETHOD(DoSomethingElse(PVOID ptr)); 16 | }; 17 | _TCOM_SMARTPTR_TYPEDEF(ITcStopWatchSampleShortName, IID_ITcStopWatchSampleShortName); 18 | */ 19 | 20 | 21 | /// 22 | /// 23 | -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleW32.def: -------------------------------------------------------------------------------- 1 | ; TCSTOPWATCHSAMPLEW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcStopWatchSampleW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S30-Timing/TwinCAT Project with StopWatch/TcStopWatchSample/TcStopWatchSampleW32.idl: -------------------------------------------------------------------------------- 1 | // TcStopWatchSampleW32.idl : IDL source for TcStopWatchSampleW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcStopWatchSampleW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcStopWatchSample Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcStopWatchSampleCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcStopWatchSampleW32 1.0 Type Library") 24 | ] 25 | library TCSTOPWATCHSAMPLEW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcStopWatchSampleCtrl Class") 33 | ] 34 | coclass TcStopWatchSampleCtrl 35 | { 36 | [default] interface ITcStopWatchSampleCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TON.rc 4 | #define IDS_TON 100 5 | #define IDR_TONCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TON.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TONInterfaces.h" 4 | 5 | class CTON 6 | { 7 | public: 8 | CTON::CTON(void); 9 | VOID CTON::Update(ITcTask*, BOOL , LONGLONG, BOOL& , LONGLONG& ); 10 | 11 | private: 12 | BOOL m_InFlag; 13 | LONGLONG m_startTime; 14 | }; 15 | 16 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TON.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TONClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TONClassFactory.h" 7 | #include "TONServices.h" 8 | #include "TONVersion.h" 9 | #include "Module1.h" 10 | 11 | BEGIN_CLASS_MAP(CTONClassFactory) 12 | /// 13 | CLASS_ENTRY(CID_TONCModule1, SRVNAME_TON "!CModule1", CModule1) 14 | /// 15 | END_CLASS_MAP() 16 | 17 | CTONClassFactory::CTONClassFactory() : CObjClassFactory() 18 | { 19 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TON)); 20 | #if defined(TCDBG_UNIT_VERSION) 21 | TcDbgUnitSetVersion(TCDBG_UNIT_VERSION(TON)); 22 | #endif //defined(TCDBG_UNIT_VERSION) 23 | } 24 | 25 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TON.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTONClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTONClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TONCtrl.cpp : Implementation of CTcTONCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TONW32.h" 6 | #include "TONCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTONCtrl 10 | 11 | CTONCtrl::CTONCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTONCtrl::~CTONCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONCtrl.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TONCtrl.h 3 | 4 | #ifndef __TONCTRL_H__ 5 | #define __TONCTRL_H__ 6 | 7 | #include 8 | #include 9 | 10 | #define TONDRV_NAME "TON" 11 | 12 | #include "resource.h" // main symbols 13 | #include "TONW32.h" 14 | #include "TcBase.h" 15 | #include "TONClassFactory.h" 16 | #include "TcOCFCtrlImpl.h" 17 | 18 | class CTONCtrl 19 | : public CComObjectRootEx 20 | , public CComCoClass 21 | , public ITONCtrl 22 | , public ITcOCFCtrlImpl 23 | { 24 | public: 25 | CTONCtrl(); 26 | virtual ~CTONCtrl(); 27 | 28 | DECLARE_REGISTRY_RESOURCEID(IDR_TONCTRL) 29 | DECLARE_NOT_AGGREGATABLE(CTONCtrl) 30 | 31 | DECLARE_PROTECT_FINAL_CONSTRUCT() 32 | 33 | BEGIN_COM_MAP(CTONCtrl) 34 | COM_INTERFACE_ENTRY(ITONCtrl) 35 | COM_INTERFACE_ENTRY(ITcCtrl) 36 | COM_INTERFACE_ENTRY(ITcCtrl2) 37 | END_COM_MAP() 38 | 39 | }; 40 | 41 | #endif // #ifndef __TONCTRL_H__ 42 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TONDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TONDriver.h" 7 | #include "TONClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TONDRV) 10 | 11 | IOSTATUS CTONDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTONClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTONDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTONDriver::TONDRV_GetVersion( ) 25 | { 26 | return( (TONDRV_Major << 8) | TONDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TONDriver.h 3 | 4 | #ifndef __TONDRIVER_H__ 5 | #define __TONDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TONDRV_NAME "TON" 14 | #define TONDRV_Major 1 15 | #define TONDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTONDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTONDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TONDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TONDRV) 35 | VxD_Service( TONDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TONDRIVER_H__ -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TONInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "TONServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONServices.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TONServices.h 3 | 4 | #pragma once 5 | 6 | #include "TcServices.h" 7 | 8 | const ULONG DrvID_TON = 0x3F000000; 9 | #define SRVNAME_TON "TON" 10 | 11 | /// 12 | const CTCID CID_TONCModule1 = {0xd3dcb022,0x823f,0x463e,{0x99,0x3c,0x85,0xf6,0x1e,0x6e,0x34,0x6c}}; 13 | /// 14 | 15 | /// 16 | /// 17 | 18 | /// 19 | typedef struct _Module1Inputs 20 | { 21 | ULONG Value; 22 | ULONG Status; 23 | ULONG Data; 24 | } Module1Inputs, *PModule1Inputs; 25 | 26 | typedef struct _Module1Outputs 27 | { 28 | SHORT Value; 29 | } Module1Outputs, *PModule1Outputs; 30 | 31 | /// 32 | 33 | 34 | 35 | /// 36 | #define ADI_Module1Inputs 0 37 | #define ADI_Module1Outputs 1 38 | /// 39 | 40 | /// 41 | /// 42 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONW32.def: -------------------------------------------------------------------------------- 1 | ; TONW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TONW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TONW32.idl: -------------------------------------------------------------------------------- 1 | // TONW32.idl : IDL source for TONW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TONW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITON Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITONCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TONW32 1.0 Type Library") 24 | ] 25 | library TONW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TONCtrl Class") 33 | ] 34 | coclass TONCtrl 35 | { 36 | [default] interface ITONCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S31-CTON/TwinCAT Project CTON/TON/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcEthernetSample.rc 4 | #define IDS_TCETHERNETSAMPLE 100 5 | #define IDR_TCETHERNETSAMPLECTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSample.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSample.vcxproj.vspscc: -------------------------------------------------------------------------------- 1 | "" 2 | { 3 | "FILE_VERSION" = "9237" 4 | "ENLISTMENT_CHOICE" = "NEVER" 5 | "PROJECT_FILE_RELATIVE_PATH" = "" 6 | "NUMBER_OF_EXCLUDED_FILES" = "0" 7 | "ORIGINAL_PROJECT_FILE_PATH" = "" 8 | "NUMBER_OF_NESTED_PROJECTS" = "0" 9 | "SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER" 10 | } 11 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSampleClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcEthernetSampleClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcEthernetSampleClassFactory.h" 7 | #include "TcEthernetSampleServices.h" 8 | #include "ModuleARP.h" 9 | 10 | BEGIN_CLASS_MAP(CTcEthernetSampleClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_TcEthernetSampleCModuleARP, SRVNAME_TCETHERNETSAMPLE "!CModuleARP", CModuleARP) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CTcEthernetSampleClassFactory::CTcEthernetSampleClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCETHERNETSAMPLE)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSampleClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcEthernetSample.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcEthernetSampleClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcEthernetSampleClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSampleCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcEthernetSampleCtrl.cpp : Implementation of CTcTcEthernetSampleCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcEthernetSampleW32.h" 6 | #include "TcEthernetSampleCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcEthernetSampleCtrl 10 | 11 | CTcEthernetSampleCtrl::CTcEthernetSampleCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcEthernetSampleCtrl::~CTcEthernetSampleCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSampleDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcEthernetSampleDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcEthernetSampleDriver.h" 7 | #include "TcEthernetSampleClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCETHERNETSAMPLEDRV) 10 | 11 | IOSTATUS CTcEthernetSampleDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcEthernetSampleClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcEthernetSampleDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcEthernetSampleDriver::TCETHERNETSAMPLEDRV_GetVersion( ) 25 | { 26 | return( (TCETHERNETSAMPLEDRV_Major << 8) | TCETHERNETSAMPLEDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSampleDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcEthernetSampleDriver.h 3 | 4 | #ifndef __TCETHERNETSAMPLEDRIVER_H__ 5 | #define __TCETHERNETSAMPLEDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCETHERNETSAMPLEDRV_NAME "TCETHERNETSAMPLE" 14 | #define TCETHERNETSAMPLEDRV_Major 1 15 | #define TCETHERNETSAMPLEDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcEthernetSampleDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcEthernetSampleDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCETHERNETSAMPLEDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCETHERNETSAMPLEDRV) 35 | VxD_Service( TCETHERNETSAMPLEDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCETHERNETSAMPLEDRIVER_H__ -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSampleW32.def: -------------------------------------------------------------------------------- 1 | ; TCETHERNETSAMPLEW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcEthernetSampleW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcEthernetSampleW32.idl: -------------------------------------------------------------------------------- 1 | // TcEthernetSampleW32.idl : IDL source for TcEthernetSampleW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcEthernetSampleW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcEthernetSample Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcEthernetSampleCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcEthernetSampleW32 1.0 Type Library") 24 | ] 25 | library TCETHERNETSAMPLEW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcEthernetSampleCtrl Class") 33 | ] 34 | coclass TcEthernetSampleCtrl 35 | { 36 | [default] interface ITcEthernetSampleCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S35-AccessEthernet/TwinCAT Project with Ethernet/TcEthernetSample/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by TcTComObjArchiveDrv.rc 4 | #define IDS_TCTCOMOBJARCHIVEDRV 100 5 | #define IDR_TCTCOMOBJARCHIVEDRVCTRL 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 101 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcPch.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.cpp includes the projects standard header files using TcPch.h 3 | // It is dedicated to create the precompiled header, which 4 | // is configured as a file specifc build option. 5 | // 6 | // - TcPch.pch will be the pre-compiled header 7 | // - TcPch.obj will contain the pre-compiled type information 8 | // 9 | // For correct precompiled header usage each *.cpp source file in 10 | // the TwinCAT driver project must start with the following two lines: 11 | 12 | #include "TcPch.h" 13 | #pragma hdrstop 14 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcPch.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcPch.h includes TwinCAT standard header files, 3 | // or project specific include files that are used frequently, 4 | // but are changed infrequently 5 | 6 | #pragma once 7 | 8 | #include "TcDef.h" 9 | #include "TcBase.h" 10 | #include "TcError.h" 11 | #include "OsBase.h" 12 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrv.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvClassFactory.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcTComObjArchiveDrvClassFactory.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcTComObjArchiveDrvClassFactory.h" 7 | #include "TcTComObjArchiveDrvServices.h" 8 | #include "ModuleArchive.h" 9 | 10 | BEGIN_CLASS_MAP(CTcTComObjArchiveDrvClassFactory) 11 | /// 12 | CLASS_ENTRY(CID_TcTComObjArchiveDrvCModuleArchive, SRVNAME_TCTCOMOBJARCHIVEDRV "!CModuleArchive", CModuleArchive) 13 | /// 14 | END_CLASS_MAP() 15 | 16 | CTcTComObjArchiveDrvClassFactory::CTcTComObjArchiveDrvClassFactory() : CObjClassFactory() 17 | { 18 | TcDbgUnitSetImageName(TCDBG_UNIT_IMAGE_NAME(SRVNAME_TCTCOMOBJARCHIVEDRV)); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvClassFactory.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcTComObjArchiveDrv.h 3 | 4 | #pragma once 5 | 6 | #include "ObjClassFactory.h" 7 | 8 | class CTcTComObjArchiveDrvClassFactory : public CObjClassFactory 9 | { 10 | public: 11 | CTcTComObjArchiveDrvClassFactory(); 12 | DECLARE_CLASS_MAP() 13 | }; 14 | 15 | 16 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvCtrl.cpp: -------------------------------------------------------------------------------- 1 | // TcTComObjArchiveDrvCtrl.cpp : Implementation of CTcTcTComObjArchiveDrvCtrl 2 | #include "TcPch.h" 3 | #pragma hdrstop 4 | 5 | #include "TcTComObjArchiveDrvW32.h" 6 | #include "TcTComObjArchiveDrvCtrl.h" 7 | 8 | ///////////////////////////////////////////////////////////////////////////// 9 | // CTcTComObjArchiveDrvCtrl 10 | 11 | CTcTComObjArchiveDrvCtrl::CTcTComObjArchiveDrvCtrl() 12 | : ITcOCFCtrlImpl() 13 | { 14 | } 15 | 16 | CTcTComObjArchiveDrvCtrl::~CTcTComObjArchiveDrvCtrl() 17 | { 18 | } 19 | 20 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvDriver.cpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcTComObjArchiveDrvDriver.cpp 3 | #include "TcPch.h" 4 | #pragma hdrstop 5 | 6 | #include "TcTComObjArchiveDrvDriver.h" 7 | #include "TcTComObjArchiveDrvClassFactory.h" 8 | 9 | DECLARE_GENERIC_DEVICE(TCTCOMOBJARCHIVEDRVDRV) 10 | 11 | IOSTATUS CTcTComObjArchiveDrvDriver::OnLoad( ) 12 | { 13 | TRACE(_T("CObjClassFactory::OnLoad()\n") ); 14 | m_pObjClassFactory = new CTcTComObjArchiveDrvClassFactory(); 15 | 16 | return IOSTATUS_SUCCESS; 17 | } 18 | 19 | VOID CTcTComObjArchiveDrvDriver::OnUnLoad( ) 20 | { 21 | delete m_pObjClassFactory; 22 | } 23 | 24 | unsigned long _cdecl CTcTComObjArchiveDrvDriver::TCTCOMOBJARCHIVEDRVDRV_GetVersion( ) 25 | { 26 | return( (TCTCOMOBJARCHIVEDRVDRV_Major << 8) | TCTCOMOBJARCHIVEDRVDRV_Minor ); 27 | } 28 | 29 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvDriver.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcTComObjArchiveDrvDriver.h 3 | 4 | #ifndef __TCTCOMOBJARCHIVEDRVDRIVER_H__ 5 | #define __TCTCOMOBJARCHIVEDRVDRIVER_H__ 6 | 7 | #if _MSC_VER > 1000 8 | #pragma once 9 | #endif // _MSC_VER > 1000 10 | 11 | #include "TcBase.h" 12 | 13 | #define TCTCOMOBJARCHIVEDRVDRV_NAME "TCTCOMOBJARCHIVEDRV" 14 | #define TCTCOMOBJARCHIVEDRVDRV_Major 1 15 | #define TCTCOMOBJARCHIVEDRVDRV_Minor 0 16 | 17 | #define DEVICE_CLASS CTcTComObjArchiveDrvDriver 18 | 19 | #include "ObjDriver.h" 20 | 21 | class CTcTComObjArchiveDrvDriver : public CObjDriver 22 | { 23 | public: 24 | virtual IOSTATUS OnLoad(); 25 | virtual VOID OnUnLoad(); 26 | 27 | ////////////////////////////////////////////////////// 28 | // VxD-Services exported by this driver 29 | static unsigned long _cdecl TCTCOMOBJARCHIVEDRVDRV_GetVersion(); 30 | ////////////////////////////////////////////////////// 31 | 32 | }; 33 | 34 | Begin_VxD_Service_Table(TCTCOMOBJARCHIVEDRVDRV) 35 | VxD_Service( TCTCOMOBJARCHIVEDRVDRV_GetVersion ) 36 | End_VxD_Service_Table 37 | 38 | 39 | #endif // ifndef __TCTCOMOBJARCHIVEDRVDRIVER_H__ -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvInterfaces.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // TcTComObjArchiveDrvInterfaces.h 3 | 4 | #pragma once 5 | 6 | #include "TcInterfaces.h" 7 | #include "TcIoInterfaces.h" 8 | #include "TcRtInterfaces.h" 9 | #include "TcTComObjArchiveDrvServices.h" 10 | 11 | /// 12 | /// 13 | -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvW32.def: -------------------------------------------------------------------------------- 1 | ; TCTCOMOBJARCHIVEDRVW32.def : Declares the module parameters. 2 | 3 | LIBRARY "TcTComObjArchiveDrvW32.DLL" 4 | 5 | EXPORTS 6 | DllCanUnloadNow PRIVATE 7 | DllGetClassObject PRIVATE 8 | DllRegisterServer PRIVATE 9 | DllUnregisterServer PRIVATE 10 | DllGetTcCtrl PRIVATE -------------------------------------------------------------------------------- /S37-ArchiveData/TwinCAT Project with TComObjArchive/TcTComObjArchiveDrv/TcTComObjArchiveDrvW32.idl: -------------------------------------------------------------------------------- 1 | // TcTComObjArchiveDrvW32.idl : IDL source for TcTComObjArchiveDrvW32.dll 2 | // 3 | 4 | // This file will be processed by the MIDL tool to 5 | // produce the type library (TcTComObjArchiveDrvW32.tlb) and marshalling code. 6 | 7 | import "oaidl.idl"; 8 | import "ocidl.idl"; 9 | [ 10 | object, 11 | uuid(54EDF0AC-ACDE-4456-920E-A26D15A8503A), 12 | 13 | helpstring("ITcTComObjArchiveDrv Interface"), 14 | pointer_default(unique) 15 | ] 16 | interface ITcTComObjArchiveDrvCtrl : IUnknown 17 | { 18 | }; 19 | 20 | [ 21 | uuid(BF6DEC14-AD1A-44a6-82E2-5913CDE2288D), 22 | version(1.0), 23 | helpstring("TcTComObjArchiveDrvW32 1.0 Type Library") 24 | ] 25 | library TCTCOMOBJARCHIVEDRVW32Lib 26 | { 27 | importlib("stdole32.tlb"); 28 | importlib("stdole2.tlb"); 29 | 30 | [ 31 | uuid(F634CCE5-F3B1-47a9-8151-D2B004A4B8F3), 32 | helpstring("TcTComObjArchiveDrvCtrl Class") 33 | ] 34 | coclass TcTComObjArchiveDrvCtrl 35 | { 36 | [default] interface ITcTComObjArchiveDrvCtrl; 37 | }; 38 | }; 39 | -------------------------------------------------------------------------------- /TwinCAT Project CppToPlc.tszip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/TwinCAT Project CppToPlc.tszip -------------------------------------------------------------------------------- /TwinCAT Project PLC calling C-Method.tszip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vexvoltage/TwinCat3_CPP_Examples/da855853215c3809de8f9f369ed7ef38754de1d6/TwinCAT Project PLC calling C-Method.tszip --------------------------------------------------------------------------------