Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I average the data coming in through the opc client in Lookout?

I am using a 6220 M series DAQ card to acquire differential voltages coming from a load cell.  I have it configured in MAX and can display real time voltages but they are a little noisy.  I have set up a virtual channel in MAX and then use the OPC Client in Lookout to bring the data in.  What do I have to do so that I can average the signal coming from the load cell so it isn't varying so much and false triggering my expressions.  I would like to be able to read 2-3 averages/second with at least 10 or more samples/average.  It is being used in a batching facility so the averages can't be delayed too much.  Thanks!
 
Kevin
0 Kudos
Message 1 of 10
(5,044 Views)
Kevin,
You may be able use some tricky programming using Accumulator object, timers, and expressions to achieve this functionality -- I am not sure what the fastest sample rate you can get out of an OPC server is, but if you are only looking at a single channel you should be able to get into the 50 S/s range. 

However, I would look ealier in the chain -- are you using proper signal conditioning on your load cell?  Proper signal conditioning should give a nice output from load cells.  You may also want to consider LabVIEW 8.0 DSC module -- LabVIEW excels at this type of analysis and control.
Doug M
Applications Engineer
National Instruments
For those unfamiliar with NBC's The Office, my icon is NOT a picture of me 🙂
0 Kudos
Message 2 of 10
(5,028 Views)

Kevin,

You may want to take a look at the following example:

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3E6A956A4E034080020E74861&p_...

I must reiterate what Doug has mentioned:  (1) Hardware-based signal conditioning may be a better option.  (2) High-speed DAQ is really not Lookout's forte -- may want to consider LabVIEW/DSC, if that's an option for you.

Regards,

-Khalid

0 Kudos
Message 3 of 10
(5,021 Views)
Thanks guys, I have the output of the load cells connected directly to the SCB-68 connector block.  The range I am measuring is from 4mV to 30mV.  I am getting an average of 30uV p-p (.1% of full scale) of noise which is acceptable but there seems to be some large spikes once in a while which are the ones throwing a wrench into things.  I am using shielded wire and have tried hooking up a lowpass filter on the input treminals with a cutoff frequency of approx 4Hz but it didn't seem to make a difference (not sure if I did it correctly since it is setup as a differential input, do you have to put a lowpass on each leg of the signal???)  The customer doesn't want to spend all the money to change to labview and have me write a new batching process (imagine that) so thats why speeding up the sample rate and averaging should work.  Any info on how to speed up the sample rate would definately help.
 
Kevin
0 Kudos
Message 4 of 10
(5,017 Views)
Hi There:

Lookout works on OPC so there is no way to speed the sampling rate of Lookout itself. Again, Lookout is not designed for high speed applications. I think for your application LabVIEW (possibly with DSC) would be the way to go. With LabVIEW You can use a vast array of DAQ VIs to customize your application and collect data at the speeds you need. The sampling rate for your DAQ board can be set for each channel individually. The process to do this would be in MAX. Once a channel is created in MAX you can access it over the OPC Server hence you need to set the sampling rate in the channel (Virtual and Global channels) that you create in MAX. However, if you are acquiring very fast, keep in mind that your OPC Server might not be able to keep up.

Let me know if this helps.

Best,

Jaideep
0 Kudos
Message 5 of 10
(4,991 Views)

I would love to use Labview but that's not an option for me.  Where do I find out how fast the data can be sent to the OPC server and how fast lookout can retrieve it?  I might as well start there because if it can't physically be done then my customer will have to spend some money.  Thanks forall your help so far.

Kevin

0 Kudos
Message 6 of 10
(4,983 Views)

Kevin,

You may have already tried this... on your OPC Object:

1.  Change the 'Update Rate' setting to see how fast you can get the data.

2.  Play with the 'Deadband' setting to filter out the noise. 

Other than that there's not much you can do unfortunately.

-Khalid

0 Kudos
Message 7 of 10
(4,976 Views)

Thanks for all your help, I figured it out.  I used a pulse timer to poll the OPC client 15 times a second and force an update which worked very well.  I then created an X chart and set it for 15 samples to average, and then used the average data member of the X chart in my expression and it works great.  The erroneous data spikes are averaged into the data and have very little effect on my readings (less than .5 % which is more than acceptable for the application)  I will still try and filter it using a low pass filter on the SCB-68 if someone has anything to offer, the documentation leaves a little to be disired.  Thanks again for your input and ideas.

Kevin

0 Kudos
Message 8 of 10
(4,973 Views)
I am guessing you're doing synchronous communication, i.e., have unchecked the 'Use Asynchronous I/O' setting in the OPC Object.
 
Just curious...
 
-Khalid
0 Kudos
Message 9 of 10
(4,965 Views)
I left the 'Use Asynchronous' checked and it works great.
 
Kevin 
0 Kudos
Message 10 of 10
(4,963 Views)