Inport not showing in PLCnext Engineer

I buillt my C++ program in eclipse and added the outport " //#port //#attributes(Output) //#name(Q_intTest) int16 myFirstInt = 0;" but for some reason when I got into plcnext it doesn’t pick up the outport. Also my c++ program uses multiple variables, about 190 that I want to give boolean information to the outports on I/O module to control whether it is off or on. Do I need to make an output for each variable?

[quote]for some reason when I got into plcnext it doesn’t pick up the outport.[/quote]What version of PLCnext Engineer are you using? Is the port variable defined in a C++ Program, or in a C++ Component? Is an instance of the program created in PLCnext Engineer? There was an issue in version 2021.3 where port variables were not displayed correctly when a new version of a library was added to a PLCnext Engineer project => does the same problem happen when you add the library to a new PLCnext Engineer project? [quote]Also my c++ program uses multiple variables, about 190 that I want to give boolean information to the outports on I/O module to control whether it is off or on. Do I need to make an output for each variable?[/quote]Not necessarily. If the boolean variables are part of one array, then you can make a single port variable for the entire array. Or, you could create a struct containing boolean fields, and the struct containing all the bools could be one port variable.

The port variable is already defined in the C++ program and I am using version 2021.0. The exact way I defined each port variable is shown below. //#port //#attributes(Output) //#name(solenoid0) boolean solenoid0;" I did this from a 0 to 191

I have created a C++ program in Eclipse, for AXC F 2152 FW 2021.0.5. The C++ program has this port definition: [attachment]2021-06-07_19-39-53.jpg[/attachment] I built the PLCnext Engineer library, and then in PLCnext Engineer version 2021.0.3: [list] [*] created a new PLCnext Engineer project for AXC F 2152 FW 2021.0 [*] created one IN port in the Main program, called Sol1, of type BOOL [] added the C++ library to the project [] created an instance of the C++ program [/list] In the Port List window, you can see that the C++ program port appears correctly: [attachment]2021-06-07_19-40-44.jpg[/attachment] Does this procedure work for you? .

2021-06-07_19-39-53.jpg
2021-06-07_19-40-44.jpg

I followed your steps but for some reason it is not giving me the import of the variable that I created. edit: For some reason I had to close the main program for the import to show but the outport that I created is still not being picked up

Capture.JPG

In My eclipse IDE I also have this error/warning I’m not sure if this could be the cause. „Problem description: Member ‚solenoid0‘ was not initialized in this constructor“ Is what the warning says next to inline_WaterCurtain_GSULogoProgram The error about that displays „incline is not spelled correctly“

Capture.JPG

I’m not sure that those warnings are a problem. If the Eclipse build completes successfully, that’s the main thing. I’d like to see an Eclipse project that shows this problem. If it’s OK with you, I can send you an email with details of where to send a (preferably minimal) Eclipse project that has this problem. I will also send you the PLCnext Engineer library that I used in the example above, so you can check if you get the Output port from that program in your PLCnext Engineer project.

Yes that would be great! Edit: It seems that the reason it wasnt workinf for me was because I was not giving the boolean variable a value. This below seemed to fix it. //#port //#attributes(Output) //#name(solenoid0) boolean solenoid0 = false;

Capture.JPG

My next question is how I would I go about connecting these variables to outputs on my I/O module?

It’s great that the problem is now solved. For other users looking at this thread - the lack of an initial value shouldn’t have caused a problem. You can see in my example that the variable was not initialised, and it worked OK. Thanks for starting a new thread with the next question, we will look at it there.