LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI OPC Server - Scan Rate 10ms Limitation

Solved!
Go to solution

Hello,

  

We have a Siemens Microbox PLC S7-1500 with Windows 7 Embedded which operates three Electric Cylinders and gets the Force and Position readings from 2 other different measurement devices.

 

Aim of Work:

Mainly, we wanted to save the Force and Position measurements in TDMS file formats, thus we managed to transfer the measurements from Siemens PLC to LabVIEW via NI OPC Server to save the data in the TDMS through LabVIEW. But we want to receive around (300 Samples/sec)

 

Problem/ Challenge

1) I tried in NI OPC Server to adjust the Scan rate of the tags to values less than 10 ms and also the Scan mode of the PLC (In Properties) to (Scan Data at ....) values less than that as well, however it was the minimum value!

 

Of course, even if I went less than that from the Client's side (Using faster Loops), I will get redundant Samples having the same value since it relies on the Scan rate of the values between the NI OPC Server and Siemens PLC ...

 

# Are there any possible solutions to reach an acquisition rate from 200 to 300 Samples per second?

 

2) How can I generally receive Synchronous data from the OPC Server at a fixed Sampling rate? 

 

I tried using Datasockets and Front Panel Binding and I am receiving the same minimum rate ...

 

Thanks in advance,

Ahmed Zahran

 

 

0 Kudos
Message 1 of 4
(3,674 Views)

Hi Ahmed,

  I am far from an expert in PLC's. Especially Siemens, I have only programmed AB's. However, form my experience scanning tags at a high rate to do data logging is not a very good way to get data out of a PLC. I am not saying it isn't possible to get a faster rate, but scanning at 100Hz is already faster that any application I have ever dealt with. I would look at doing some sort of queue backed network stream if they are available. I am not sure what the options there are in a Siemens PLC but that's the first type of thing I would start trying to look for/learn about. If it comes down to it, could you read the force/position sensors in parallel with a different device for logging purposes only? 

 

  Aside from that, there is a thread I found with someone who is reading Siemens PLC memory registers directly over TCP/IP into LabVIEW. He says it is "probably faster than scanning tags via OPC."

http://forums.ni.com/t5/Example-Program-Drafts/S7-PLC-TCP-IP-Protocol-Reference-Example/ta-p/3492191...


Corey Rotunno

0 Kudos
Message 2 of 4
(3,638 Views)

Hi Corey,

 

Thank you very much for your prompt reply 🙂 

 

As you said, it seems very hard to acquire ideally more than 100 Samples/sec through the OPC Server as you said. But I checked before using the OPC server how to use the Modbus TCP and the TCP/IP communication, but they were relatively harder to implement and I got no results especially that I am not an expert with Siemens PLCs. That's why I preferred to use and switched to the OPC directly and we bought the NI license, but unfortunately I did not know previously about its limitations.

 

The Force and Position sensors are connected via Profinet commmunication with Siemens from different controllers (Force from HBM controller and the Position is read from a Frequency Converter). But we displayed the cycles speed (dT) on Siemens PLC and they were around 0.001 s ~ 1ms which was more than enough.

 

Nevertheless, I would try again your proposed TCP/IP example.

# In addition, Do you have knowledge if there is any way to save the data directly from the PLC to its Windows embedded?

 

Ahmed Zahran

 

0 Kudos
Message 3 of 4
(3,615 Views)
Solution
Accepted by topic author Ahmed_Zahran

Thanks for all your support. 

 

The Sampling rate issue is now resolved between Siemens PLC and NI OPC Server with a tricky solution we improvised somehow.Smiley Happy

 

Problem Definition:

We required a 300 Hz rate of acquisition which means a new data point every 3 ms. The NI OPC Server Variables are limited to an update rate of 10 ms, which means we lose around 3 points at least. 

 

Approached Solution:

Our approach was to share the data from Siemens PLC as a Data Array of size 10 for instance, which is filled every 3ms internally in the PLC program instead of sharing point by point. Consequently, whenever this array is all changed (all 10 cells after 30 ms), it is copied to another Array Variable which is monitored by the NI OPC Server and the "Data Socket Read" in LabVIEW is conditioned with a "Wait for updated Value" to wait for the whole new array of data to be loaded and processed. It's now working efficiently 🙂

 

Hope this review would help and share some beneficial experience Smiley Happy

 

Ahmed Zahran

Certified LabVIEW Developer 

 

 

Message 4 of 4
(3,438 Views)