
adccommunitymod (AutomationDirect) asked a question.
Created Date: December 09,2008
Created By: dieselvette
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
Hello all, I have 3 memory locations which I am logging data from (V40400, V40500, and V40501 - these are for the I/O's I'm using) so that I'm logging a dec. number for each location. (later I convert it to binary & see when I/O's were on/off). I 've got the disk space to log every second, but this makes for a very long list of data. What I'd like to do is see the Line Trend Graph log a data point each time the value in the V-mem changes (up or down). I don't see any capabilities like this in the event manager or trend graph, unless I were to set up an event for every possible scenario & have the log triggered by any of the possible events. Is there a handy way to do this?
Created Date: December 09,2008
Created by: KPrice
dieselvette, you can configure the trend graph to trigger on a PLC tag, a discrete on/off bit. Store your bit pattern (V40400) in a V-memory as your sample. In 1-second (perhaps using a 1-second SP), if V40400 does not equal your sample, then turn on your trend graph trigger tag bit. (If V40400 does equal your sample, then the tag is not turned on, and trend graph does not log.) Then store V40400 in your V-memory for the next compare instruction the next second, and so on. Your bit pattern application would be easier than an analog application, because you will use the Not-Equal instruction, and you will not need to calculate a dead-band around your sample. Does this do what you need it to do?
Created Date: December 09,2008
Created by: dieselvette
That sounds like a great idea, it would definitely work if arranged correctly.
--------------------------------LD V40400
....................................................|
....................................................OUT V400
----- -------(C1)
{In the Cmore, log every 1 sec while C1 is on.}
With this arrangement, I'm pretty sure the bit would be on for a minimum of 1 second. Is this long enough for the C-more to pick it up, even when comm is slow?
Now if only I had a way to safely update the ladder-logic off-site.
Created Date: December 09,2008
Created by: KPrice
dieselvette, in the C-more, if you configure the trigger tag to trigger when ON, then the trend graph will only log when the trigger tag makes an OFF-to-ON transition. So for the C-more to log, it has to see the trigger bit be OFF, then it has to see the trigger bit be ON.
The more I thought about this, the more there is to it (as always).
How about:
--|1-sec|-----(OUT C0)
--|neg diff C0|---------------------------(RST C10)
--|pos diff C0|-----|V40400 not= V400|---(SET C10)
........................................................|-LD V40400
........................................................|-OUT V400
C10 is the trend graph trigger bit. C10 could possibly be on for 1/2sec and off for 1/2sec if V40400 changes that fast.
How fast can the C-more catch the trigger bit? That's a good question. I don't know. This logic could work with a timer where you could set the time: 4sec, 5sec, 6sec, or any time, if the C-more can't catch every 1/2 sec.
If V40400 could possibly change a lot in a short time and then settle-out, and you don't want to catch the change, you only want the start and finish, you could insert a "= to " contact in the reset C10 rung.
Good project.
Created Date: December 09,2008
Created by: dieselvette
I 've always logged on a time basis, I 've never dealt with the trigger tags or the Start & Stop tag. Could one use the start & stop tag, does that basically "go " when the tag is on and "stop " when the tag is off?
Created Date: December 09,2008
Created by: KPrice
Yes, good idea. I think I like your idea better. Then how about:
--|1-sec|--------------------------------(OUT C0)
--|pos diff C0|-----|V40400 = V400|------(RST C10)
--|pos diff C0|-----|V40400 not= V400|---(SET C10)
.................................................. ......|-LD V40400
.................................................. ......|-OUT V400
Then configure your trigger for time, 1 second for example.
And C10 is your Start/Stop bit.
Does this do want you need?
Created Date: December 13,2008
Created by: bmil
Rookie question.
I have successfully used this post to get my 40400 & 40500 into a file on a memory stick. I load it into Excel and the data appears to be in BCD which I expected. Another post showed a very nice .jpg screenshot of a file of this type that had the data nicely parsed across the spreadsheet in "1s " & "0s ". How is the BCD to "1s " and "0s " done? I still get hung up when needing to change between number systems. I have the trend graph set up with 1 pen that points to the I/O v memory locations. Should I be referencing B40400.1, B40400.2, etc. for the data? Do I do the conversion in Excel? Am I not harvesting the data to C-More properly? Do I need to do the conversion in the PLC first beforesending to C-More? I may be making this more difficult than necessary so any help will be appreciated. This is my first operator interface integration with an AD PLC. I find this forum vastly informative and highly commend those sharing their expertise. It is very much appreciated!
Created Date: December 13,2008
Created by: dieselvette
The data is logged in Cmore as a decimal number, 16-bit. The data is converted from decimal to Binary in Excel. Excel can convert dec to bin but only 9-bit, and you need to convert 16-bit numbers, so we used the MOD function to parse it out. It looks somewhat complicated but once implemented it's really handy.
I made a template where column A is the date & time, and column B is the decimal value. I first "open with " the logged txt file in Excel then copy & paste the 2 columns into the template, first data point falls in row 3.
Row 1 is the labels, it looks like this (LOG DEC is one column):
DATE & TIME LOG DEC X0 X1 X2 X3 X4 X5 X6 X7 X10 X11 X12 X13 X14 X15 X16 X17
Row 2 is the constants:
DATE & TIME LOG DEC 1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384 32768 65536
(note 65536 is in column S, one over from the X17 column)
Row 3 is the one with the formulas, it looks like this:
12/6/08 13:36 25 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0
25 is the decimal # being converted here, the 1's & 0's are each cells with a formula. So in C3 we have:
=MOD($B3,D$2)/C$2
D3
=(MOD($B3,E$2)-(C3*C$2))/D$2
E3
=(MOD($B3,F$2)-(C$2*C3+D3*D$2))/E$2
F3
=(MOD($B3,G$2)-(C$2*C3+D$2*D3+E3*E$2))/F$2
and follow that pattern all the way out to R3 (note that R3 will reference the constant S2). You can start with D3, and then copy & paste it into E3 & then type the new references in. Then copy & paste E3 into F3 and type the next new references in. R3 looks like this:
=(MOD($B3,S$2)-(C$2*C3+D$2*D3+E$2*E3+F$2*F3+G$2*G3+H$2*H3+I$2*I3+J$2*J3+K$2*K3+L$2*L3+M$2*M3+N$2*N3+O$2*O3+P$2*P3+Q3*Q$2))/R$2
And then in column U I put a formula to convert back into decimal, just as a double check:
=C3*C$2+D3*D$2+E3*E$2+F3*F$2+G3*G$2+H3*H$2+I3*I$2+J3*J$2+K3*K$2+L3*L$2+M3*M$2+N3*N$2+O3*O$2+P3*P$2+Q3*Q$2+R3*R$2+S3*S$2
Row 3 you should be able to copy & paste all the way down as far as your data goes.
Created Date: December 13,2008
Created by: dieselvette
Sometimes the log is a negative number, (I don't know or care why b/c the bits always seem to make sense when parsed out) but note column U doesn't work for negative numbers.
Created Date: December 13,2008
Created by: bmil
Sometimes the log is a negative number, (I don't know or care why b/c the bits always seem to make sense when parsed out) but note column U doesn't work for negative numbers.
Many thanks! I will set s spreadsheet and see if I am successul. I do appreciate the response.
Created Date: December 09,2008
Created by: dieselvette
Hello all,
I have 3 memory locations which I am logging data from (V40400, V40500, and V40501 - these are for the I/O's I'm using) so that I'm logging a dec. number for each location. (later I convert it to binary & see when I/O's were on/off).
I 've got the disk space to log every second, but this makes for a very long list of data. What I'd like to do is see the Line Trend Graph log a data point each time the value in the V-mem changes (up or down).
I don't see any capabilities like this in the event manager or trend graph, unless I were to set up an event for every possible scenario & have the log triggered by any of the possible events.
Is there a handy way to do this?