Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GENeric function block can not be created because cgIdentifierLength is too small. #311

Open
murinsel opened this issue Jan 31, 2025 · 0 comments

Comments

@murinsel
Copy link

murinsel commented Jan 31, 2025

In datatype.h the definition of cgIdentifierLength is set to 32.

const unsigned int cgIdentifierLength = 32;
typedef char TIdentifier[cgIdentifierLength + 1]:

This length also limits in typelib.cpp the function block type name for generic function blocks:

TIdentifier acGenFBName = { "GEN_" };
...
    memcpy(&(acGenFBName[4]), acTypeBuf, nCopyLen);
    acGenFBName[cgIdentifierLength] = '\0';
    poToCreate = findType(CStringDictionary::getInstance().getId(acGenFBName), mFBLibStart);

But if the generic type is placed into a sub folder the type name contains also the folder names and gets easily longer than the 32 characters.
For example my type name created during export from the IDE is:

GEN_DAQ__Signal__SigGrpRangeReader

So this name will be truncated an findType() fails to find the type.
One solution would be to increase the default cgIdentifierLength to say 80 or is it possible to make this configurable via Cmake?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant