04-29-2019 07:57 AM
Hi
I encountering an error (1172) when I try to read / write values to a Twincat PLC program.
The program I'm using is a sample program developed by beckhoff (attached in link below).
I have marked where the error occurs.
I have accomplished to read / write string variables to the PLC, so the connection works
I hope some of have have an solution 🙂
Solved! Go to Solution.
04-29-2019 03:18 PM
I assume that you have loaded the correct TwinCAT project, i.e., the one that is included in the Sample07.pro file. Do not have access to TwinCAT currently to open and check the contents of the .pro file.
However, the error that you get seems to be coming from one/many missing variable(s) in TwinCAT. Check whether MAIN in the PLC project that you are running has variables Bool1, dint1, usint1, lreal1, str1, str2, and complexStruct1.
04-29-2019 04:36 PM
OK, the problem it seems, is due to a missing task containing MAIN in the Sample07 TwinCAT PLC project.
As you can see, without any modification if I compile the project, MAIN is grayed out as it is not referenced by any task.
After adding a new task (Task3) and creating a corresponding reference task (Task_3) in the Sample07 PLC project to which MAIN is assigned, everything works ( or sort of, the complex cluster doesn't work 100% but that you should be able to debug 😄 )...
04-30-2019 02:31 AM
Thank you for the answer..
I completely failed to see the sample.pro file (I did make my own TwinCAT PLC program)..
But I tried your suggestions, and if I compile without any modifications it works fine.. I did not need to add a new task.
11-16-2022 09:40 AM
Hi there,
I'm trying to read/write values to a twincat PLC program and I'm searching for samples in order to develop the communication.
I would like to analyze your TcatADS_LVSample07.vi 119 KB to learn how it's done, but I can't open it because I only have the LV17 and the VI you provided is a LV18 . I cannot downgrade the version.
Can you please downgrade me the version to analyze the example please?
Appreciate the attention. TY
11-17-2022 01:03 AM
LV2018 version attached
and create new post next time. you are posting in an old thread. There is separate group for version conversion.
01-23-2023 04:41 PM
Hi bharathp10
I'm trying to read/write variables on a Twincat PLC and looking for insight into how I work with structs.
In your TcatADS_LVSample07.vi there are two missing files which look very attractive to learn, could you please share the two files TcatADS_LVSample07_WriteComplexStruct.vi and TcatADS_LVSample07_ReadComplexStruct.vi?
Thanks!
Asper
02-19-2023 02:40 AM
Hi asper,
I don's have those vi's with me. And even they are removed from Beckhoff info site. But you can create one by yourself
-- right click on Reg event callback>>select Create callback vi.
Use the event data for accessing the prop/methods.
Thanks