Sending a String Array in C++ program to PLCNext Engineer
Hello,
In my C++ Program i am using a String Array to store ID's that are scanned, the ID's are all stored in the same Array, the Array is declared like this.
std::string IDPresent [50];
Is it possible to connect the Array to a port so i can use the value's in my PLCNext Engineer program? and if so, how?
Many thanks.
Comments
Hello,
Due to fixed length restrictions that come with IEC strings you need to use the type StaticString or StaticString\< customLength \>
Then you will need to create an array of that StaticString type.
kind regards,
Oliver
Hello Oliver,
Thanks for the answer. My next problem is to connect the StaticString Array to a port in PLCNEXT Engineer, I tried making a datatype like this:
TYPE
DataStringArray : ARRAY[0..49] of STRING;
END_TYPE
But the datatype doesn't seem to be compatible with the StaticStringArray. I have the StaticString Array declared like this in my c++ program:
//#port
//#name(StaticStringArray)
StaticString<80> StaticStringArray[50];
Many Thanks.
When I try to connect the 2 ports it doesn't give the option to connect. this is what i see in my Port list.
Hello Roy,
i think you might be using a old PLCnCLI Version.
https://www.plcnext-community.net/en/discussions/c-pass-the-output-to-plcnext.html
you notice that the ComponentName is still displayed at the type name.