FORUM CTRLX AUTOMATION
ctrlX World Partner Apps for ctrlX AUTOMATION
01-12-2023 09:23 AM
Hello
I have got problem with IL_ECATSoeRead function block from CXA_ETHERCATMASTER library.
I want to read S-0-0403 parameter value from HCS. I am using the IL_ECATSoeRead function block. After executing this function block I got an error:
After pressing Yes it opens new file manager window to find a library, but it is already installed.
After pressing No it opens windows like this:
The PLC program is then stopped and goes to Exception. What could cause this problem?
Currently I am also using the IL_ECATSoeWrite function block from the same library and it works perfect. I can write parameter value to the drive, there is no problem with this function block... but the IL_ECATSoeRead is not working 😕
Is there a solution for this problem? Maybe there is something wrong in this function block?
Best regards, Filip
Solved! Go to Solution.
01-12-2023 09:48 AM - edited 01-12-2023 09:53 AM
You are giving a number (SIZEOF) into "ValueAdr" but it needs to be a pointer.
...
ValueAdr:= ADR(wValueRead),
...
So the function block will access a wrong storage address via this "pointer" and get an access violation (and so an exception) ctrlX PLC Engineering tries to debug the code and asks if you want to open the source. As it is a compiled library you cannot access the internal source code and get the error.
See an example in this topic.
01-12-2023 04:25 PM
Ohh yes... I made a typical "ctrl + C & ctrl + V" mistake and I didn't see that there should be ADR instead of SIZEOF in this line. Now everything is working correctly. Thank you very much for you quick answer and for you help :).
Have a nice day 🙂
Filip