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: 

Writing to S7-300 using VI in Labview

Greetings,

 

I am using OPC to communicate my S7-300 PLC to Labview. As OPC Server I am using NI OPC. I have created the bounded variables in the Labview project and everything works fine with reading variables but when I tried to wirte in the PLC there is no action in the variables I am trying to reach.

 

For example, I am trying to write a boolean value to a %M tag as the picture described but I do not get any result.

I have to point out that there is a code running in the PLC, is there any conflict between the code already running in the PLC and the vi in Labview? Or is there any module or license I am missing to be able to write in the PLC?

 

Thanks for all your help.

 

opc.JPG

0 Kudos
Message 1 of 2
(2,511 Views)

Good morning jdruano


Are you using DCOM or DataSocket? There are some considerations to take when writing arrays and it could also have some problems when trying to write in general.  You may find this information useful
Can DataSocket Read/Write Array Data Types from an OPC Server?
http://digital.ni.com/public.nsf/allkb/19FF0873E83EBCA986256BDF005F6B39?OpenDocument
In the following link you can find how we can make LabVIEW act as an OPC Server, so you can double check if there is not something you need to configure differently
http://ae.natinst.com/public.nsf/web/searchinternal/cc9cdd577f041786862572120061eb5a?OpenDocument

Using the LabVIEW Network-Published Shared Variable and OPC With NI-DAQmx
http://www.ni.com/tutorial/3742/en/
Have you tried to run the VI when the PLC is not busy? This could help us to be sure that there is not a communication problem.
What is the status of the firewall?
I hope you find this information usefull, please check the questions I did, this could help us to know more about the problem.

Thank you!

0 Kudos
Message 2 of 2
(2,449 Views)