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: 

Siemens S7 300 PLC and Labview Communication

Hi,
 
I am attempting to communicate between Labview 7 and a Siemens S7 300 (CPU 314) PLC. I would prefer the communication to be over Ethernet or RS 232. Could you help me out with this implementation and let me know what additional hardware/software I may require for doing this.
 
Thanks,
Shameek
0 Kudos
Message 1 of 15
(20,841 Views)
I never worked with Siemens PLCs, but a quick search returns quite a lot of hits.

___________________
Try to take over the world!
0 Kudos
Message 2 of 15
(20,828 Views)

Hi,

Thanks for the link. I have looked into quite a few of these and was wondering if the OPC server is an absolute necessity if I am using Ethernet.

Thanks,

Shameek

0 Kudos
Message 3 of 15
(20,826 Views)
In my experience, most PLCs also have either a standard protocol (like Modbus) or a custom protocol which is either ASCII or binary based.

If it's something like Modbus, it's fairly easy, because you can find all kinds of implementations for these protocols.

If it's a custom protocol, then you will have to find the documentation and implement the protocol yourself using the TCP VIs. Implementing the full protocol is usually not a trivial task, but if you only want some simple commands (e.g. "Read DI", "Write DI"), then you might be able to do it, at least if the protocol is simple enough.
There's also a chance that someone already wrote VIs for that and posted them to the web or is willing to post\sell them.

___________________
Try to take over the world!
0 Kudos
Message 4 of 15
(20,816 Views)
I worked with a Seimens PLC before that used the Modbus protocol running over a TCP connection. Check the PLC's documentation as to what your communications options are.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 15
(20,806 Views)

I am using a CP-343 communications processor to connect the S7 300 to industrial ethernet. Now can I commnicate directly from Labview to the PLC? I still havent figured out where the OPC server comes in and whether it is an option or a necessity.

Shameek

0 Kudos
Message 6 of 15
(20,786 Views)


@Shameek wrote:

I am using a CP-343 communications processor to connect the S7 300 to industrial ethernet.
Now can I commnicate directly from Labview to the PLC?
I still havent figured out where the OPC server comes in and whether it is an option or a necessity.



Using OPC is an option.
Siemens has an the add-on ($$) library/FB  that includes code for enabling Modbus communication with S7 300 CPUs. I've never used it, but info is here.

<snip>
Our solution
With its MODBUS function block (FB) and the CP343-1 and CP443-1 SIMATIC S7 communications processors, Siemens can supply a proven solution for the integration of SIMATIC automation systems into other system landscapes. This function block enables data to be exchanged easily between MODBUS-compatible devices from different manufacturers and SIMATIC S7 stations from S7-300 and S7-400 systems.

</snip>

=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 7 of 15
(20,774 Views)

Hi,

Thanks for your replies. So is this the way to go?

PLC > PC Using Ethernet card and the PLC comm module > OPC server on PC > Labview by Datasocket

Shameek

0 Kudos
Message 8 of 15
(20,751 Views)
Hi Shameek,
 
We actually have a specific module meant, in large part, for communication between LabVIEW and OPC Servers. This is the Datalogging and Supervisory Control. With it, in your project you can easily add an OPC server for and set up your variables.  You could also use Datasocket but it is easier and better if you have a lot of variables to use DSC.
 
Here is a clip from this site on DSC: " It includes tools for logging data to a networked historical database, real-time and historical trending, managing alarms and events, networking LabVIEW Real-Time targets and OPC devices into one complete system, and adding security to user interfaces."
 
Stephanie
0 Kudos
Message 9 of 15
(20,746 Views)
Shameek,
 
I know this is an old post, but I though I'd make you (and others searching the posts) aware of the MPI S7 Example posted on NI Community:
 
 
Marc
0 Kudos
Message 10 of 15
(17,725 Views)