I'm student for now and i want to p-simple project with qt and codesys. I want to do interface with qt and control system with codesys. How can i do that? I don't want to opc ua because of price. Please help me! Thank you everyone!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Shared Memory! Is very simple use it!!!
In Qt Window you can use QSharedMemeory, running application as administrator and connecting CODESYS with key.
In Qt Linux you must use system functions, Qt manage shared in a non compatible way to CODESYS, but is very easy.
Here you have an example of our shared memory manager class. Working in Windows and Linux.
Remember //Global/ in shm keys on windows systems.
IF NOT shmOpened THEN IF shmHandler <> 0 THEN SysSharedMemoryClose(shmHandler); END_IF shmSize := SIZEOF(SharedArea); shmHandler := SysSharedMemoryOpen2(shmKey, 0, ADR(shmSize), ADR(shmOpenResult)); IF shmOpenResult = 0 AND shmHandler > 0 THEN areaExchange := SysSharedMemoryGetPointer(shmHandler, ADR(shmPointerResult)); ShmGlv.fieldArea REF= areaExchange^; IF shmPointerResult = 0 THEN shmOpened := TRUE; END_IF END_IFELSE IF areaExchange^.watchDogPC = areaExchange^.watchDogPLC THEN areaExchange^.watchDogPLC := areaExchange^.watchDogPLC + 1; shmCounterWatchdog := 0; IF areaExchange^.watchDogPC > 0 THEN IF NOT shmConnected THEN shmConnected := TRUE; END_IF; END_IF ELSE shmCounterWatchdog := shmCounterWatchdog + 1; IF shmCounterWatchdog >= MAX_WATCHDOG_COUNTER THEN IF shmConnected THEN shmConnected := FALSE; END_IF END_IF END_IF;END_IF
Last edit: mondinmr 2021-12-11
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm student for now and i want to p-simple project with qt and codesys. I want to do interface with qt and control system with codesys. How can i do that? I don't want to opc ua because of price. Please help me! Thank you everyone!
Shared Memory! Is very simple use it!!!
In Qt Window you can use QSharedMemeory, running application as administrator and connecting CODESYS with key.
In Qt Linux you must use system functions, Qt manage shared in a non compatible way to CODESYS, but is very easy.
Here you have an example of our shared memory manager class. Working in Windows and Linux.
Remember //Global/ in shm keys on windows systems.
And here a sample of CODESYS side code:
Last edit: mondinmr 2021-12-11
opc ua is free. You can compile the Open62541 plugin yourself.
https://blog.basyskom.com/building-qt-opc-ua-with-open62541/