91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 23.03MB
    文件類型: .rar
    金幣: 1
    下載: 0 次
    發布日期: 2023-08-01
  • 語言: C/C++
  • 標簽: codesys??plc??通信??

資源簡介

codesys PLC的共享內存方式實現變量通訊,版本為3.5,下位機程序包括C++和C#

資源截圖

代碼片段和文件信息

#include?
#include?
#include?
#include?
#include?
#include?

struct?DataExchange?{
????int?i1;
????int?i2;
};

int?main(int?argc?char?**argv)
{
????struct?DataExchange?*pRead?*pWrite;
????char?sSharedMemReadName[100]?=?“_CODESYS_SharedMemoryTest_Write“;?
????char?sSharedMemWriteName[100]?=?“_CODESYS_SharedMemoryTest_Read“;

????int?fdRead?=?shm_open(sSharedMemReadName?O_CREAT?|?O_RDWR?S_IRWXU?|?S_IRWXG);
????printf(“Shared?Memory?Read:?%s?%d\n\n“sSharedMemReadName?fdRead);
????ftruncate(fdRead?sizeof(*pRead));
????pRead?=?mmap(0?sizeof(*pRead)?PROT_READ?|?PROT_WRITE?MAP_SHARED?fdRead?0);
????close(fdRead);

????int?fdWrite?=?shm_open(sSharedMemWriteName?O_CREAT?|?O_RDWR?S_IRWXU?|?S_IRWXG);
????printf(“Shared?Memory?Write:?%s?%d\n\n“sSharedMemWriteName?fdWrite);
????ftruncate(fdWrite?sizeof(*pWrite));
????pWrite?=?mmap(0?sizeof(*pWrite)?PROT_READ?|?PROT_WRITE?MAP_SHARED?fdWrite?0);
????close(fdWrite);

????do
????{
????????sleep(1);
????????printf(“pRead->i1:?%d?pRead->i2:?%d?pWrite->i1:?%d?pWrite->i2:?%d\n“?
???????????????pRead->i1?pRead->i2?pWrite->i1?pWrite->i2);
????????printf(“Press?‘Enter‘?to?increment?values?or?‘q‘?and?then?‘Enter‘?to?quit\n“);????
????????pWrite->i1++;
????????pWrite->i2--;?????
????}?while?(getchar()?!=?‘q‘);

????munmap(pRead?sizeof(*pRead));
????shm_unlink(sSharedMemReadName);

????munmap(pWrite?sizeof(*pWrite));
????shm_unlink(sSharedMemWriteName);?
????exit(0);
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????256??2016-05-25?14:57??origin.xml
?????文件???????14678??2016-07-06?10:50??package.manifest
?????文件???????74870??2016-05-25?15:05??\Component\DeviceDescription\CODESYSControlWinV3000000013.5.8.04096.devdesc.xml
?????文件??????310852??2016-05-25?15:05??\Component\Library\_3sstorage.compiled-library-ge33
?????文件???????52071??2016-05-25?15:05??\Component\Library?10\caa_fbfactory.compiled-library-ge33
?????文件???????74148??2016-05-25?15:05??\Component\Library?11\caa_memblockman_extern.compiled-library-ge33
?????文件??????399608??2016-05-25?15:05??\Component\Library?12\caa_resman_extern.compiled-library-ge33
?????文件??????566851??2016-05-25?15:05??\Component\Library?13\caa_storage.compiled-library-ge33
?????文件???????16061??2016-05-25?15:05??\Component\Library?14\caa_tick_extern.compiled-library-ge33
?????文件???????17201??2016-05-25?15:05??\Component\Library?15\caa_tickutil_extern.compiled-library-ge33
?????文件??????314416??2016-05-25?15:05??\Component\Library?16\caa_types_extern.compiled-library-ge33
?????文件???????51713??2016-05-25?15:05??\Component\Library?17\cmpapp.compiled-library-ge33
?????文件???????38648??2016-05-25?15:05??\Component\Library?18\cmpbintagutiliec.compiled-library-ge33
?????文件???????19572??2016-05-25?15:05??\Component\Library?19\cmpbitmappool.compiled-library-ge33
?????文件???????68330??2016-05-25?15:05??\Component\Library?2\3slicense.compiled-library-ge33
?????文件???????25327??2016-05-25?15:05??\Component\Library?20\cmpchannelclientiec.compiled-library-ge33
?????文件???????18839??2016-05-25?15:05??\Component\Library?21\cmpcodemeter.compiled-library-ge33
?????文件???????21064??2016-05-25?15:05??\Component\Library?22\cmpdynamictext.compiled-library-ge33
?????文件???????12708??2016-05-25?15:05??\Component\Library?23\cmperrors2_itfs.compiled-library-ge33
?????文件???????27479??2016-05-25?15:05??\Component\Library?24\cmpeventmgr.compiled-library-ge33
?????文件???????17125??2016-05-25?15:05??\Component\Library?25\cmplog.compiled-library-ge33
?????文件???????18227??2016-05-25?15:05??\Component\Library?26\cmpschedule.compiled-library-ge33
?????文件???????13841??2016-05-25?15:05??\Component\Library?27\cmpsrv.compiled-library-ge33
?????文件???????12556??2016-05-25?15:05??\Component\Library?28\cmptargetvisu.compiled-library-ge33
?????文件??????142646??2016-05-25?15:05??\Component\Library?29\cmptracemgr.compiled-library-ge33
?????文件???????60940??2016-05-25?15:05??\Component\Library?3\alarmmanager_itfs.compiled-library-ge33
?????文件???????33575??2016-05-25?15:05??\Component\Library?30\cmpvisuhandler.compiled-library-ge33
?????文件???????21360??2016-05-25?15:05??\Component\Library?31\collections_itfs.compiled-library-ge33
?????文件??????161326??2016-05-25?15:05??\Component\Library?32\collections.compiled-library-ge33
?????文件???????40088??2016-05-25?15:05??\Component\Library?33\cm.compiled-library-ge33
?????文件???????76219??2016-05-25?15:05??\Component\Library?34\dataserver_itfs.compiled-library-ge33
............此處省略81個文件信息

評論

共有 條評論