I have finished translating the eFFL C++ Fuzzy Logic Library (https://github.com/zerokol/eFLL)
into IEC 61131-3 (CODESYS) ST language. The project file is too large to attach here so I have provided a OneDrive link (https://1drv.ms/f/s!AgeXD5P3kwJIg2tNBt0q05Y4lxuu)
with the hope that any interested parties can download it.
The original C++ program was written in Spanish. During the translation process, a few liberties were taken in renaming some of the components and reorganized some of the code for (my) better understanding. You can find the original C++ code, commented out, at the bottom of each module. Note that the library is open-source.
It runs reasonably well, but the advanced example program has thrown an exception or two which I haven't resolved as yet. It looks like the statement "IF temp^.previous^.previous <> NULL THEN"
in the FuzzyComposition.build() method (line 16) is allowing a call on the next line when the pointer is invalid. If someone knows how to verify a pointer before using it, I would appreciate knowing how it's done. Apparently, the __TRY/__CATCH exception handler isn't available on the simulation platform.
<> NULL THEN
// result = rebuild(zPoint, zPoint->next, temp->previous, temp->previous->previous); C++ original source
build := THIS^.rebuild(zPoint, zPoint^.next, temp^.previous, temp^.previous^.previous