-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1. improve symbol loading performance 2. imrpove fuzzy search performance
- Loading branch information
Showing
7 changed files
with
118 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## Custom Ignore Variables Pattern | ||
|
||
when load twincat project variables, sometimes it's nice to ignore some variables, such as: | ||
|
||
 | ||
|
||
- `axis.PlcToNc.xxx` | ||
|
||
When multiple axis are used, these unnecessary variables will significantly slower the program, hence it's good to provide a filter to remove such variables. Moreover, it's better to provide a custom filter (of cource some default rules are provides)? | ||
|
||
|
||
|
||
## Remove Multiple Variables | ||
|
||
when a variable is passed into a function block, whether it's by `VAR_INPUT` or `VAR_IN_OUT`, the twincat ads api will return handles for the variable out and in the function block, although they are basically the identical one. | ||
|
||
 | ||
|
||
To identify the duplicated variables, notice that they have same last name: | ||
- `axis.NcToPlc.ActPos` => `NcToPlc.ActPos` | ||
- `power_motor.Axis.NcToPlc.ActPos`=>`Axis.NcToPlc.ActPos` | ||
|
||
the idea is to retain the variable with shortest name in the group of variables. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
using TwinCAT.TypeSystem; | ||
|
||
namespace TwincatToolbox.Extensions; | ||
public static class ISymbolExtension | ||
{ | ||
// note: this method can cause problems if the symbol name is not unique | ||
public static string GetSymbolName(this ISymbol symbol) { | ||
return symbol.InstanceName.ToLower(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters