Store PLCnext CommunityPLCnext on LinkedInPLCnext on Instagram  PLCnext on YouTube Github PLCnext CommunityStore PLCnext Community

  1. Arne Smets
  2. PLCnext Technology & PLCnext Controls
  3. Wednesday, 17 March 2021
Hello,

I'm asking quite a lot the last days, but we have different problems now and then with C# in PLCNext Engineer. We think the way PLCNext uses C# is very very good and we understand the whole tech is still in an early phase. So if there are no answers, it's no problem. It can maybe help out the community and inspire future updates.

We have 2 new bugs:
1) Longs are not handled correctly. We wanted to use the systemtime of the PLCNext. This should be connected to a long in c#, as the readme also shows. It is not giving an error in VS, but it is in PLCNext Engineer. "Native Error" and "Internal Error" are often shown. On the WBM or in the outputlog is sometimes the solution, but the long variable is the problem we think. Is this known? Could it be that longs are not fully supported in PLCNext Engineer? We made a timer based on system time. Should we do this on a different way?

2) a constructor in C# can not have parameters. We wanted to call a different FB in C# code. We have assigned memory for it and after we are able to call the __Init() and __Execution() of the functionblock. But when we want to add parameters to the constructor, PLCNext is giving the vague internal error/native error. We know it's from the parameters in the constructor, but why is this not possible?

Once more, we don't expect an answer. If there is it is very nice to get it, but we are also asking to help out the technology.

Kind regards,

Arne
Accepted Answer
Eduard PLCnext Team Accepted Answer Pending Moderation
0
Votes
Undo
Hello Arne,

thank you for your feedback. I assume that you will try to solve the issues yourself.
If you have any further questions or need help, please don't hesitate to ask.

Best Regards
Eduard
Phoenix Contact Electronics Headquarter - PLCnext Runtime Product Management and Support
Arne Smets Accepted Answer Pending Moderation
0
Votes
Undo
So I've an update on this. We have found this page: https://www.plcnext.help/te/Programming/Csharp/Csharp_Supported_functions.htm
What we do from now on is using a base C# class to add all functionality. The easier the functionblock is, the less problems we face. In the baseclass, the PLCNext Engineer related problems dissapear because it's fully C# stuff.
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.