- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-05-27 09:09 AM . Last Modified: 2022-05-27 09:22 AM
Creating Library Help
Hi All,
Our customers are looking to use our product with Machine Expert. I am in the process of building a library to simplify implementation and usage.
- Is there a help or tutorial to review which may help with best practices etc?
- I have multiple function blocks that can influence each other. Is there a way to share variables without them being visible to the user? I can easily create a structure that has what I need but I don't want it seen by the user. Essentially looking for the equivalent to an internal variable in a dll.
Thanks
Mark
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-05-27 11:36 AM
I believe I answered my own question. Use the word INTERNAL.
Example:
VAR_GLOBAL INTERNAL
test : INT := 5;
END_VAR
This GVL is now not exposed outside of the library.
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
Posted: 2022-05-27 11:36 AM
I believe I answered my own question. Use the word INTERNAL.
Example:
VAR_GLOBAL INTERNAL
test : INT := 5;
END_VAR
This GVL is now not exposed outside of the library.
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-01-06 07:38 AM
Hi.. Mark I have tried to implement your solution.
Where I have multiple blocks that would influence each other I was planning to create a GVL and route all the variables through it. But When I tried to create a VAR_GLOBAL INTERNAL as mentioned by you. My POUs which are some FBs not recognizing the global variable
Eg:
VAR_GLOBAL INTERNAL
test : INT := 5;
END_VAR
Link copied. Please paste this link to share this article on your social media post.
![](/skins/images/D7B476B56A4C92CBBF0CFB88116B0F92/responsive_peak/images/icon_anonymous_message.png)
![](/skins/images/D7B476B56A4C92CBBF0CFB88116B0F92/responsive_peak/images/icon_anonymous_message.png)