LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing and reading array from labview to twincat plc

There is a coordinate measuring machine, and the task is to move the machine according to x,y, z values from an array.
 
For that I'm trying to write a 2-dimensional array from Labview to Twincat PLC and execute the movement commands based on the array values. As I mentioned above the array contains multiple x, y, and z points. To access the PLC an ActiveX controller is used, namely AdsOcx. I was able to write single values from Labview and also read it from PLC.
 
Does anyone know which invoke method can be used to read and write array from Labview to PLC? Or is there any other method?
 
Thank you for the help
0 Kudos
Message 1 of 6
(6,295 Views)
What protocol are you using to talk with the twincat?? If you were using modbus commands, you would use the write multiple registers command instead of the write single register.
0 Kudos
Message 2 of 6
(6,286 Views)

I would also like to know how to transfer Arrays from LabView to TwinCAT (for exampel a 10 x 32int Array).

 

Right now, I have an application which transfers 300 Bits from LabView to TwinCAT in 100ms via TCP/IP to a Beckhoff BC9000 controller. I do this using 10 individual 32int Variables with the AdsOcx AdsWriteLongReq. The problem here is, that it takes to much time for calling up 10 times the function AdsWriteLongReq. I do it in a for-loop and I have to place small breaks after ech AdsWriteLongReq call in this loop, in order to keep it running without errors. I would rather transfer all 10 int variables in one call, since they are all declared in a row (starting at adress 0 till adress 36)

 

I also figured out, that the AdsSyncWriteLongReq takes much longer than the AdsWriteLongReq command. I guess it is because of communication-acknowledgement

 

Does someone know a better way of how to transfer 300 Bits (or 38 Bytes) from LabView to TwinCAT in less than 100ms?

LabVIEW 2011
0 Kudos
Message 3 of 6
(5,959 Views)

Sorry, I forgot to mention, that my application is not workin within 100ms. It takes a lot longer than that.

 

I also attached a small VI which explains how the communication right now looks like.

LabVIEW 2011
0 Kudos
Message 4 of 6
(5,954 Views)

Check http://www.ackermann-automation.de/

They have libraries to comunicate with TWINCAT.

My current VI reads data from a beckhoff el3104 and displays it on a graph control, but the current sampling is 1 sec (for 60Hz wave I get nothing plausible). I'm working now to recode the programm to avoid calling the read function in a while loop.

Best regards

0 Kudos
Message 5 of 6
(5,356 Views)

Dear could u help me out in twincat Ads programing.I m developing a program code with Ads fuction block to read the same data from common memory adress but from multiple controllers having different Amsnet ids. How to change the Ams net id in common ads function block using program.

0 Kudos
Message 6 of 6
(4,315 Views)