From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication Beckhoff TwinCat - LabView (ActiveX)

Hy Newsgroup!

Has any one experience in accessing the TwinCat PLC via LabView??
On my testsystem i have tried it for many hours, but without any success.
I have used the AdsOcx Libary, but it doesn't work.
Im glad, if someone has a hint or a sample program.

Thx for your answers!

Greez
0 Kudos
Message 1 of 28
(18,000 Views)
old thread, however
 
just found this document in the web:
 
 
ups... maybe not a good link ....
 
you find the appnote 'Using National Instruments LabView with TwinCAT I/O' at this page:
 
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 2 of 28
(17,848 Views)
Hello Henrik, beside the example below that shows how to link between Twincat I/O and Labview, are there any example that show how to read input data from the CX9000 PLC into Labview?  Thanks for any viable advise.
0 Kudos
Message 3 of 28
(17,323 Views)

Hi Phooi,

Are you using an OPC server with your PLC?  If so, you can use DataSocket in LabVIEW to read the input from the hardware.  There are several good examples of using DataSocket found in the NI Example Finder.  In LabVIEW, go to Help » Find Examples… and then click the Search tab.  Search for DataSocket and this should populate a list of example VIs.  Some of the more useful ones for getting started with DataSocket are Multiple OPC Items Monitor.vi, Front Panel DataSocket Read.vi and DS Reader.vi.

Donovan
Message 4 of 28
(17,304 Views)

Thanks Donovan. But my PLC currently do not have OPC server. Are there any other alternatives available?

Appreciate any viable advise.

0 Kudos
Message 5 of 28
(17,297 Views)

Hi Phooi,

I did not find any drivers for your PLC on our Instrument Driver Network.  If Beckhoff does not have a LabVIEW driver for your PLC and the example from their website will not work for you, you can make a request for this driver at the Product Suggestion Center.  I'm not sure of the protocol that the PLC uses to communicate.  If you know that, you may be able to write your own driver.

Donovan
0 Kudos
Message 6 of 28
(17,282 Views)

Hi !

 

I use the .net controls provided by beckhoff to communicate with the CX9010 device

It is ADS based and works great but needed a few weeks to translate to .NET in labview.

 

If you want a simple example just write.

 

Best regards

 

gernot 

Gernot Hanel
IONICON Analytik Gesellschaft m.b.H.
Message 7 of 28
(16,721 Views)

If this thread is still active, I started with TwinCAT's ADSOCX and LabVIEW 7.1 in 2005.  There were some issues with passing arrays between the two interfaces, but I was able to get it to work.  I am starting a new project to use a different Beckhoff PLC.  I plan to use the .NET component and would like to use events to update various controls when PLC values fire.  Are there any .NET examples or TwinCAT specific examples to perform this type of task?

 

Regards,
Kenneth

0 Kudos
Message 8 of 28
(16,662 Views)

I think I have a example for you especially regarding the eventing. It was a hard task but now works very good with .NET events.

 

Here are the screenshos of the two main vi's which I am using to make the eventing procedure. Then Main produces the handlers and all other stuff and the callback is responsible to bring the values into the application.

 

Hope this helps

 

Best regards

 

gernot

 

Gernot Hanel
IONICON Analytik Gesellschaft m.b.H.
Download All
0 Kudos
Message 9 of 28
(16,634 Views)
Message 10 of 28
(16,593 Views)