Industrial Communications

cancel
Showing results for 
Search instead for 
Did you mean: 

Interfacing S7-300 PLC with OPC variable not having any value

Hi, i am trying to interface a Seimens S7-300 PLC with LabVIEW with the MPI protocol. I followed the webcast "Connect to any PLC using LabVIEW". There are 2 problems that i face,

 

1. There is a Timeout Dialog Box which ofcourse times out the connection to the PLC. This allows a max time of 30seconds. Can i increase the Time out in any way?

 

2. When i create a variable as shown in the webcast, it does not have any value nor does it have a time stamp value as the variable in the webcast. I am uploading a picture here to make it clear. I wanted to know why does this happen? It does display the system variable values as being valid and also updates them.

 

Thanks.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 1 of 8
(8,167 Views)

Hello,

 

Can you please provide some more details on your problem?

Many people may not be familiar with the webcast you are watching.  Can you please provide a link for reference?

Where is the timeout dialog box you are refering to?  Is this in OPC Server? Quick Client? LabVIEW?

Also, are you 100% sure that the tag address is correct?  If you are able to connect to the system tags, it should easily connect to the PLC data if all of the tags are set up correctly.  Double check your PLCs documentation and try also connecting to a different tag in case there's something wrong with that specific one.

 

 

0 Kudos
Message 2 of 8
(8,155 Views)

Hi David,

 

This is the webcast i am talking about

 

http://zone.ni.com/wv/app/doc/p/id/wv-263

 

I am using LabVIEW 8.6, NI OPC Servers to connect with an S7-300 PLC using the MPI protocol. Following the procedure outlined in the webcast:

 

Opened OPC servers:

 

1.Created a Channel.


2.Cose the device driver.

 

3. Set the serial communcations settings(Baudrate etc) according the configuration settings of the PLC.

 

 After doing step 3 i get a dialog box asking me to set the time out period of the PLC (which i set to 30 seconds i-e the max that was allowable). I also set the write attemps before failure(which i set to 8).

 

4. Added a Device and gave it an arbitrary name.

 

5. Chose the device model.

 

6. Set the Device ID to 1.

 

Than i added a tag. Gave the name Input, the address of the input and all(which was accepted by the OPCServer).

 

After creating a tag when i open the OPC Client, all system variables are displayed as being valid and also get updated but the tag i created has no value and there is not updating taking place as indicated by the time stamp. I will change the tag and also see if i can upload a video of exactly what i am doing.

 

Thanks for your reply.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 3 of 8
(8,150 Views)

Hi David, i think i found the problem but i cant resolve it.

 

When i installed OPC server i get this error(attached picture). I tried re installing OPC servers but it does not help. I say this as the problem because i am able to do all the steps on my laptop on which i haven't got a PLC connected and get the same message for my input.

 

Thanks.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 4 of 8
(8,139 Views)

I'm not sure that this error you are receiving is necessarily related to the problems you are seeing with your S7 because the dll that it claims is missing is for the Dataforth Isolynx hardware.  However I do not get this error on my end. 

 

As for the timeout, it seems that 30 seconds is a software defined maximum which you cannot increase.  However if your device doesn't respond after 30 seconds, it probably never will so it may not be too much help to make this larger. 

 

Also just because the system tags are giving data, does not mean that you have a successful connection to your device.  I have no hardware connected to my OPC server, but still get good data from all of the system tags.  You probably are having connection problems to your device.  Do you have any way to verify that your connection is good to your S7?  You may consider contacting Siemans tech support to get the hardware up and working and they try again to connect to it.


Finally I would verify that the tag address that you are trying to connect to is a valid address for the data you are trying to read.  It may not return an error because the addressing syntax is correct, but it might be an out of range address for the specific device or it might be an address for data that you aren't using in your PLC..  

0 Kudos
Message 5 of 8
(8,129 Views)

Hi David,

 

About your point of carrying out all the steps i outlined with out a S7 connected to your PC was how i found out that i wasn't connecting with the S7. I understand about the system tags not being related to S7 internal values(got the same on my laptop and it does not even have a serial port!). About the connection to the S7, on the same computer SIMATIC STEP7(the software to run the PLC) is also installed and it allows us to communcate and program the PLC with any problems. I will try a different tag address and contact Siemens if needed. Will post an update as as move on.

 

Thanks for your reply.

LabVIEW 8.2,8.6,2009...still learning 😛
0 Kudos
Message 6 of 8
(8,113 Views)

hi

i dont have opc client for connect labview with plc 300

this is my final project

please help me

mhsaberi71@gmail.com

:womansad:

 

0 Kudos
Message 7 of 8
(6,149 Views)

Hi Mhsaberi71,

 

I'm not sure I fully understand your post, but it sounds like you're trying to use LabVIEW to interface with a PLC. Is that the case? If it is, you have a couple of options, which are detailed in the documents linked below.

 

Connect LabVIEW to Any PLC Using OPC

 

How Do I Use OPC in LabVIEW?

 

To summarize, you have a couple of options to connect to your PLC through LabVIEW:

 

1) If you already have an OPC Server connected to the PLC, you can use the DataSocket API in LabVIEW to pull the tag values off the OPC Server.

 

2) If you have access to the LabVIEW DSC module, you can also use a DSC I/O server to connect to the 3rd party OPC server.

 

3) If you do not have an OPC server already publishing the values, you can use NI OPC Servers to connect to your PLC. You can then use options 1 or 2 to connect to NI OPC Servers using LabVIEW.

 

Also, just as a side note, you are posting on an older thread. You might get a better response from the community if you create a new thread on the Industrial Communications board.

 

Regards,

Ryan K.
Product Manager, ATCA and BEEcube
National Instruments
0 Kudos
Message 8 of 8
(6,125 Views)