secure access shared memory emc2

More
06 Jul 2011 17:17 #11190 by michel45
Hello,
We have developed an interface in qt4 inspired by mocca (​​thank Thomas "gtom").
To communicate with the outside (with cards Mesa), we use a memory shared with EMC2.

In summary this gives (in principle to write a bit):
// file GUI
struct Data { hal_bit_t *prelay;};
Data *pData;
pData pHData;

pHData = pData(hal_malloc(sizeof(Data))); /// return pointeur shared memory

..... //creation pin bit via hal_pin_bit_new(...)

void SetContact(bool state) { *pHData->prelay = state;} // write in shared memory
The program works, (check with "Configuring HAL").

How EMC2 manages access to shared memory area ? is what structures with "shminfo" and/or semaphore ?
We want to avoid that and the interface emc2 write all such :-(

Thank you for any information, links, etc.
Michel

Please Log in or Create an account to join the conversation.

More
07 Jul 2011 13:33 #11227 by michel45
hello,
I think the solution is to use the functions rtapi_mutex_give (), rtapi_mutex_try (), rtapi_mutex_get ().
I found this in the code source "src / rtapi/ rtapi.h".
I will try.
Thank you and goodbye
Michel

Please Log in or Create an account to join the conversation.

More
08 Jul 2011 00:29 #11239 by cmorley
You have a screen shot?

Please Log in or Create an account to join the conversation.

More
08 Jul 2011 09:56 - 08 Jul 2011 10:00 #11251 by michel45
screenshot of the interface?
Currently, only one interface development. The client interface will be operational in September / October, a very different arrangement.
The destination machine is visible on the site www.mipretec.ch.
The touch screen is 1920x1080 vertically.
Michel
Attachments:
Last edit: 08 Jul 2011 10:00 by michel45. Reason: add image

Please Log in or Create an account to join the conversation.

Time to create page: 0.075 seconds
Powered by Kunena Forum