Hello,
My project task is to read from EtherCAT 128 analogue input channels at 500Hz, then transfer them to the PC as close to Real time as possible via ADS from Beckhoffs TwinCAT PLC.
The PC is going to be retrieving data every 100ms, by this time the EtherCAT should have received 50 pieces of Data per channel (500 samples a second per channel. 0.1s = 50)
This means i need to retreive from the PLC the following structure of Data:
Channel1 Channel2 Channel3 Channel4 Channel5 ....
0.11111 0.222222 0.333333 0.444444 0.555555
1.11111 1.222222 1.333333 1.444444 1.555555
2.11111 2.222222 2.333333 2.444444 2.555555
.....
...
..
I am using Structured Text and have managed to get a basic connection and pass data back and forth.
The only way I could manage to get this to work is by creating 128 arrays, then having 128 pointers in an Array then indexing the "pointer array". I dont like this solution because it is not expandable and seems very elaborate for achieving something that could be quite simple.
My question is how do I create a 2D array in TwinCAT PLC?
How do i use ADS (any variety .Net, ActiveX, dll) to retrieve a 2D array (I am using Labview but any example in VB or C will be greatfully appreciated)?
Thanks in advance
Joe
:site:
My project task is to read from EtherCAT 128 analogue input channels at 500Hz, then transfer them to the PC as close to Real time as possible via ADS from Beckhoffs TwinCAT PLC.
The PC is going to be retrieving data every 100ms, by this time the EtherCAT should have received 50 pieces of Data per channel (500 samples a second per channel. 0.1s = 50)
This means i need to retreive from the PLC the following structure of Data:
Channel1 Channel2 Channel3 Channel4 Channel5 ....
0.11111 0.222222 0.333333 0.444444 0.555555
1.11111 1.222222 1.333333 1.444444 1.555555
2.11111 2.222222 2.333333 2.444444 2.555555
.....
...
..
I am using Structured Text and have managed to get a basic connection and pass data back and forth.
The only way I could manage to get this to work is by creating 128 arrays, then having 128 pointers in an Array then indexing the "pointer array". I dont like this solution because it is not expandable and seems very elaborate for achieving something that could be quite simple.
My question is how do I create a 2D array in TwinCAT PLC?
How do i use ADS (any variety .Net, ActiveX, dll) to retrieve a 2D array (I am using Labview but any example in VB or C will be greatfully appreciated)?
Thanks in advance
Joe
:site:
Last edited: