Variable links problem in TwinCAT 3 on windows 10 - twincat

I am using TwinCAT 3 on Windows 10, and create a PLC project in visual studio 2013 shell(isolated). When I try to link an output variable to an input variable by “Change Link”, there is always no avaible variable to be linked.
The pop-up window is as following:
Attach Variable pop-up window
What may be the problem?

If you want to link the variable with a project instance variable you need to uncheck "exclude same image" otherwise if you want to link the variable with a hardware IO you need to have an IO tree attached to your Ethercat Master.

Related

How to watch recursive function variables simultaneously in Visual Studio

When debugging in Visual Studio you can see the local variables for the current function that is running in the Locals window. You can also watch specific variables by right clicking them and clicking Add Watch.
However, when watching a variable in a recursive function, it will only show the value for that variable for the latest iteration of the function call the recursion has progressed to.
Is there a way to view the variable contents of each iteration of a recursive function call and have them displayed together in the Local/Watch windows?
I've researched the problem further and found the Parellel Watch functionality within Visual Studio.
While in Debug mode, once hitting a breakpoint you can click
Debug > Windows > Parallel Watch
Which keeps track of multiple threads open for the watched function, allowing you to select and inspect the local variables for each thread.
https://learn.microsoft.com/en-us/visualstudio/debugger/how-to-use-the-parallel-watch-window?view=vs-2019
This is not possible in Visual Studio. You may consider other ways, such as logging/outputting(Debug.WriteLine, Trace.WriteLine…) the value of variables in the function, or installing some extensions to help log value of variables.

Warning #224: Cannot determine machine load balance - Using KMP_DYNAMIC_MODE=thread limit

Hi I got thi error on a application = Cyclone Register
OMP: Warning #224: Cannot determine machine load balance - Using KMP_DYNAMIC_MODE=thread limit
Its this issue solvable by user or it need correction in actual code of the application ?
App fall back form multithread to single thread work, so hard limitation.
Tested on i9 and DualXeon v1, same issue
Solved today with help of support, but this can be a solution for others. app running under Windows 10 x64, unknown complier or etc.
Open the Start Search, type in “env”, and choose “Edit the system environment variables”: - Click the “Environment Variables…” button.
It need to be added to Windows as a variable
Variable name = KMP_DYNAMIC_MODE
Variable Value = thread_limit
Set the environment variables as needed. The New button adds an additional variable. - Dismiss all of the dialogs by choosing “OK”. Your changes are saved!

Forms12c Frm-42431 Unable to Initialize Debugger Debugger Error

Version Information
Weblogic 12.2.1.3,
Forms [64 Bit] Version 12.2.1.3.0
I have installed Forms Builder only on my machine. I follow the proper configuration steps to configure the forms.
Full installation of WebLogic on a separate server.
When I am trying to run a module through the form developer's debug push button it shows the below message
"Frm-42431 Unable to Initialize Debugger"
I made the change in formsweb.cfg allow_debug=true, and also debugger.jar is included in class path in default.env.
Help is also not working. When I try to open the help system. The below message is open.
FRM-18105: Failed to start the help system.
Please help me find out the solution for this problem.
You need to make sure your local environment variable(FORMS_BUILDER_CLASSPATH) is the same as what is in the registry editor(check under KEY_OracleHome1). If not the same or you don't find it in the local environment variables just do this:
Open Registry Editor -> computer -> HKEY_LOCAL_MACHINES -> Software -> Oracle -> KEY_OracleHome1
Look for FORMS_BUILDER_CLASSPATH right-click -> modify -> Copy all under value data
Paste it into the notepad and look for ORACLE HOME under FORMS_BUILDER_CLASSPATH do the same copy all under value data textbox that the path of your files.
Then go back to your note pad replace all '%ORACLE_HOME%' with the path you copied on oracle home.
It should look like this after replacing all :
C:\Oracle\Middleware\Oracle_Home\jlib\frmbld.jar;C:\Oracle\Middleware\Oracle_Home\jlib\importer.jar;C:\Oracle\Middleware\Oracle_Home\jlib\debugger.jar;C:\Oracle\Middleware\Oracle_Home\jlib\utj.jar;C:\Oracle\Middleware\Oracle_Home\oracle_common\jlib\ewt3.jar;C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\oracle.bali.share\share.jar;C:\Oracle\Middleware\Oracle_Home\jlib\dfc.jar;C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\oracle.help\ohj.jar;C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\oracle.help\help-share.jar;C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\oracle.help\oracle_ice.jar;C:\Oracle\Middleware\Oracle_Home\oracle_common\modules\oracle.bali.jewt\jewt4.jar;C:\Oracle\Middleware\Oracle_Home\forms\java\frmwebutil.jar;C:\Oracle\Middleware\Oracle_Home\forms\java\frmall.jar;C:\Oracle\Middleware\Oracle_Home\forms\java\frmwebsocketjsi.jar
Then go to environments variable under system variable click new then variable name add FORMS_BUILDER_CLASSPATH on value add all text you copied on note pad after replace.
Close and Open forms again it should work now.

Can I change code/values while in debugging mode?

In Visual Studio 2010 (Ultimate), is it possible to step through some code, and, if a variable is not correct (e.g. you want to get all records beginning with 'A' but there is none, so you want to try 'B' instead), is it possible to change the code while in debug mode, to do this (change variables while in debug mode)?
It is quite annoying to have to stop debugging, change a value, then debug again and see the result. It'd be much easier to do it all in debug mode, anyway.
Thanks
In the watch window just enter the statement you want executed. For example if you want to set the variable prefix to "B" then just type prefix = "B" and hit enter.
You may also change code while running, however there are a number of limitations to this feature. See Microsoft's Edit and Continue documentation for details: http://msdn.microsoft.com/en-us/library/bcew296c(v=vs.80).aspx.
In the Solution Explorer view, right-click on each reference of References, choose Properties. In the Properties view, sign False to the field of Embed Interop Types. This works for me.
c

Follow program execution through .DLL in hex representation

Is there a way to follow a program's execution through DLL code in hex?
For example, I want to see what sections have just been read when I press a button. It has to work for x64 DLL's.
Thanks!
Yes you load the process into debugger and single step it.
Load the project in visual studio.
Press 'Play' or F5 to start the program in the debugger.
You will need to eventually halt execution sometime so you can start stepping through code or assembly code. You can do this by inserting a breakpoint, or breaking the execution by hitting the break command in the visual studio IDE.
Once halted, you can right click in the code view window, and select "Show Disassembly". Then it will show you the machine instructions.
Also in the watch window in the visual studio debugger, the right click pop up menu has an option to display all variables as hexidecimal. I'm beginning to prefer hex myself lately, because I can see invalid memory patterns easier.
You can use the tool at http://ircdb.org to log function calls arbitrary DLLs.
It's name is SocketSpy, because initially it was created for tracing winsock.dll only, but it does allow you to trace other dlls.
From http://fixunix.com/programmer/95098-tracing-library-dll-calls-win32.html
Use Option->Default Break Point List
Menu to add or remove soft breakpoints
from attached DLLs. Put soft
breakpoints only at function you need
to maximize execution time.
Soft breakpoint means that socketspy
does not stop at this breakpoint, only
log breakpoint information. Hard
breakpoint means that socketspy DOES
STOP at this breakpoint, and
Breakpoint dialog is opened. Specify
what calls should be captured ALL,
FROM EXE FILE or from DLLs (Combobox).
Specify log file File->Open Log File
menu if you want to save function
DLLs' calls into the text file, enable
logging (check box).
Then select a new or already action
process (Select Process button). The
tool can be used in NT/2000/XP only
Alternatively, there is StraceNT, which can trace arbitrary Dlls. It is available for free from http://www.intellectualheaven.com/default.asp?BH=projects&H=strace.htm
I've not used it, but I once stumble upon an Intel tool, which samples the context of the Instruction Pointer, and is able to use symbol files to convert IP to an actual function name... VTune maybe?
I guess there might be other such tools
UPDATE: aka. "statistical profilers"...
Debugging using IDE does not show you the assembly language equivalent of the execution of an IL instruction. You need to write your own hooks to a proper disassembler.

Resources