I'm working up this temperature deviation stuff for a plant and fist I'll say what I've done, and then an idea that someone mentioned to me (which sounds really good, but I'm not certain how to implement it)...
What I've screwed up (errrrr done)
I've borrowed an idea from Microsofts Visual Basic 6.0 and have implemented it into the temperature deviation. In VB to add certain features to message boxes (for instance) a value is added to the initial value. This "secondary" value cannot be obtained no other way (in the vb case it is 2048 and also 4096).
To reflect the differening states of unit operation (startup/warmup/online/idle/shutdown) I've give each state a unique number that cannot be obtained by addition with any other state. For instance:
Startup = 100
Warmup =200
These states are cumulative. So that during a three hour block if both states occur (normally they would since startup isn't that long) the sum would be 300. The only way to achieve the value of 300 is to have these two states occur. Nothing else will achieve this value.
Online=400
Idle = 800
Again, these values are unique. If the unit were to startup/warmup and go online in a 3 hour block the value would be 100+200+400=700 (no other combination of states can achieve this value). It is unique to this combination of states only.
Shutdown= 1600
By using this combination 1 word can reflect all of the states that occur in a three hour block. There is no way these states can be confused and in the logic I will be using a 'Select Case' command to decipher all of the possible states that can occur in any three hour block. This came about due to memory limitations on the processor.
Nested within this command will be another loop which will pull out the alarms. (from the vba or vb script itself)
Alarms.
Since XXX's attorney is intent on finding the specific alarm (ie low gas pressure, flame-failure, combustion blower failure, etc...) there are just too many to realistically reflect each value and stay below the 32767 ceiling. (even the addition of using the 65K value wouldn't be able to hold the values). Starting with 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192, 16384, 32768, 65256. As is evidenced, to save the values for 3 weeks it would only be possible to have 17 faults. Unfortunately there are more than 17 alarms. Plus with the unit states included the last value couldn't be included (with 32K or 65K ceiling) because it would cause an overflow error. If they could be generalized as 'Burner fault', 'Damper Fault', etc... it would be easy to do. But unfortunately that option doesn't seem to exist.
But.... to get around that what I'm doing is numbering all of the major faults incrementally from 1 (1,2,3,etc....).. I believe there are around 30-40 faults possible that will shut down the unit. So what I'm thinking about doing is taking the first significant fault and leaving that in the unit state (with a three week history). This will be reflected in the weekly temperature deviation report and will be stored for 3 weeks. Also up to 5 faults (just an initial value, which can be changed) can be reflected in any three hour block (which when the desktop computers are actively reading the data can be actively stored into the report. The only problem with this method is power loss or communication failure. (by hooking up the desktop to the ups I might be able to autosave the file in case of a power outage, though if that is the first fault to occur there is a possibility that it would be the only fault to be recorded). But again until the system proves reliable I wouldn't bet on retention. Since XXXX wants a three week history there just isn't enough memory to store all of the possible alarms (and give them unique identifiers).
How does this sound? Can anyone think of ways I might be able to store the unit states and 30-40 alarms uniquely in an integer? Or is there another "low memory" way of doing this?
THE IDEA!!! (a good one too I might add)
Split the word into 2 bytes and use hex to display each. that way I could record 2 alarms at one time with a single word 1A1A for example..
but the only thing is that I do not believe the unit state can be included in that number. Due to lack of memory the unit state must also be included in the same number... but....
The numbering system was chosen arbitrarily.. it could just as well be 1,2,4,8,16,32( ... etc ... ). But 8 bits only give me 256, unless negative values are also included, but that would pretty much eliminate the possibility of using unique numbers (unless I'm missing something).
COULD... Could I split a group of words into 6 bit groups? That way the memory needed to store the unit state space would be reduced to only 21 total words (from the current amount of 56 words). This 6 bit array would reflect the unit state.
Since faults don't normally occur I could make that remaining words reflect 3 weeks worth of data (by only recording faults when they occur, and splitting the words would allow for retention of twice the number of faults). Again.. faults are rare, but they do occur.
It would be great if it could work. Is it possible?
But then comes the issue of being able to transfer it through rslinx gateway to an excel spreadsheet.
but again... would it be possible to just use a standalone vb app and do the conversion? I'm certain I can export to excel from a stand-alone app.. but the conversion might be tricky...
Any idea's?
Thanks,
Russ
What I've screwed up (errrrr done)
I've borrowed an idea from Microsofts Visual Basic 6.0 and have implemented it into the temperature deviation. In VB to add certain features to message boxes (for instance) a value is added to the initial value. This "secondary" value cannot be obtained no other way (in the vb case it is 2048 and also 4096).
To reflect the differening states of unit operation (startup/warmup/online/idle/shutdown) I've give each state a unique number that cannot be obtained by addition with any other state. For instance:
Startup = 100
Warmup =200
These states are cumulative. So that during a three hour block if both states occur (normally they would since startup isn't that long) the sum would be 300. The only way to achieve the value of 300 is to have these two states occur. Nothing else will achieve this value.
Online=400
Idle = 800
Again, these values are unique. If the unit were to startup/warmup and go online in a 3 hour block the value would be 100+200+400=700 (no other combination of states can achieve this value). It is unique to this combination of states only.
Shutdown= 1600
By using this combination 1 word can reflect all of the states that occur in a three hour block. There is no way these states can be confused and in the logic I will be using a 'Select Case' command to decipher all of the possible states that can occur in any three hour block. This came about due to memory limitations on the processor.
Nested within this command will be another loop which will pull out the alarms. (from the vba or vb script itself)
Alarms.
Since XXX's attorney is intent on finding the specific alarm (ie low gas pressure, flame-failure, combustion blower failure, etc...) there are just too many to realistically reflect each value and stay below the 32767 ceiling. (even the addition of using the 65K value wouldn't be able to hold the values). Starting with 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192, 16384, 32768, 65256. As is evidenced, to save the values for 3 weeks it would only be possible to have 17 faults. Unfortunately there are more than 17 alarms. Plus with the unit states included the last value couldn't be included (with 32K or 65K ceiling) because it would cause an overflow error. If they could be generalized as 'Burner fault', 'Damper Fault', etc... it would be easy to do. But unfortunately that option doesn't seem to exist.
But.... to get around that what I'm doing is numbering all of the major faults incrementally from 1 (1,2,3,etc....).. I believe there are around 30-40 faults possible that will shut down the unit. So what I'm thinking about doing is taking the first significant fault and leaving that in the unit state (with a three week history). This will be reflected in the weekly temperature deviation report and will be stored for 3 weeks. Also up to 5 faults (just an initial value, which can be changed) can be reflected in any three hour block (which when the desktop computers are actively reading the data can be actively stored into the report. The only problem with this method is power loss or communication failure. (by hooking up the desktop to the ups I might be able to autosave the file in case of a power outage, though if that is the first fault to occur there is a possibility that it would be the only fault to be recorded). But again until the system proves reliable I wouldn't bet on retention. Since XXXX wants a three week history there just isn't enough memory to store all of the possible alarms (and give them unique identifiers).
How does this sound? Can anyone think of ways I might be able to store the unit states and 30-40 alarms uniquely in an integer? Or is there another "low memory" way of doing this?
THE IDEA!!! (a good one too I might add)
Split the word into 2 bytes and use hex to display each. that way I could record 2 alarms at one time with a single word 1A1A for example..
but the only thing is that I do not believe the unit state can be included in that number. Due to lack of memory the unit state must also be included in the same number... but....
The numbering system was chosen arbitrarily.. it could just as well be 1,2,4,8,16,32( ... etc ... ). But 8 bits only give me 256, unless negative values are also included, but that would pretty much eliminate the possibility of using unique numbers (unless I'm missing something).
COULD... Could I split a group of words into 6 bit groups? That way the memory needed to store the unit state space would be reduced to only 21 total words (from the current amount of 56 words). This 6 bit array would reflect the unit state.
Since faults don't normally occur I could make that remaining words reflect 3 weeks worth of data (by only recording faults when they occur, and splitting the words would allow for retention of twice the number of faults). Again.. faults are rare, but they do occur.
It would be great if it could work. Is it possible?
But then comes the issue of being able to transfer it through rslinx gateway to an excel spreadsheet.
but again... would it be possible to just use a standalone vb app and do the conversion? I'm certain I can export to excel from a stand-alone app.. but the conversion might be tricky...
Any idea's?
Thanks,
Russ