Differences in functions after library update and migration

Hi, I am currently migrating a project from pcworx to PLCnext, in the original project there is the function “STRING_TO_BUFFER” used. In the PLCnext library’s it is changed to “STRING_COPY”. I’m trying to figure out which changes i need to do, to get this to work. I think most off it is correct when i compare the help on both functions, but the only thing I’m having trouble with figuring out is the output. In pcworx this is an INT but in PLCnext this is a BOOL. In the attachments are prints of both the help pages. (When looking at the print of pcworx it will be clear that the help is really basic, and not really a big description.. :s)

Hello Joel, There is a STRING_TO_BUF function block in PLCnext Engineer … can you use this? - Martin

Well when comparing both the help-functions off STRING_COPY and STRING_TO_BUF. I would say STRING_COPY is closest to the function from pcworx, buildwise that is. I am going to dig a little bit deeper in the STRING_TO_BUF and I’ll place my findings here. :slight_smile:


GSDML-V2.4-Cognex-DataManClassB-20210315.txt

The function block STRING_TO_BUF is more off a global function. If you want to copy some data to a buffer, as it can copy data types from a variable, array or even elements of a user defined struct. but when used for a string the functionality of the function block changes. So for my migrating project i think it’s best that I just use the STRING_COPY, because it looks more like the function in PCworx.