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.
Disclaimer
This document governs the use of our Community Forum. By registering and using the platform, you accept these conditions.
The COPA-DATA Community Forum serves to encourage the exchange of information and experience about the zenon software between forum users respectively zenon users.
Please mind that any published information on the Community Forum is the subjective opinion and view based on the experience and the level of knowledge of the author. COPA-DATA does not overtake any responsibility for the content and the accuracy of the shared information.
Users of the Community Forum are encouraged to share only well-founded experiences and to point out any risks associated with the implementation of proposed solutions to problems. COPA-DATA at its absolute discretion, reserves the right to moderate the forum. In this connection COPA-DATA may remove any information containing false facts, potentially dangerous solutions, bad language or content that may insult, degrade or discriminate others. COPA-DATA may block a non-complying user from forum access if the user violated this provision.
COPA-DATA reserves the right to change this document from time to time at own discretion.
Ing. Punzenberger COPA-DATA GmbH
Karolingerstraße 7b · 5020 Salzburg · Austria
www.copadata.com