cancel
Showing results for 
Search instead for 
Did you mean: 
SOLVED

Sharing Variables between two PLC applications

Sharing Variables between two PLC applications

stephenOtis
Established Member

Hello,

I'm trying to create multiple applications in PLC Engineering 2.4.1 running on a single CtrlX Core for testing purposes. I can get them to run, and now I'm trying to determine how to share data between these two applications. I know I can put variables in my first application in the Data Layer using the Symbol Configuration, then I can make a watchlist of those variables, then I can setup a program in the second application to read them, but this seems like a lot of extra steps to share data between applications. Is there another method to do this that I'm unaware of?

I was hoping I could create a GVL at the root of the 'PLC Logic' part of the Project Tree that both applications could access, as this seems like the easiest way to share data from one PLC application to another. However, I'm only able to create another Application there at the moment.

stephenOtis_0-1704220936376.png

EDIT: I searched and found that you can create a GVL in the POUs view in PLC Engineering. However, when I write a value to one of the variables in this list from one application and then try to read it in the second application, the second application reads 0. It is like each application has its own instance of the GVL that it uses, which is not very useful.

stephenOtis_0-1704223966578.png

 

2 REPLIES 2

CodeWasi
Occasional Contributor

Hello!
Yes your comments are right. Up to now there is no common GVL available supporting more that one application.
The need to an easy way to share data between two/several applications is obvious - unfortuantley we can not offer an available solution yet. It will come but can not provide dates about the time schedule.

What are alternative options ?
- NVL : udp-based communication.

CodeWasi_0-1704289712952.png
- OPCUA ? Symbol config on both PLCApplication provided to outside with 1 UA_Server/Client. Know exchange within in th PLC internally.

- SharedMemory code implementation - Will work but needs to be implemented on both sides.

- Datalayer-access via CXA_Datalayer ... in case the symbol config provides the variables to the Datalayer the 2nd application can access the data via the provided FBs... but restricted on basic datatypes..examples available as code and on forum.
- complex-data like structures needs to be accessed via flatbuffers. Details about the coordinted access are partwise available under CXA_Flatbuffer but needs expert experience. Details follow is needed - next week.

 

 

Hello,

Thanks for the ideas. I think for now the NVL is the best solution in terms of not requiring extra steps of communication handling and the setup is all done through the Engineering interface. I was able to set the IP to localhost (127.0.0.1) and the secondApp was able to Receive the data.

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist