TwinCAT 3 gobal memory

h.kev07

Level-1
Beiträge
9
Reaktionspunkte
0
Zuviel Werbung?
-> Hier kostenlos registrieren
Hallo,

Sorry my German is bad so I have to write in English.

Could anyone please guide me how to create global memory in C++ in TwinCAT 3 (preferably using new operator)? I have instances of a module that should use global memory to do certain operation.


Vielen Dank.
 
If all the TcCOM Modules are defined in a single driver, you are able to use static memory.
If you have several different accessing Modules, create an independent TcCOM Module which manages the memory and provides it as e.g. DataArea. Then it's possible to access the Module by InterfacePointers or the DataArea by DataAreaPointers.
 
Thank you Mr. Neals and Mr. Mac203 for the guidance. I will have a look on these and will update you.

Have a nice weekend.

Best Regards,
Himanshu
 
Zuviel Werbung?
-> Hier kostenlos registrieren
I got errors at run time when I tried to access memory created using "new operator". It is giving me "page faults" error. I think pages in virtual memories are mapped wrong to physical memories, but I am not sure.

Do anyone has idea about this issue ?
 
Yes, I am using memory in several modules. And modules are configured to have different task context. In this case data pointer is not useful because of synchronization mechanism.

So this given sample 10 is not useful in this case.

Thanks.
 
Zuviel Werbung?
-> Hier kostenlos registrieren
Yes, I am using memory in several modules. And modules are configured to have different task context. In this case data pointer is not useful because of synchronization mechanism.

So this given sample 10 is not useful in this case.

Thanks.

You haven't explanied, how you exchange the data pointer between the modules...
If you are using the memory in several tasks, you need synchronization because it's likely that the memory will be accessed multi-threaded.
 
Zurück
Oben