Daq

Hello,


I was looking to store the average, min and max values from an analog input in real time. Any suggestions?



Thanks!
Ryan
 
Need some more details -

Do you have a specific platform you are working with?
How many values @ what frequency?
Data retention?
Do you need to consume this data on a different system?
How do you need the data stored?
What kind of analog input? 0-10, 4-20, something else?
 
Dravik,


Thank you for responding! I am using EcoStructure Machine Expert-Basic. I am collecting data over the period of an hour for purity (0 to 1V), pressure (0 to 10V), and flow (I believe 0 to 10 V but might be 4-20 MV). I don't believe I need a different system, just not sure how to code something like this as I am new to ladder logic.
 
Bruce,



Thank you for your response, however I am not quite sure what you mean by that. I am kinda new to plc programming so if you can explain what you wrote, I would really appreciate it!
 
les prev min move min
If the current sampled value is less than the stored minimum value, copy the current sampled value to the stored minimum value.

For averaging, each sample period, add the current sampled value to a running total. At the same time increment a counter of the number of sampled values represented by the running total. The average value is the running total divided by the number of samples.

You will also probably need to provide a means to reset the maximum, minimum, running total, and number of samples.

It gets a little more complicated if you are trying to calculate a moving average and minimum and maximum values over a specific period of time.
 
If the current sampled value is less than the stored minimum value, copy the current sampled value to the stored minimum value.

For averaging, each sample period, add the current sampled value to a running total. At the same time increment a counter of the number of sampled values represented by the running total. The average value is the running total divided by the number of samples.

You will also probably need to provide a means to reset the maximum, minimum, running total, and number of samples.

It gets a little more complicated if you are trying to calculate a moving average and minimum and maximum values over a specific period of time.

Yes, might want to be careful with using reals, for example with Allen Bradleys because of resolution, also many brands have standard instructions to do this.
 
How do I "add the current sampled value to a running total"? I can create a counter to act as the dividend for the average calculation but not sure how to code the divisor
 
How do I "add the current sampled value to a running total"? I can create a counter to act as the dividend for the average calculation but not sure how to code the divisor
Hi I think you would definitely gain something from a bit of classroom training, can I suggest you look into that?

Most platforms do basic mathematics, which PLC brand are you trying to work with?
 
I am definitely looking into that, the more practice and training the better. I am using Schneider electric TM221CE24R
It's been at least 20 years since I last programmed a Modicon. So I can't remember the instructions.

It's not a complicated process though. Need to find the compare instructions, then find the add instruction. Create some tags to remember the previous last high and low values. And another tag to add to each time for the total count which would divide by total times it happened to get an average.
 

Similar Topics

Hi everyone, I'm a last year student at the university in Ghent, and for my thesis i need to write a TwinCAT program that writes data to a .daq...
0
Replies
566
Views
Last year, we had a measuring machine with a bunch of LVDTs. The data from these devices were read by LabVIEW. The LabView VI would make a bunch...
0
Replies
2,048
Views
Hi I am having AB SLC 5/04 PLC with supported DF1 protocol from RS232 port. But I'll explain my challenging situations, In our production line...
0
Replies
2,803
Views
Hello there. I'm having trouble connecting a PLC with transistors outputs to a DAQ board from Advantech (USB 4750). I've tested it with relay...
0
Replies
433
Views
Hi all, Im Using DAQ factory to control my FX1N40MR + 2 off FX2N-4AD modules, but I can see the AD modules, im not sure what the address for the...
1
Replies
2,620
Views
Top