Shared memory online variables management
Hi,
I've developed a gateway in C# to manage online variables through shared memory for reading and writing a lot of variables.
It works with great performance compared the normal online variables in bulk mode expecial it's great in writing speed!
But I have just one problem the string size in the shared struct you have defined is fixed to 64 byte:
Is it possible to change this number (for string length) through some secret parameter in some secret place like zenon6.ini for example?
If in ZenOn editor I declare a variable whith more character and in runtime from zenOn element I write a long string there's no control when you write in shared memory and you override the next struct in the memory. I think It's best cut the string in the shared to the maximum allowed from the struct.
This is your struct:
{
BYTE bFlags; // Bit0=von zenOn geändert, Bit1=extern
// geändert
DWORD dwStatus; // Statuswort bitcodiert (gestört, Hand, etc.)
DWORD dwTimestamp; // Zeitstempel in s seit 1.1.1970 00:00 GMT
union
{
BYTE bBool; // numerischer Rohwert (0=FALSE, 0xFF=TRUE)
BYTE bByte; // numerischer Rohwert INT_8 oder UINT_8
WORD wWord; // numerischer Rohwert INT_16 oder UINT_16
DWORD dwDWord; // numerischer Rohwert INT_32 oder UINT_32
float fFloat; // numerischer Rohwert IEEE single
double dDouble; // numerischer Rohwert IEEE double
double dNumerical; // numerischer Wert normiert
char csString[64]; // alphanumerischer Wert
} Value;
};
Thanks
Matteo
This is a migrated post! Originally posted on 20.11.2012 by user matteo.fabbri. Please be aware that information can be outdated.