-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble accessing input bits #68
Comments
Do you have the ESI file available? I could not find it for download. According to https://www.ethercat.org/download/documents/EtherCAT_Device_Protocol_Poster.pdf there are no output data at offset 1000 (hex?). The output data should begin at offset In your question you are mixing SDO and PDO, I am not sure what you really want to read. SDOs are for configuration (before startup) and PDOs contain the process data (e.g. measurement data). I don't know where your EtherCAT.NET/sample/SampleMaster/Program.cs Line 126 in 51f59a8
From there you can continue extracting the right bit. |
Thanks for your reply. Sorry for mixing up sdo and pdo. I meant pdo of course. the
I wrote a method inside my class based on DigitalOut with some modifications to read the outputs of the device as bool value
I call e.g. GetBoolOutputValue(7, 2) which should be TRUE, but always returns FALSE. according to the documentation I have 7.2 should be "READY" and be true. (I verified this using a beckhoff plc) SlavePdos[6].Variables[7].Index = 2000 and SlavePdos[6].Variables[7].SubIndex = 8 in my case. So I assume the index 2000 is correct. I'm kind of lost now and don't know how I can continue because no matter what input I query all are FALSE. :-( I can upload the full test code if you want to. |
You cannot use SdoRead to read PDO data (at least I have never seen this). So your method might not work: You could instead try to print the full IO map. The IO map is not directly accessible but the start pointer of the IO map is equal to the pointer of the very first variable in the system. Please run the following code once after
What is this "READY" value? When should it be true, i.e. what are the preconditions? Is it for example necessary for the slave to be in the EtherCAT OP state to be "READY"? |
Oh sh*t! I made the same error again. 🤦♂️🤦♂️ |
Thats what I get.
So my slave attatched actually deliveres data. Btw. the READY value is configured to reflect the state of my device when it's "ready for action".. The ethercat slave itself is in operational state. I checked this using this:
Prints "Operational" I will try to access the data inside the PDO Variables to access the actual bits I need and come back here.. |
First off all thanks for the great library. I managed it to make it runnable.
But now I have trouble accessing my inputs and outputs through the memorymapping.
I use an hilscher NIC RE 50 module which has both an input area and an output area.
The inputs have an offset address of 1000, the outputs 2000
Lets say I want to read From the outputs (sdoindex 2000) Byte no. 8 Bit no. 2.
How to do this?
In the SlavePdos I can see that the 6th pdo is the start of the outputs so I assume this has address 2000.
Now I try to get the correct offset:
But the value is always false no matter what byte and bit offset I ask for.
I 've seen that in soemwrapper there is a function ecx_SDOread of which the parameter sdoIndex is the addess to read.
when using ethercat-explorer (https://sourceforge.net/p/ethercat-explorer/svn/HEAD/tree/)
which uses also semwrapper but oviously a different version? I can query address 2000 and get a pretty long byte array in which some bytes do have values. This code is calling ecx_sdoread as well...
So. how can I achieve to read some bool or short from an defined offset??
Any help highly appreciated!
Regards, Benny
The text was updated successfully, but these errors were encountered: