Skip to content

Migration to 4026.13#92

Merged
ZLLentz merged 8 commits intopcdshub:masterfrom
yannS2016:migration-4026.13
Apr 15, 2025
Merged

Migration to 4026.13#92
ZLLentz merged 8 commits intopcdshub:masterfrom
yannS2016:migration-4026.13

Conversation

@yannS2016
Copy link
Contributor

@yannS2016 yannS2016 commented Feb 12, 2025

Description

Migration of LCLS General Library to the latest TwinCAT, 4026.13
Changes made are on different project-level files for 4026.13 compilation. The visualization profile was updated to the latest version.

Motivation and Context

Upgrade Beckhoff PLC systems to latest TwinCAT software toolsuite (4026.13).

How Has This Been Tested?

The Library Unit test were run using the TwinCAT Usermode runtime result as shown below.
general-test

Note: Backward compatibility tests, the project library references pins were removed, and a runtime test was performed under 4024.56(my development lab only supported this version). Test results can be seen below.

general-4024 56

Additional compatibility tests were run on 4022.30 Live PLC as show below:
LCLS_Genral_4022_30

Where Has This Been Documented?

A change was made in the declaration of fileTime: T_FILETIME; to fix the error:
Error SA0027: Variable name 'fileTime' in 'FB_UnixTimeStamp' already used for an object in Library 'tc3_globaltypes_global - lclsgeneral, 1.0.0.0 (beckhoff automation gmbh)' LCLSGeneral (LCLSGeneral\LCLSGeneral) C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\Functions\FB_UnixTimeStamp.TcPOU (Decl) 30
Fix: The variable was renamed: stfileTime throughout the 'FB_UnixTimeStamp' POU.

C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\Hardware\FB_ThermoCouple.TcPOU (Decl)(6) : warning: C0373: Function Block FB_ThermoCouple is deprecated and may be removed in a future release C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setBit (Impl)(2) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setBit' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setBit (Impl)(5) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setBit' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setBit (Impl)(5) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setBit' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setBit (Impl)(9) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setBit' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setBit (Impl)(10) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setBit' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setBit (Impl)(12) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setBit' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setMessage (Impl)(1) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setMessage' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\EPS\FB_EPS.TcPOU@setDescription (Impl)(1) : warning: C0371: Access to VAR_IN_OUT 'eps' declared in 'FB_EPS' from external context 'setDescription' C:\Users\ysmandza\Documents\lcls\lcls-twincat-general\LCLSGeneral\LCLSGeneral\POUs\Tests\FB_CircuitBreaker_Test.TcPOU@SingleBadLogger (Impl)(7) : warning: C0195: Implicit conversion from signed Type 'INT' to unsigned Type 'UINT' : Possible change of sign Compile complete -- 0 errors, 10 warnings

This warning Implicit conversion from signed Type 'INT' to unsigned Type 'UINT' fix by wrapping type conversion as below:
INT_TO_UINT(GVL_LOGGER.nMinTimeViolationAcceptable)

Proposed fixed based on Beckhoff info docs: check the validity of the var_in_out var in the method before any access. one can then choose to disable the warning in project properties.

// Checking the VAR_IN_OUT reference, leave the current method in case of an invalid reference
IF NOT __ISVALIDREF(eps) THEN
	RETURN;
END_IF
// Access to VAR_IN_OUT reference (only if the reference was confirmed as valid before)

Below are the reference placeholders for pinned dependencies (4026 only) we reverted to the default placeholder for backward compatility tests.
general-refs

Pre-merge checklist

  • Code works interactively
  • Code contains descriptive comments
  • Test suite passes locally
  • Libraries are set to Always Newest version (Library, *)
  • Committed with pre-commit or ran pre-commit run --all-files

ysmandza added 3 commits February 11, 2025 11:10
</PlaceholderResolution>
<PlaceholderResolution Include="Tc2_System">
<Resolution>Tc2_System, * (Beckhoff Automation GmbH)</Resolution>
<Resolution>Tc2_System, 3.6.4.0 (Beckhoff Automation GmbH)</Resolution>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned about these pins. Doesn't this mean the library will no longer be usable on the older 4024 projects?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i may be wrong but this pins are temporary. we should indeed tag the latest/default version on the target. with this pin we can track the version that have been use to test these library on 4026.13. @NSLentz can shed some light on this as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Restore Libraries to default. i'll create 4024 branches to unittest internal code fixes and add on.

Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only concern is the usability on older PLCs. Are we dropping support entirely for old PLCs or does this work on them? My intuition is that strict pins at the library level reduces our ability to be flexible here.

I'll approve if this has been tested on a real 4024 PLC too, or if we agree as a full team that it isn't important.

@yannS2016
Copy link
Contributor Author

My only concern is the usability on older PLCs. Are we dropping support entirely for old PLCs or does this work on them? My intuition is that strict pins at the library level reduces our ability to be flexible here.

I'll approve if this has been tested on a real 4024 PLC too, or if we agree as a full team that it isn't important.

@yannS2016 yannS2016 closed this Feb 14, 2025
@yannS2016 yannS2016 reopened this Feb 14, 2025
Copy link
Member

@ZLLentz ZLLentz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yann confirmed offline that this works on older PLCs too

@ZLLentz ZLLentz merged commit ddc935b into pcdshub:master Apr 15, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants