ConSys Kernel Versions
This document contains version information for the ConSys Kernel .
Version 1.26.122.479 (jsn 2006-12-06):
CCalcDeviceRamp has been changed so Device or Source parameter value is retrieved initially but bot during the ramp (to avoid trouble with reflected values from the frontend (for continues communication the return time can be lon (200 ms)):
Version 1.26.122.478 (tw 2006-11-27):
Implemented new request/dataser:
CCompareFloatDataServer/CCompareFloatRequest. Meant to be used with state device.
Combine relative and absolute compare:
* Allowed failure = Abs Failure + (rel failure compared to control value).
* Address 1 is primary value(control value)
* Address 2 is secondary value.
* Adress 1 and 2 must be to devices on the same front-end computer
Version 1.25.121.467 (tw 2006-11-07):
Added Kernel Utilities group with ConSysKernelUtilities.cpp with WriteToElog function.
|
CConSysClient - new connecting to an inactive frontend => reconnecting every 5 sec, bug introduced in version 464.
Version 1.25.120.464 (tw 2006-10-27):
|
Version 1.25.119.461 (tw 2006-10-12):
|
The ConSysKernel sometimes chrashed with access error on frontends. When the chrash occurede on one frontend it was often seen that other frontend chashed as well.
The following error is found and corrected:
When a remote client connection died without prober closing (by a chrash or debug break):
In CLocalThread::Run, *m_pTransport >> pObject return NULL, => The method will return 0 => The CLocalTHread thread will terminate. (Other situlations (like network failures and exceptions) could lead to the same situation.
The ~CLocalThread will then delete m_pTransport.
Deleting the transport in this way without calling CSocketTransport::Abort and thereby never setting m_connectionBroken TRUE will close the transport without siganaling the CAliveThread to stop.
After a timeout period for the threadlist in CSocketTransport the transport will close and be deleted without the corresponding CAliveThread being stopped. Next time the CAliveThread access the transport will then lead to an accees error.
The correction of the error: Abort called as part of CSockerTransport destructor. (Check is allready made to avoid multiple calls to the active code in the Abort method).
Version 1.25.117.459 (tw 2006-10-04):
|
Version 1.25.117.458 (tw 2006-10-01):
|
The following dataservers support 'Max Time between updates':
CWordDataServer
CWordMapDataServer
CBitDataServer
CFloatDataServer
CMeanDataServer
CStringDataserver
CDateDataServer
CTimeDataServer
CG64CompareDataserver
As it is now, the calculation of max time between updates is based on the
timestamp on the datavalue obtained from the device. But if the device data does
not change - and thereby for some devices the timestamp does not change - the
condidition for sending the data will never be fullfilled. The implementation of
the MaxTime between updates must be based on the time (tick count) where a value
was send to the client.
Version 1.25.117.xxx (tw 2006-09-25):
|
Version 1.25.113.450 (tw 2006-08-17):
|
||
Changes in recordsets:
SafeViewRequestSet - Working again (based on computer::Active)
DeviceLocationSet: Added device running status field, runState, values:
#define DEVICE_RUNSTATE_OFF
0 // The device is not running, has
reported itself as shut down
#define DEVICE_RUNSTATE_MANUAL_OFF 1
// Device has been set off manually in the
database
#define
DEVICE_RUNSTATE_TIMEOUT 2 // Requesting
status from the device timeout - state set as DEVICE_RUNSTATE_TIMEOUT
#define
DEVICE_RUNSTATE_MANUAL_ON 3 // The device
is running, set manually in the database (device/ConSys version does not support
automatic setting
of the value)
#define DEVICE_RUNSTATE_ON 4
// The device is running, set by the kernel
started the device on the computer registered fro the device in the database
ViewRequestSetEx: Added fields
ConSysVersion
Active
runState
Version 1.25.112.446 (tw 2006-07-05):
CSerialPortCalcDevice:
Use the changed CSerialPort. Flowcontrol can now be set through the configuration dialog - or if
defined in hardware in ConFigure, by setting m_flowControl. The default value is RTS_CONTROL_DISABLE (no flow control). The flow control is set using general purpose floating point 6. It has been checked that no code is using this parameter.
In order to make this apear in the configuration dialog, the device must be deleted an recreated in the ConSysManager.
Version 1.25.112.445 (tw 2006-06-02):
Trying to locate hanging/chrashing kernel during socket closing/destruction: Proved to be hanging in ~CSocketServiceThread waiting to enter m_rwMonitor (location 8)
Socket.cpp: Corrected bugs: Missing m_rwMonitor leave before throw in several locations added.
Added debug attributes to follow where we are waiting to get into rw_monitor and is in rw_monitor, written in ~CSocketServiceThread, writeToProgramLog
Version 1.25.110.443 (tw 2006-03-21):
CSocketServiceThread::~CSocketServiceThread() - Added loggings, suspect bug:
The ConSysService sometimes crash without and disappear immediately from the process list. Has been observed by Li on his machine a couple of times and on one of the beamline PC’s once. Also seen on SAKKUB in the control room once. On Li’s PC and the beamline PC no loggings was made. On SAKKUB, the following log was found in the ConSysloader log file at a time that might be the time were the kernel chrashed:
20/03 11.28.24 : Warning: File exception occured during CSocketServiceThread::Destruction, write archive flush, cause socket file error, send data may be lost, error code: 0
If this logging is the course of the crash, the error must be in the transport layer. There were made major changes in the version stored in version Version 1.25.106.421 (tw 2006-01-19):
Version 1.25.109.441 (tw 2006-03-02):
Important corrections:
ConSysClient: Corrected bug - Continued: The solution below was not sufficient - in rare occasions on a busy system the fail did still occur. Added CBoolean to control the creation of the connection - In this version, a new control, m_clientConstructionFinished, is introduced. The conncetion to the server will not proced before this attribute is set TRUE. This is done in SetClientName, which now must be called as the last statement in all descendent class constructores.
Remark: If the client is used without inheriting, SetClientName must be called in order to initiate the connection.
In the case this is forgotten, the connection will be established after a timeout of 30 seconds. A log message is written to to program log in this case. In debug, ASSERT(FALSE) is set.
Remark: Almost no existing CConSysClient inherited classes called SetClientName - Added all over the control system now. (I hope ...)
Version 1.25.109.440 (tw 2006-03-02):
ConSysClient: Corrected bug: In rare cases, the first data received from a server was not passed to the correct client NewData method. Instead of calling the NewData method in the inherited class, the ConSysClient::NewData in the base class was called.
This happened, when data was received before the constructor was finished - to be precise, when data was received before entering the inherited class constructor, i.e. still in ConSysClient base class constructor. In this case, the vTable was still pointing to the base class and not the inherited class, thereby calling the wrong NewData method. Solution: The error could occur beause the connection to the server was made as part of the base class constructor method, i.e. the CConSysClient constructor. In the corrected code, the connection to the server is made in a new thread. This new connection thread is created in the CConSysClient constructor with thread priority THREAD_PRIORITY_IDLE.
Version 1.25.109.437 (tw 2006-02-24):
Added new request for device status.
Changed device status implementation
Corrected bugs in device status serialisation
Corrected bug in CSDatabase, write log messages - did not handle an un-updateable log database correct.
Version 1.25.107.429 (tw 2006-02-21):
CComputerSet:
Added new fields
CCsDatabase:
Changed implementation of cached computer information.
Added version information for all computers.
Version 1.25.107.429 (tw 2006-02-07):
CConSysClient: Changed implementation
-
Almost all public and protected attributes made private
CPacketClient::PreprocessData - removed duplicate code, Looked through the code, handling of database change information is allready taken care of in the base class by the HandleClientMessages method
Version 1.25.107.429 (tw 2006-02-01):
CCalcDevice: Consyserror 2 ConSysKernel: CalcDevice - ASSERT failure during destruction when closing during startup :
Version 1.25.106.426 (tw 2006-01-27):
Corrected bug:
CCalcDevice: Consyserror 2 ConSysKernel: CalcDevice -
ASSERT failure during destruction when closing during startup :
Delete of client protected by data monitor, creation of client only not closing
calc device.
Version 1.25.106.423 (tw 2006-01-24):
CPulseDataserver: Changed the time an active pulse has to finish a pulse before destructing the pulse dataserver from 60 seconds to 1 second. It felt as a very long time to wait for a kernel or client shut down at 60 seconds. In several cases, a pulse dataserver is set as a kind of alive system handling for service applications => front-ends that services this kind of Pulsedataservers would always take more than 60 seconds to close.
Changed implementation of CLocalThread::HelperThread::Run: Now only send closing message if m_kernelDeviceClosing is set TRUE. in order to avoid sending closing warnings to clients that are closing their own connection
Alivemessage timeout handling:
CAliveMessages - now includes socket timeout values. Used in
CSocketTransport to let the server set it's timeout setting for the alive
messages as specified at the client side. For backwards compability, a short
client and a long server timoeout is set for client connections from verions
before this revision.
Version 1.25.106.422 (tw 2006-01-23):
Corrected bugs:
**** CRemoteThread - code does not work, does not shut down when ConSysKernel is closed:
The CRemoteThread code is not being used in ‘normal’ situations in ConSys – Connecting to remote clients is normally taken care of with CPacketServer serviced by a local thread. This is how it should be.
CRemoteThread is only used, if remote clients connect to a front-end with a request belonging to another front-end (this happens if a front-end has been substituted by another front-end, and there is still old ConSysKernels with a cache of old database settings) – or in recent case, computers belonging to the old unupdated database.
The bug is:
There is no signal to the
remote thread that the kernel is closing.
When the kernel is closed,
the Remote thread waits in a transport >> operator. The transport is
handling the kernel closing (and should not – the code elsewhere should be
able to decide when to close then transport – like in CLocalThread, where
the CHerlperThread reacts on
m_kernelDeviceClosingand send a Closing warning to the client before
closing the transport.
A Solution could be implementing a Helper thread for the remote thread that reacts as the helper thread on m_kernelDeviceClosing. Maybe this should be a common thread for all remote threads (i.e. remote threads must register and deregister themselves in this helper thread).
Solution: Implemented CRemoteThreadManager class - let this class shut down all remote thread connections during kernel shutdown.
*** Big memory leak when using remote threads: Reason: The relayed data was not deleted in CRemoteThread:CRemoteServer:PreprocessData.
*** Memory leaks several places in ConSys: In general, many places where CTransport << operator is used, the data was not deleted afterwards even:
Threads.cpp:
* DELETE_DATASERVER macro
* LocalThread::Run()
Version 1.25.106.421 (tw 2006-01-19):
CSocketTransport - Implementation changed: m_recList, m_sendList moved from CSocketServiceThread to CSocket transport. << reimplemented. ReadingActive() reimpleneted, to ensure all data is read from the client before closing.
CDataRequest and all derived objects: Changed implementation of GetCopy and added new constructor based on <className>(<className>* pRequest).
CDataRequest : Added identification
information in request and request serialization:
charm_user[5];
--- Set in request constructor
charm_application[15]; --- Set in request constructor
WORD m_sourceComputerId; --- Set in request
constructor
WORD m_sourceDeviceId;//Not used yet-In the case that the request
is coming from a (virtual) device
Corrected bugs:
CCalcDevice usage strings for boolean was not correct updated.
Version 1.25.106.419 (tw 2006-01-18):
CConSysClient: Added client name information to log messages.
Corrected bugs:
CDumpDataserver: Added check for device != NULL before writing data to the device. Log an error message if this happens.
Version 1.25.106.418 (tw 2006-01-13):
Corrected bugs:
* Updateting of the maxRemainingTime in CDataServerList ForEachElement was wrong - could fail if remaing time was equal to elapsed time or etntering in FALSE part of if statement. Lead to ASSERT FALSE failure in the update method (and thereby effectively stopping further max time updates for the given data server for INFINITE ms).
* Added code in CRemoteServer to try to avoid: ConSysError 3 ConSysKernel: ASSERT_VALID(m_pParent) fails in CRemoteThread::CRemoteServer::PreprocessData
Version 1.25.104.414 (tw 2005-12-21):
Kernel Closing problem: When the ConSysLoader has been running for a longer period with local devices, it sometimes can not be stopped. The kernel closing sequence finish correctly (seen from the closing log file), but some theads are still active.
Debugging:
The problem can be triggered by the following debug sequence:
-
Place TRACE messages in CSocketServiceThread::OnSendData in order to follow the send sequence
-
Start ConsysLoader with local device in debugger
-
Start Console in another debugger
-
Open page with parameters that connects to local device - The parameters on the page should be changing so datavalues are send on a regular basis (~ 1 sec)
-
Make a debug break in the Console debugger
-
Wait for a while
-
The Consysloader keeps sending data, stored in send arcive: m_pWriteArchive
-
After approx. 200 send values, the m_pWriteArchive->Flush() never returns. This blocks the CSocketTransport::operator<<, which is waiting for m_datasend to be true. It also blocks the CSocketTransport::m_rwMonitor, because the Flush() method happens in a protected region. Because of the blocked monitor, the reading method CSocketTransport::operator>> is also blocked.
-
-
When the ConsysLoader is stopped after this, the threads responsible for the hanging socket transport is blocked and can not be terminated.
After correcting the Alive message thread bug described below, the error does not occur any longer in the test senario above, because the transport is aborted by the alive schema before the write archive buffer is filled. (To debug after the correctíon of the bug, the alive message activation in CSocketTransport::operator>> can be temp. removed.
REASON AND SOLUTION:
Flush calls CSocket::Send, that then call SendChunk. This method works for a while until the send buffer (in the socket layer) is full. After some time ~200 ConSys datavalues the CAsyncSocket::Send method used in SendChunk return SOCKET_ERROR. GetLastError() gives WSAEWOULDBLOCK => SendChunk stay in its while loop calling PimpMessages. The CSocketTransport << operator is then looked.
Solution: CRecSocket overwrites CSocket::Send, at only allow a limited number of calls to PimpMessages before SOCKET_ERROR is returned from RecSendChunc. At the same time the new status boolean m_sendBufferFullTimeoutReached is set true. The SOCKET_ERROR return value forces the CSocketFile to throw an exception, that is catched by CSocketTransportServiceTread. If the CRecSocket::m_sendBufferFullTimeoutReached is set, the transport is aborted.
Corrected Bugs:
CAliveThread:Run: Changed, now sends CAlive message at start. Before first after timeout period => Server side not started before timeout period reached ~ 40 minutes in original configuration. When the client was stopped without a prober closing schema (f.ex. by breaking the console) before the alive message is sent, the server side alive thread was never started.
Other changes:
Deleted All Pipe Transport related code.
Deleted outdated test code.
Version 1.25.104.412 (tw 2005-12-11):
Major changes in database methods - support for 2 SQL servers implemented
Kernel start method reimplemented - did not allow for delayed start of database connection,
Version 1.25.104.404 (tw 2005-11-02):
All recordsets changed from DECLARE_DYNAMIC/IMPLEMENT_DYNAMIC to DECLARE_DYNCREATE/IMPLEMENT_DYNCREATE. This change MUST be adapted to all recordsets in other ConSys dll's as well.
Version 1.25.104.404 (tw 2005-11-02):
Changed to version 25, Must update in order to
include:
// REMEMBER - NEXT MUST UPGRADE VERSION
// Activate code in DataServers - CDataServer::LoadDataServer:
//TW040321 - the following code can be included after next must upgrade
(>=version 24)
Removed unused class: CDatabaseSetupDlg
Changed CCsDatabaseDoc, so it supports two SQL databases
Version 1.24.102.399 (tw 2005-08-19):
CCrateConvBase, CCrateConvBaseDevice: New
implementations:
* Added check for correct data array definitions in
DefineDataArrays
* Implemented history on Word
Version 1.24.102.394 (tw 2005-07-05):
CVdCalcAstrid: Implementation changed from CVdCalc to CCalcDevice
Version 1.24.102.393 (tw 2005-06-28):
CCalcDevice - corrected bug in EvaluateFunctions(): Signals inside monitor. This solved the problem seen in UV1device, where the Go command sometimes was not run (first setting wavelength, the Go).
Version 1.24.102.390 (tw 2005-05-25):
Changed: Database connection after hibernate is now reset. Controlled by m_databaseResumeAfterHibernate. Before, first attempt to access database falied - this was a call to ActivateComputer - i.e. the computer was not activated in the database after a hibernation restart.
Version 1.24.102.389 (tw 2005-05-24):
Bug Corrected: Request for history from the console on a
WORD gives run time check error (in debug at least). Was due to a call to
GetValueType() in on a CMessage object - was not supported. Solution:
Implemented
virtual WORD GetValueType() { return
DATATYPE_NOTDATAVALUE; };
virtual CString GetValueAsText() { return _T("Not a data
value"); };
in CConSysData.
Changed message TRACE in case of messages in all dataservers.
Version 1.24.101.387 (tw 2005-02-16):
Bug Corrected: CCsDatabase::LogSystemMessage(CLogMessage* pLogMessage) : Return inside monitor removed. The kernel hang in different places - remarkly only/most while running as a service. This bug was introduced in version 386 when correcting another bug in this method (i <= instead of i< etc.).
Version 1.24.99.384 (tw 2005-01-04):
CCalcDevice: Changed number of device setup floats from 5 to 7
Version 1.24.98.380 (tw 2004-11-29):
ConSysClient: ReadOnly mode is reimplemented. Common state for all clients in an application/dll is stored in a new common class, CConSysClientCommon.
Version 1.24.98.380 (tw 2004-11-29):
New connection - accept schema changed: Before change, the dataserver was created in the CLocalThread constructor. The CLocalThread is created in CWinMainThread::OnIdle when a new connection is being etablished. If CDataServer failed or was thread locked by a monitor, CWinMainThread was locked as well - i.e. further connections could not be made. Creation of the data server is now moved to the RUN method of CLocalThread in order to avoid lock/chrash of the main thread in case of errors when creating the data server. Remark, that creation of a dumpdataserver includes a call to registerAtDevice - which could cause errors if there is a bug in a device. Now a failure will only affect CLocalThread - i.e. the new connection.
Version 1.24.96.374 (tw 2004-11-1):
CCsDatabase::GetDatabase(): Calls to this method MUST be protected by the internal monitor. ASSERT check added.
IMPORTANT: All calls to GetDatabase() must
be protected by the CCsDatabase monitor.
After exit of the protected region, the returned
CTypedDatabase object should be
considered invalid (can be deleted at any time when not in a
protected region).
This has to be changed allover the control system - incorrect at most locations today.
Version 1.24.96.373 (tw 2004-10-29):
Database: new general fields: d6,d7, implemented in all recordsets.
CConSysClient: ReadOnly mode. New methods has been implented to allow readonly mode of the client. When in readonly mode, no data is send from the client. In debug mode, not send values is traced. The readonly mode can also be set in the constructor or the Initilise method. New methods:
virtual void SetReadOnly(BOOL readOnlyState = TRUE);
// Set/Clear the readonly mode of the ConSysClient.
// When in readonly mode, all data send through the client is
just deleted.
// In debug mode, trace data that is not send.
virtual BOOL GetIsInReadonlyMode();
virtual void SetClientName(LPCSTR pClientName) { m_clientName =
pClientName; };
// The client name is used in error and trace messages.
virtual CString GetClientName();
Version 1.24.96.372 (tw 2004-10-25):
CUniqueParameterSelectionList - New Methods - could be called after a call to BuildRequest to check that all parameters was found in the database :
BOOL IsAllActive()
// Return TRUE if all parameter
selections is found (active)
// If FALSE, notActiveList contains a
string with all inactive (not found) parameter selections.
// after a call to
CsDatabase::BuildRequest
CString GetNotFoundParameters() { return
m_notFoundParameters; };
// IMPORTANT: Result only valid
after a call to IsAllActive,
// the result is calculted in
IsAllActive
// Return a string with parameters
not found in the database
CCsDatabase::InitSourceInformation: Implementation changed, now has two optional parameters to set application name and user name from the program. Intended to be used from a new CsAPI method.
void
InitSourceInformation(LPCTSTR pApplicationName = NULL, LPCTSTR pUser = NULL);
// Set application name and user
name
// If pApplicationName is Null, the
current application name is used
// If pUser is Null, the name of the
user account is used.
Version 1.24.96.371 (tw 2004-09-10):
CUniqueParameterSelectionListPulseDataserver - new behavior: Before, any data would send a pulse. If the pulse was active it would be extended witdth the active
Version 1.24.96.371 (tw 2004-09-10):
CPulseDataserver - new behavior: Before, any data would send a pulse. If the pulse was active it would be extended witdth the active period. New version: Only reacts on CConSysBit data - all other data sendt to the dataserver will be handled as normal data (ie. controls will pass through, f.ex.. a request for history). The value '1' would start a new pulse. The value '0' ends a active pulse.
Corrected bugs:
* History request for pulsebit results in setting the bit. Was due to an error in CPulseDataserver - send a pulse whenever any data was received.
* Storage device, persistent store did not work in new parameter device based version: There where no thread servissing the poll method.
Version 1.24.96.369 (tw 2004-08-27):
Changed implementation of history: In prev. version, there where some
bucks with start/end marking. New implementation set start/end marks at first
history level (in Add) instead of setting these marsk in second level (in
AddAndReduce). CSplot changed accordingly.
Version 1.24.96.368 (tw 2004-08-25):
Corrected bugs:
* CParameterDevice: For new dataservers connected to hashgroup where no
other data server was regulary forcing update due to max time and no regulary
device signaling: No data send to client when a max time is set. Reason was,
that the evaluated time to next update was not updated after adding a new
dataserver. Seen in CSPlot when connecting to storage device.
* CHistory - GET_HISTORY_PACKET macro expansion did not set packet time stamp.
Version 1.24.96.366 (tw 2004-08-20):
MAJOR CSocket error found - workaround implemented!
When large data packets where transmitted over the CSocketTransport, the transport could hang. This error seemed to be related to the computer performance - and worst on fast computers. The error was often seen when using CSPlot with a large number of parameters (f. ex. the vacuum plot). Two small test programs, CSocketTransportSend and CSocketTransportReceive has been developed to debug/isolate this bug.
The error has been traced to the receive part of the MFC classes used in the transport layer: CSocket, CSocketFile, CArchive.
The normal operation of the receive sequence is as follows:
-
When new data is received, a notfication is send to CAsyncSocket (base class for CSocket).
-
CAsyncSocket calls OnReceive in the CSocket inherited class CRecSocket.
-
The OnReceive calls the CSocketServiceThread::ProcessPendingRead method.
-
ProcessPendingRead read all incomming data objects until the input archive method IsBufferEmpty() return TRUE.
When the socket hangs, the OnReceive method is not called any longer.
With test code (now part of the workaround) it has been shown that the communiation could be restarted by manually calling the ProcessPendingRead method.
Workaround:
-
In the CSocketTransport << operator, a new message, WM_CHECKISBUFFEREMPTY, is now posted regulary to the CSocketSocketServiceThread while waiting for data to be received.
-
The method called by this message in CSocketSocketServiceThread check for new data availeble on the socket. If new data is avalileble, ProcessPendingRead is called to start reading again. This brings the socket communication back to normal operation. REMARK: When checking for new data on the socket, CAsyncSocket::IOtl is used. The archive method m_pReadArchive->IsBufferEmpty(), which was the obvius command to use does not work - when the socket hangs this method allways return TRUE even when new data is availeble on the socket (maybe part of the reason for the bug in the socket class).
Version 1.24.96.365 (tw 2004-08-12):
CDataValue: Implemented to new numbers in data section:
WORD m_deviceSerialNumber;
WORD m_dataserverSerialNumber;
CStorageDevice:
-
Changed from CSimpleDevice to CParameterDevice. Address field a[2] is used as hash key.
-
New value type: CDataValue, max array size set to 20. The value type a[1] is 8 for this address type. Remark: Not included in persistent store yet (as for the moment only used/intended for debugging purposes.).
-
Implemented support for device serial numbers: Each parameter has a version number that is incremented when written to it. Returned in CDataValue::m_deviceSerialNumber
CDumpDataserver: Implemented support for dataserver serial number. The serial number is incremented by one whenever data is readen from the device. The serial number is in CDataValue::m_dataserverSerialNumber
DeviceStatus: moved from CSimpleDevice, CKernelDecvice to CDevice, changed to pointer.
Version 1.24.95.357 (tw 2004-07-17):
New feutures: Support for sending closing messages when system is hibernating, main part implemented in CConSysDocument.
Code for reacting on APM messages implemented in kernelService and ConSysLoader application.
Notification to clients is implemented in CConSysDoc: Added list of active transports.
Corrected bugs:
Kernelservice - did not wait for threads to close before destructing thread list.
CConSysClient::CReconnectThread::Run() - removed wait for read thread inactive before closing connection
// TW040617: Removed the line
// m_pParent->m_readTreadInactive.WaitForTrue0();
// was introduced in version v155, 21/11 2001
// Do not realy see the need for it - and gives
// problem when connection is closed due to a kernel
// closing message (connection not closed if front-end
// continues to sedn data.)
// m_pParent->m_readTreadInactive.WaitForTrue0();
Version 1.24.95.359 (tw 2004-07-29):
CViewRequestExSet - new view request set with more informations - and removed outdated informations.
Version 1.23.92.339 (tw 2004-03-18):
CParameterDevice: Changed implementation of dataserver signalling - now served by a single thread instead of a thead per hash key.
REMARK change of attribute name: monitor changed to m_dataMonitor
Corrected bugs:
The implementation of CLocalThread::Helperthread, CDataServerList, CParameterDevice, CCalcDevice gave signal problems when more than one hash key was used - the basic reason that
signalling of of a two hashkeys after each other could lead to situations where only some of the changes from the second signal was send to the client.
Version 1.23.92.336 (tw 2004-03-09):
Implemented write history in:
* CrateConvBaseDevice
* CCalcDevice
CSimpleDevice::PollDriver - Changed, should now return a boolean value indicating if the poll driver should be called again. All devices derived from CSimpleDevice in ConSys has been updated correspondingly.
Version 1.23.92.333 (tw 2004-03-04):
Corrected Bugs:
CCalcDevice: WriteValue - used pAdr->a[0] instead of GetIndex.
CCalcDevice: Generation of error messages for data types - used source array instead
Version 1.23.92.331 (tw 2004-02-26):
All calls to CThreadList:WaitForAllThreadsTerminated - log error message to program log if failed.
CCrateConvBaseDevice: StoreSettings and StoreHistory during closing: Removed from destructor to end of savesettings thread: In is not good pratice to have store of persistent data in the destructor - the destructor is the absolute last thing tah happens during kernel device shutdown. This means, that if anything fails before the end of the kernel shutdown, the persistent data is not stored.
Version 1.23.92.330 (tw 2004-02-26):
Storage device: Implemented write history.
CCalcDevice: REMARK: These changes are not checked yet.
* Timestamps at write set if not allready set in write value.
* read operator: Only sets source informations if not
allready set.
Version 1.23.92.329 (tw 2004-02-24):
Implemented new features needed for write history.
CDataValue and sub classes: New GetXXXastext methods.
Version 1.23.92.326 (tw 2004-02-06):
CStorageDevice: Implemented save valid/invalid state like values set - and valid flag in readings.
Version 1.23.92.325 (tw 2004-02-04):
CDumpDataserver: Changed behavior when setting new data - next read will always send a value.
CDumpDataserver, history read: Detect if device supports history. If not send a information message containing the string ''History not supported, handle:%i'
Version 1.23.91.316 (tw 2003-12-03):
CStorageDevice Limits on floating point values, should be posible to set as separate parameters:
Version 1.23.91.317 (tw 2003-12-08):
CCalcDevice:
* Implemented initialisation to default
values from database: If not loaded from persistent file, values are
initialised from database settings.
* All Set and Get data methods:
Added debug check for
monitor protection.
Version 1.23.91.316 (tw 2003-12-01):
CTableConversion: Improved logging when consversion file failed to open.
CStorageDevice: Implemented logging to ConSysLog in case of errors when opening/creating/storring storage and history files.
CMessageLog: Increase size of message string from 255 to 1024. Also changed in SQL database, can be done without problems.
Corrected Bugs:
CDevice, Several methods with like GetDescription dependend on m_pDoc,m_pKernel:
Failed if called before base device create method was called. Now returns
message including warning of call before init - and ASSERTS(FALSE) in debug
mode. The programmer should ensure thatm_pDoc,m_pKernel is valid before calling
these mehods.
Version 1.23.91.314 (tw 2003-11-28):
CConSysWord - changed constructors in order to avoid int initialisation as
a boolean:
CConSysWord(BOOL aValue) and CConSysWord(BOOL
aValue,CCsHandle aHandle, BOOL handleAsBoolean = FALSE) has been substituted by
:
CConSysWord(int
aValue, BOOL handleAsBoolean = FALSE);
// If handleAsBoolean
is TRUE, the internal value is set to 1 if aValue >= 0 and 0 otherwise
CConSysWord(int
aValue, CCsHandle aHandle, BOOL handleAsBoolean = FALSE);
// If handleAsBoolean
is TRUE, the internal value is set to 1 if aValue >= 0 and 0 otherwise
Version 1.22.90.309 (tw 2003-11-04):
CHistory - Check for file version implemented: If file versions does not match the current version during load, the history is not loaded. A log at level WARNING is written to the application log. VCC60 version is keept at 2, VCC71 is set to 3.
CPacketServer BUG corrected:
The allocated libraries for the packet server local dataservers was never
deleted. This lead to memory leak. The libraries are allocated during the
creation of a dataserver in LoadDataServer and should be deleted by the owner.
Version 1.22.89.307 (tw 2003-9-30):
CCsDatabase::GetComputerNamesOrderedByName:
Introduced use of JoinLevel in the SQL computer table:
1: Remote computers, typical home computers
2: Local computers that often will be turned off/offline - including Laptops.
3: Ordinary control system computers - always turned on
4: ConSys front-end servers.
Version 1.22.89.305 (tw 2003-9-25):
MFC implementation of CSocket, CSockeFile,CArchive has changed - in version 7.1 the blocking mode is used, leading to operation withou read buffer.This reduced performance drastically. See further notes in the ConSysKernel revision file, revision 1.22.89.305class CSocketServiceThread : public CCSWinThread. Blocking mode has been disabled, see OnInit method
Version 1.22.89.304 (tw 2003-9-18):
CSocketTransport::Create - Removed check for ConSys version - now always start alive message thread.
CDevice: Implemented new method: GetFullDeviceDescription - returns description including unique device id and device name.
CDevice methods: LogAddressError, CheckWriteValueType: Changed, now includes device description in logged message.
Device templates, error loggins: Some loggings refered to G64 names - changed to general names (crate, a0,a1 etc).
CCalcDevice::LoadHistory - Code for old history file types (*.hst) removed.
CCalcDevice - error messages has been updated, now all includes full device description (not testet!).
Changed all resource id's to neutral..
CCalcDevice: If no Source Parameters are specified a (wrong) error logging with message "Parameter name not found." and Description "The calculation device failed to create its internal client." (By the way this is a poor logging - no device specification). FEC01 is making this log for the CRadMonVRM202SerialCalcDevice (in RadMonVRM202 project). JSN 030618
Version 1.22.89.303 (tw 2003-9-10):
CSimpleDevice and CParameterDevice, WaitUntilStopped methods changed - now timeout if while waiting for dataservers to stop. If a timeout is reached and a dataserver later deregisters it may give access errors.
Version 1.22.89.300 (tw 2003-9-3):
CDeviceDoc: member varible removed: UINT m_deviceNumber, replaced by UINT m_devicePosition (new meaning).
CKernelDevice::Create changed: Introduced try-catch around device creations. Now manages the device array initiliastion itself (before, this was done in the created device.
Version 1.20.80.280 (tw 2003-6-4):
New methods for error check and logging in CDevice: CheckWriteValueType, LogAddressError
Version 1.20.80.279 (tw 2003-5-27):
CConSysClient::SendData: When the PacketServer wait thread was introduced in version 1.19.79.272, a bug was introduced (or triggered...): If the user of a Client started sending data beforethe Initilise method had been called, the data was deleted. Solulution: The m_initialized attribute is changed from BOOL to CBoolean, and if SendData is called before initialisation is finished, we wait up til 20 seconds before timeout. If timeout is reached a message log is created.
CConSysClient and CSocketTransport and related classes has been slightly modified in the handling of the closing schema. (Most changes reflected in CSocketTransport::StopTransport - renamed to CSocketTransport::InternalStopTransport.).
KNOWN BUG: MEMORY INCREASE - TRYING TO IDENTIFY - implemented buffer checks and logs:
Memory increase (previous? => crash): In rare occasions a client program (typical - (only seen) from CSPlot) will lead to a slowly increase of use of Virtual memory. When the given application is closed, the memory is released. If the client application is not closed before all available virtual memory is used, the ConSysLoader used to crash.
It is suspected that the bug is due to a buffer overrun, proberbly because of a client connection has partly died: The consumer thread (CConSysClient::ReadThread) may have stopped while the connection is still running and data is being received. In this case data will fill up in the receive buffer in CSocketServiceThread.
Implemented buffer limits:
CPacketServer: Implemented a limit of the datapacket when data is received from a client connection: If more than the allowed number of datavalues is received for a CDataPacket in the CPacketServer::ClientData, the received additional received vakues are deleted and a message is logged in the ConSys log. The maximum limit can be specified in the CPacketRequest. The default value is DEFAULT_MAXPACKETSIZE = 1000
CSocketServiceThread: Implemented receive buffer limit: When the receive buffer m_recList reaches a max limit (pressently set to 1000) of unread data values, the CSocket transport is aborted.
CConSysClient: Implemented reconnect try when the transport aborts itself.
Several logs has been implemented in order to be able to identify this bug - to enable these logs include "8:Socket error" and "16:client reconnect" in the 'log filter' key.
Version 1.20.80.278 (jsn 2003-5-23):
CCalcDevice: Finished support for the ConSysTime datatype.
Version 1.20.80.277 (tw 2003-5-14):
CORRECTED BUGS:
The ConSysKernel was not closed when a system shutdown/reboot was done. Previusly, the ConSysKernel service was just killed when the system was shut down. This was due to a wrong/missing implementation of the service setup and shutdown message handling. In the new version, the ConSys kernel informs the control service manager of the progress in the closing process.
IMPORTANT: If a device has a lenghly (> 5 sec.) shutdown method it must update the checkcount by calling IncDeviceShutdownCheckCount()
Version 1.20.80.276 (tw 2003-5-9):
CCsDatabase class, implementation updated:
- Unused create method based on registry key removed.
- Database initialisation changed (used OpenEx instead of Open, Skipped "ODBC;" in connect string, forced no database dialog - even if unable to connect (before a dialog was brought up when the database connection could not be etablished - f.ex. if the database was not running.).
Version 1.19.79.272 (tw 2003-4-15):
CConSysClient: Changed implementation: Changed client reconnecting schema and message handling. Implented logging to application text file according to filter defined in registry (See ConLib documentation)
Create thread i CPacketServer, to avoid waiting when one of the front-ends in a request is not responding
Version 1.19.76.261 (tw 2003-3-19):
CCalcDevice: Changed implementation:
GetIndex(CParameterAddress pAdr) -
Used
in device [] operator and WriteValue method to convert the address to a device
index. The default implementation asumes a ONE_DIM_ADR, where the result is
pAdr->a[0].
Version 1.18.75.248# (tw 2003-1-21):
CStorageDevice configuration file path: Should be set as full path. Now full path as well as no path is accepted. If no path is specified the executable path is used. It is recommended not to specify a path.
Added missing monitor in CCrateConvBase
CCalcDevice: Changed error message reporting, so errors are only reported if the error flag was false at call time.
Version 1.17.72.243# (tw 2002-10-10):
Changed resource id's to remove doublicates.
Version 1.17.72.? (jsn 2002-10-09):
CCalcDevice:
Corrected
minor errors: GetSource.. (valid was from devicePar), A few things regarding
scheduling of the Evaluate call.
CBoolean:WaitUntilTrue: Use has been corrected (Where needed calls are now made
to WaitUntilTrue1.)
Version 1.17.72.237 (jsn 2002-10-01):
CCalcDevice: Added CCalcDeviceRamp classes. (Helper classes to perform easy ramping of parameters (device or storage) from/within a CCalcDevice.
Version 1.16.71.229 (tw 2002-09-09):
History type 5 changed (7 days history): See ConSysKernel manual for details. When a history file with an old version of this history type is loaded, the data for the this history type is deleted, and a new empty history created. Data for other history types is loaded unchanged.
CCalcDevice: Dead lock could occur between CParameterDevice::monitor and CCalcDevice::m_dataMonitor. Ex. If the evaluate thread was in EvaluateFunctions in SignalChange was called within m_dataMonitor. SignalChange must pass monitor. If at this time, the client newData method was called, NewSourceValues first entered monitor and inside this m_dataMonitor. CURE: m_dataMonitor has been removed, and CParameterDevice::monitor is used instead.
Version 1.16.69.217 (tw 2002-08-15):
CCalcDevice: New set of classes under construction for a new general purpose calculation device.
CDeviceDoc: Added new method: SetSettingsFromDevice(CDevice* pDevice), to be used from the manager.
CDeviceDoc: Added new attribute: m_deviceEnable.
REMARK: DeviceDoc serialisation changed!!!
Version 1.16.66.204 (tw 2002-06-07):
New classes for device creation implemented: CCrateConvBase, CCrateBaseDeviceDoc, CCrateConvBaseDevice. For example on their usage, see the MSLG64 library.
Version 1.16.65.200 (tw 2002-05-23):
FloatDataserver: Now always returns marked data.
CConSysClient: Try catch introduced in readthread and preprocess data to avoid client crash if there is a bug in the descenden class.
Version 1.16.64.196 (tw 2002-05-07):
Corrected errors:
Dataserver update mechanisme has been corrected:
The CDataServerList::SignalDataServers method has been updated, so it now takes the maximum accepted time between data updates into account. The existing code did not release the update thread when a dataserver had reached its maximum time between data values. For devices without regularly signals of new data this meant that the dataservers read thread was not scheduled when a dataserver reached its maximum time. The change has influenced the following classes/methods:
CDataServerList::SignalDataServers
void CDataServerList::AddDataServer
void ForEachElement(void* ref, CDataServerEntry &element)
CDataServerEntry
CDataServerEntry::CdataServerEntry
BOOLEAN CDevice::RegisterDataServer( …
And all classes derived from Cdevice, including other libraries
Dataservers updated: It was only the floating point data servers that checked for maximum time reached. This check has now been implemented in all relavant dataservers.
Version 1.16.61.X (tw 2002-04-X):
Corrected errors:
CConversion: m_setTimeStamp control variable was not initialised => on some G64 parameters, the time stamp was not set( constant time, device start time).
CwordDataserver: Rangepass extended was never activated, used wrong constant.
Corrected error in history type constants Start index of special history types was wrong.
Version 1.16.61.191 (tw 2002-04-17):
CVDCalc errors corrected: History did not work.
Version 1.16.61.190 (tw 2002-04-17):
G64Crate::LoadSettingsFromDatabase – Implemented check for correct address type. If the data type does not macth the conversion type, an error is logged in the ConSys log database.
SERIOUS BUG CORRECTED: CSDatabase:: LogSystemMessage – Access error if logging more than 10 messages !! Was due to an index out of bound in the log message history.
MAX_LOG_HISTORY changed from 10 to 30
Version 1.15.58.167+168 (tw 4/2-2002):
New Device addressing:
CAddress: New unique device Id defined in CAddress. Attributes front_end and device renamed and made protected. New methods to get front_end and deviceNo implemented.
CAddress: New methods implemented to support new device addresing schema.
CCsDatabase: New methods handling the maps between unique device id's and front-end, deviceNo implemented.
CDevice::Create: Updates CCsDatabase with deviceNumber when created.
CDeviceDoc serialisation schema changed: The serialisation has been changed: The base class now defines the common serialisation schema witch must be used in all inherited class implementation of the IMPLEMENT_SERIAL macro. All inherited class serialisation methods from now on maintains their own version number.
All device setup views: Changed, so they include unique device Id.
ALL DEVICE DOCUMENTS AND VIEWS HAS BEEN UPDATED
Version 1.14.55.160 (tw 3/1-2002):
Blocking of socket during connection to unreachable front-end: Accepting of a new connection is handled in CWinMainThread::OnIdle, wich in turn is called from the message pump. When a new connection with containing a packet request is started, the connection is first made as a local connection to a PacketDataServer. The packet data server starts by creating new clients to remote machines. This is all done in the context of CWinMainThread::OnIdle. If a connection to a front end can not be made we are blocked until the operation system times out on the socket connection. As this happens in the main thread all new connections are blocked in this period.
Solution: Partly solved by cancelling the connection try after a short period. This has been implemented by a new thread in CSocketTransport::Create, that will call the CSocket::CancelBlockingCall after a short period (as a start set to 4 seconds - typically plenty of time to do a successful connect on the local network). (The operating system waited for something between 30-45 seconds).
Another (improved? ) solution would be to keep a track of active front-ends in the CCSDatabase class, and let the connect method check before a connection is made. The handling and updating of this information needs some consideration.
Version 1.14.53.158 (tw 20/12-2001):
Dead lock problem in CPacketServer: The construction of the monitor use in CPacketServer::ClientData and the CPacketServer::~ CPacketServer could lead to a dead lock situation when the client was deleted during a call to ClientData from the readThread. (The destructor waited for the read thread to finish, but in cased where the first part of ClientData was run and we where we could be waiting for the monitor entrance CPacketServer::ClientData, blocked by the destructor.
Version 1.14.53.157 (tw 14/12-2001):
Major buck in CSocketTransportDoc/CSocketTransport relation corrected: The thread handling (thread list location + monitor) was wrong => it was in rare cases possible that the CSocketTransport instance was deleted before the CSocketServiceThread had terminated. The treadlist used was declared in CSocketTransportDoc - this was so to ensure that all CSocketTransports was closed before the destruction of CSocketTransportDoc could finish. The construction allowed the CSocketTransport to be deleted before the CSocketServiceThread had terminated. NEW IMPLEMETATION: The threadlist is moved to CSocketTransport where it belongs. A new attribute, CCounter m_noOfTransports, has been introduced in CSocketTransportDoc to ensure that the CSocketTransportDoc destructor waits for all CSocketTransport instances terminates.
Version 1.14.50.155 (tw 21/11-2001):
Renamed CDataserver methods (also in all descandants): Data renamed to GetData, NewData renamed to SetData.
Reconnect, CreateConnection changed: The reconnect thread is responsible for the destruction of the old transport. When the reconnect tread is created from the CreateConnection method the old transport is allready closed and there is no need to try to redo that. The call of the reconnect thread has been modified so the CloseConnection is only called when the reconnect thread is create from the read thread.
Implementation changed: m_sendAlowed in CSocketTransport has been removed - was not necessary
Version 1.14.49.154 (jsn/tw 15/11-2001):
MAJOR CHANGE: CConSysClient reimplemented: The old code was hard to overview and had some potential errors that was difficult to solve.
CConSysClient: Data method renamed to SendData !!
CConSysDoc::m_kernelIsClosing - 'partially removed' now - should be permanent removed from all code if successful (expected).
// TW,JSN 011115: m_kernelIsClosing is as far
as we can see not needed -
// - It is only
set TRUE in the ConSysLoader/Device (CKernelDevice) (no application usage)
// - The
CKernelDevice destructor has a new schema that do not need this, actually
// the
CConSysDoc::KernelIsClosing() in ConSysClient reconnection and CPacketServer
startup
// block the client connection to early in the
closing procedure, where devices still
// are alowed to
access the control system.
// Other usages of
CConSysDoc::KernelIsClosing() is uneeded, because of the internal boolean
// closing messages
availeble in all devices in the new closing schema.
Version 1.14.47.150 (jsn 14/9-2001):
History type 11 and 12 added.
Version 1.13.45.139 (TW 21/5-2001):
CStorageDevice: Implemented persistent store of history.
CPulseDataserver: Corrected error: If client was destroyed before the pulse was finished, the pulse was left high. The data server now waits up to 60 seconds for the pulse to finish - and after that forces the pulse to finish.
Version 1.12.43.130 (TW 8/2-2001):
CStorageDevice: Implemented history.
History type 500: Corrected error, history length was only 50
Version 1.12.43.126 (TW 30/1-2001):
CG64Crate: Improved type checking and error logging in write and [] operator. All read and write operations now checks the ConSys value data type and write to log in case of errors. In read operations, the an error message is also sedn to the client.
CStorage Device: Improved type checking and error logging in write and [] operator. All read and write operations now checks the ConSys value data type and write to log in case of errors. In read operations, the an error message is also sedn to the client.
CStorage Device: Range checking on addresses: In case of an out of bound address (to large index), a log is written and in read operations, a message is sent to the client.
CConversion and derived classes: Changed SetValue to function, return true if datatype ok.
Version 1.12.43.123 (TW 26/1-2001):
New dataservers: CMeanDataserver
_CONSYSDATATIME: Changed from struct to class
Database: Added new general field: d5, updated tables interpretation, interpretationDefinition, viewRequestSet
Version 1.12.42.122 (TW 17/1-2001):
New dataservers: CTimeDataServer and CDateDataServer.
Type checking of data in existing dataservers: In all 'Data' methods, the data type is now checked with 'IsKindOf' before use in the dataserver. Before this was only done as an ASSERT_KINDOF. If a data value has a wrong data type it is still transmitted to the client - but without any checks in the dataserver. Before these checks may have resulted in access errors.
Version 1.11.40.120 (TW 5/1-2001):
Pulse data server thread based: Before, the pulse dataserver was implemented with a sleep command - resulting in a dead control channel for the client connection until the pulse was finished. The new method sends a pulse every time a new value is received - independent on the received value. If a value is send during a pulse the pulse time is restarted.
Version 1.11.40.113 (TW 26/10-2000):
CFloatConversions: Range error in conversions when limits are used: ex. Binary conv, +-15, upper limit 10, works fine between 10-14.99, >=15 set to 15. Due to wrong structure in floating point conversions.
Version 1.11.39.107 (TW 10/8-2000):
CKernelDevice: m_deviceCloseMonitor removed: This monitor was used in almost all devices to ensure data servers was deregistered before the device was closed. The code was hard to read and not easy to understand and debug. The devices must now wait for all data servers to deregister in the WaitUntilStopped method.
CSimpleDevice: m_simpleStopped removed from code (boolean duplicate for CBoolean m_simpleDeviceClosing).
CSimpleDevice, CParameterDevice: closing procedure changed - m_deviceCloseMonitor removed, wait for data servers to deregister moved from StopDevice to WaitUntilStopped.
Device close sequence changed: The closing sequence for devices defined in CKernelDevice destructor now includes new method calls with PreStop messages to devices. See the comments on the new methods in CDevice.
Text file with closing information: A file, 'ConSysKernelCloseStatus.txt' with device closing status is now being generated during shut down. The file is opened and closed for each writing in order to contain all information in a lock situation.
m_closing attribute was used in almost all devices - has been renamed in all ConSys.
Version 1.11.36.102 (TW 31/7-2000):
History errors
corrected:
-ReduceAndAdd did
not handle HISTORY_MARK_INVALID_DATA correct.
-GetFirstIndex and GetNext corrected - did not handle the waiting 'last value'
correct.
Version 1.10.35.100 (TW 13/7-2000):
G64Crate measurement time: Has been changed to measured time instead of the time, where the [] operator is called. Related changes in G64Device.
CDataValue - added new attribute 'm_mark', serialisation version changed to 5
CConSysDouble:: (CConSysDouble* aFloat), CConSysFloat(CConSysDouble* aFloat) constructors changed, so they call parent constructors, CDataValue added new constructor CDataValue(CDataValue* pValue)
REMOVED ALL CODE FOR MARKING IN HISTORY INTRODUCED IN LAST VERSION.
Added Data marking code to CConversion classes.
Update G64Crate device (including code in G64Device) to use data marking code.
Data history template reduction code updated: Now use the new marking scheme (AddAndReduce make additional start and end marking).
Version 1.10.35.99 (TW000711):
History - mark changes and take marks into account when reducing data implemented - working for device but not possible to mark data send to programs - ie. CS plot does not get informations of marked data => data lost during data reduction in CSPlot.
For all floating point interpretations: double number 4 is now the minimal change needed for a data value to get marked in the history buffer.
Version 1.10.33.98 (TW000606):
Read only version - now allow write of CDataServerControl and descendants.
Version 1.10.32.96 (TW000525):
CSimpleDevice and CParameterDevice errors corrected: (In some cases where many parameters was written to a device in a row - with resto or other programs - the data value changes was not send to other clients. This was due to errors in the signalling schema)
The signalling has been corrected: When new data was written to a device before signalling due to the previous writing was finished, the devices did not send a new signal for new data. This has now been cured. Furthermore, the min time handling removed in version 1.5.14.60 has been reintroduced and corrected, so it now works as the original design idea.
The CDataServers class in CParameterDevice is derived from CDataServerList. A local variable m_newData was defined in both classes for different purposes (in CDataServerList as BOOLEAN, used to in connection with the enumerate method), in the CDataServers class as a CBoolean used for thread signalling. This has given some difficulty when reading and understanding the code. The variables has now been renamed to m_isNewData in CDataServerList and m_newDataSignaled in CDataServers.
Version 1.8.26.88 (TW000222):
Socket transport modified: Major changes in the socket transport. Solve errors when closing a client connection (in some cases gave an access error 5 with a following crash of the kernel) and errors when closing the control system (clients connecting during the shut down in some cases lead to crash - and in other to creation of new connection threads which where not told to stop => the kernel closing never ended).
CWinMainThread: Changed closing procedure - now aborts in idle method instead of direct call from the Abort method. The Abort method is called from another thread. Because of this, the socket transport could not be close correctly in CSocketTransportDoc::AbortConnections().
CSocketTransportDoc::AbortConnections(): Changed, now call listenSocket.Close to close the socket listening channel correctly. Before the the listening socket was not closed correctly leading to the reconnecting error.
History implemented for G64 crate.
Version 1.8.24.86 (TW000211):
CStorageDevice - forced store implemented. The device can now be forced to store its current values to file. It furthermore checks for any change in the data every hour, and store values if there is any change.
Version 1.8.24.83 (TW000209):
New dataserver control message: CDemandHistory. This class is send to the dataservers in order to request the device to return a value history. If supported by the given dataserver and device, the client receives a packet with the history data requested in the DemandHistory class. The packet will have the same handle as the normal data values received for a given connection. A new field, m_specialRequestType, has been added in CDataValue. This field can be accessed with corresponding methods in the class. For ordinary datavalues, the specialRequest type is srt_normal. When a history data packet is received it is srt_history.
CDumpDataserver processes the CDemandHistory, so no other changes is needed in dataservers descendent from CDumpDataServer. VdBeamCurrent in VdAstrid is an example of a device capable of responding the history demand.
Version 1.8.24.80 (TW000131):
CDataValue and derived classes: Added two new methods, Initialise from other instance and GetCopy.
Version 1.8.24.78 (TW000119):
Load of additional dll: In order to support ConSys serialisation of classes defined in additional dll's, these dll's must be loaded in the ConSysKernel. A list of dll names in the constructor CConSysDoc::CConSysDoc() now specifies the additional dll's to load.
Version 1.7.23.77 (TW000113):
rangePassExtended: New range test implemented in the CWordDataServer and CFloatDataserver, 4 level range test (rangePassExtended). The corresponding request are changed to match the new needs.
Optional call back function in CCsDatabase::BuildRequest based on CUniqueParameterSelectionList implemented. For each CUniqueParameterSelection in the selection list, an optional call back function can be defined. If the function is defined, it is called to build the request instead of using the standard request build from the database settings. The callback function is called with the CPacketRequest where the request should be added to and the CViewReqeustSet with the database values for the parameter. See ConSysState, CState for example of usage.
New classes: CCompareRequest and CG64CompareDataserver.
Version 1.7.20.71 (TW991104):
SignalDataserves removed in version 1.5.14.60 reintroduced. Original error with update time INFINITE corrected. In the update method introduced in version 1.5.14.60 the minimum update time was ignored. This lead to flickering displays and unneeded data transfer.
Error corrected: The enumerate method in the CDataserverlist did not handle signalled events with 0 ms delays correct => data changes was not always reflected.
Start delay implemented: When the kernel runs as a service a start delay of 20 seconds has been introduced. This is done to try to avoid the kernel to start before the socket layer is up and running. The delay is only active when the kernel runs as a service.
Version 1.6.17.65 (TW990916):
New address class: CNotificationAddress.
Version 1.6.17.64 (TW990915):
New class set for notifications defined: CNotificationRequest, CNotificationDataServer, CConSysNotification.
Version 1.5.14.61 (TW990817):
Request build with default settings implemented: All classes used in the standard request build as been expanded with a defaultRequest. (CUniqueParameterSelection, CUniqueParameterSelection, CDataServer and its derivatives, CcsDatabase::BuildRequest). If a default request has been defined in the parameter selection the request build by the CcsDatabase::BuildRequest method will be build using the settings from the default request instead of the standard settings found from the database.
CFloatRequest: Serialisation version level changed from 3 to 4 (was wrong).
CFloatRequest, CFloatDataserver: Added new check method: rangePass. In this mode, the dataserver returns data whenever the low level or high level values are passed - ie. one data value when leaving the range and one data point when entering the range.
CWordRequest, CWordDataserver: Added new check method: rangePass. Works like the floating point version.
Version 1.5.14.60 (TW990722):
Socket errors/Improvements: The socket is now in use for ASTRID and seems to be working well with the corrections below.
- Thread sync object problems during shutdown corrected.
- Catching network shutdown messages and reacting on them implemented.
- CSocketTransport::operator >> and <<: Moved on m_connectionBroken inside monitor
SignalDataServers in helper threads for: CparameterDevice, CkernelDevice, CsimpleDevice: Removed non working check for min time to next update. The Enumerate function for the CdataServerList should used by the CdataServerList:: SignalDataServers always returned INFINITE due to an error in the method. As all devices using this method signals the service thread to call there is no need for the not working 'polling' part of the threads. These has now been removed from the code.
CparameterDevice & CSimpleDevice signaldatachange structure - error corrected: When the devices reported that new data available, the first dataserver that recognised a changed fired the signalled event. This lead to multiple searches by the ClocalThread::Helperthread for signalled dataserves. The error has been corrected and has given a significant increase of performance.
Corrected error in bipolar floating point conversion initialisation - did not mark initial parameter as unconverted.
Version 1.1.13.53 (TW990714):
Socket transport in test operation - basically working.
Version 1.1.13.52 (TW990429):
New Transport class, CSocketTransport, working in test version.
A test version based on the polling syncron MFC CSocket class has been implemented in a new transport class, CsocketTransport. In the next step the transport should be implemented using the Asynchronous socket transport based on CAsyncSocket. A redesign of the ConSys kernel should be considered at the same time.
Version 1.1.13.51 (TW990428):
TEMP VERSION:
MAJOR TASK: Implementing Socket based transport.
The socket transport can now connect, but structure needs to be changed. No connectThread/LocalThread/RemoteThread structure impl/working.
The version can be used with the pipe transport layer.
Version 1.1.13.50 (TW990423):
MAJOR TASK: LOOKING FOR THE 400 ms ConSys problem.
Seems to be a pipe problem. In this version, a "mega fusk deparments" solution has been applied - The ConSys client helper thread has been slightly rewritten to do poll the transport before entering the blocking read operator. This partly solves the problem, but is only a temp. solution.
Next try: Sockets. The basic class structure for an empty socket transport implemented in this version - do not use !!
Version 1.1.13.49 (TW990419):
MAJOR TASK: LOOKING FOR THE 400 ms ConSys problem.
Dual pipe transport classes implemented - no influence on the 400 ms problem. Almost all combinations of pipe flags has been tested.
Version 1.1.13.48 (TW990415):
MAJOR TASK: LOOKING FOR THE 400 ms ConSys problem.
Selftest export method working again.
Added extra export methods for test purposes.
Implemented new test classes.
Debug trace for 400 ms problem added.
Version 1.1.12.42 (TW990317):
Error in mainthread corrected - it was possible for the main thread to create a new connection during closing.
Version 1.1.12.41 (TW990311):
Corrected resource ID conflicts introduced in version 12.40, and other minor errors.
Version 1.1.12.40 (TW990310):
New VD defined in kernel: CStorageDevice.
Version 1.1.12.37 (TW990304):
Added check for valid computer name. If not valid, the kernel will not start ( ODBCInitialized = FALSE)
Added possibility to start kernel as another machine: A new option specifying a computerName has been added to the initialisation of the database settings and device settings. Using this option, a configuration on a another machine can be debugged.
Version 1.1.12.35 (TW990225):
Major task for this revision: ConSysKernel shut down.
CONSYS_CURRENT_VERSION set to 4
In CKernelDevice::¨CKernelDevice: Call new method, StopDevice, for all devices. Devices with internal ConSys clients must delete these clients in the StopDevice method.
The packet server can go into dead lock during destruction. A sync. object, m_packetServerClosing, has been introduced in the destructor and the ClientData(CConSysData* pData) method to solve the problem.
CDataServer: Monitor 'm_dataServerMonitor' introduced - used to protect all internal parameters in the dataserver and its descendants.
Version 1.1.12.34 (TW99023):
Major task for this revision: ConSysKernel start improvement.
Added starter thread to start the kernel service fast. The starter thread loads and create the devices.
Added 'GetCopy' method in all requests.
Added DeleteRequest method in CParameterRequest.
Added a pointer to the starting CConSysKernel object in all device's create method.
Initialisation in CKernelDevice, CConSysKernel changed - now loads all devices and call create before starting the client construction and database initialisation. All database load and client creation in the devices must be done in separate threads in the devices and must wait for the new sync. object, m_devicesLoaded in the CConSysKernel, to be TRUE before database initilisation/client creation.
Version 1.1.10.31 (TW981203):
CUniqueParameterSelection: Added fields initialised during Buildrequest:
Data type and access method fields are added to CUniqueParameterSelection. These are updated in CcsDatabase::Buildrequest.
Version 1.1.8.29 (TW981125):
CConSysBit: Error: BOOL values could be other than 0 and 1 in return - corrected.
CConSysWord: New constructors taking BOOL input, converts input to values 0 and 1.
C64Crate: Corrected error in [], Threestate
Version 1.1.8.28 (TW981125):
G64Crate: Address error handling improved:
The [] and WriteValue methods has been changed to check better for incorrect addressing - espial the addressing concerning the actual conversion type. The conversion classes has been modified slightly to allow these checks.
CConSysData classes: Added GetType method.
CPacketServer::Data method corrected - checks for data types before they are added to the result.
The packet server did not check for the type of the data values received from the dataservers. From version 1.1.7.26ff it was allowed to send messages as results as well as data. The packet server now separate messages from data, so the data packets only can include data values. Messages are send separate.
Version 1.1.7.26 (TW981113):
CCsDatabase: Recurring Log Messages skipped:
The CCsDatabase keeps a history of the last 10 messages logged - if a new message is identical to a message in the history, the message is not logged unless the previous message is more than 24 hours old.
CDevice Operator []: Changed return value fron CDataValue* to CConSysData*:
Changed in order to be able to return the new information message to the Data server. Changed in all Devices !!!.
CG64Crate Operator []: Changed return values in case of address error:
Before, returned NULL, now returns CInvalidAddress with a description of the addressing fault.
DataServes: Stop reading and writing after an address error:
Updated all data servers (CDumpDataServer,CFloatDataServer,CWordDataServer,CBitDataServer)
Changed id for all resource strings:
Due to overlap with resource ids with strings in other ConSys dll's and applications, the resource strings in ConSysKernel has been changed to the range starting from 12500. This solves the problem with wrong error messages loading from a resource in another dll.
Version 1.1.7.25 (TW981111):
Added version numbers to CConSysDoc (The ConSys group management file):
The two ConSys version numbers are used to ensure that only valid versions of the ConSys system can be running on a given computer. The CONSYS_CURRENT_VERSION is the newest available version of the system. The CONSYS_OLDEST_ACCEPTED_VERSION is the oldest version that may be used in a ConSys management group. These numbers are stored in the CConSysDoc by the ConSysManager. Be sure to run the ConSysManager and store the domain configuration whenever these numbers change.
Version 1.1.7.23 (TW981108):
Corrected errors in new serialization scheme.
Version 1.1.7.22 (TW981105):
New version number completed:
The object schema numbers could not be used as version numbers - wraps at 65535. Instead, a new version common version number has been added to the base object, CConSysData. New methods and Macros has been created and adopted to all descendant objects in order to work with the new version scheme.
Added constructors to CDataValue descendants:
CConSysBit, CConSysWord, CConSysString, CConSysTime, CConSysDAF: A new constructor taking a value and a CHandle has been added to these objects.
Version 1.1.7.21 (TW981104):
Temp version - new version number not working.
New CConSysData object scheme numbering (version numbers):
For each descendant, 32 are multiplied to the descendant scheme number. The CConSysData serialize will get the scheme number and store it in a public variable, m_version. The UINT scheme number can manage descendants up to 6 levels deep with this convention.
CConSysData: 1*Scheme
CDataRequest: 32*object scheme number
CDataValue: 32*32*object scheme number
CConSysBit: 32*32*32*object scheme number
Etc.
REMARK: When version 31 of a given class is reached, a new version number must be added to the class. Likewise, if a new object type is defined at level 7 this class must include its own version number.
Version 1.1.7.20 (TW981103):
Added m_valid field to CDataValue.
Changed serialization in all ConSys classes, step 1:
The MFC serialization scheme does not work as excepted for MFC classes - only one object scheme number is stored for each class - not one for each subclass.
In step one, all class object numbers has been set to 2 (the highest number used at the leaves at this point).
Version 1.1.4.17 (TW981013):
Memory leak in CConSysFifo corrected !!!
Version 1.1.4.15 (TW):
CDataPacket::GetDataValue() - renamed to CDataPacket::GetDataValueBackwards ()
This method has been used in several ConSys applications - and in most places the use has been wrong, as old data values could overwrite new ones. All ConSys programs has now been looked through and corrected.
Version 1.1.4.15 (TW?):
CG64Crate::LoadSettingsFromDatabase:
- Floating point conversions now possible for status and command fields also (not tested !!!).
- CNV_2WORDUNIPOLAR: Now also defined for control. Initialization has been changed to allow different configurations on MSW,LSW. The addressed word will become the MSW. The corresponding word will become the LSW. (status <->status_data, command <-> command_data).
Version 1.1.4.14 :
Corrected error in CG64Crate::WriteValue: Returned with error when DAF was written to adress without conversion.
Version 1.1.4.13 :
Added SetWord in CConSysDAF.
Version 1.1.4.11 (24/7-98 JSN):
MSG_HARDWARE_NOT_DETECTED added.
Version 1.1.2.7 (6/7-98 KTN):
Logging option for messages implemented.
Sub component: csDatabase (95) v3, ConSysClient (85) v3, Devices (87) v3
Message logging can now be switched of. By default all messages is logged.
The log is enhanced with autodetect of application name if possible.
Sub component: csDatabase (95) v3
By using the AfxGetApp the logging mechanism try's to obtain a handle to the logging application. If successful, the application name and version is logged.
Sub component: csDatabase (95) v4
Logging enhanced for accessing dll and application versions.
Version 1.1.2.5 (1/7-98 TW):
New clean version of RCM
A new clean version of rcm has been created. The revision numbers now follow the RCM version numbers.
Automatic insertion of RCM version numbers in resource version
The version informations in the resource script generate the version information from the common ConSys version header file and the ConSysKernel version file generated by the new TCL scripts.
Printing of device configuration
Sub component: Devices (87) v2:
A OnPrint method is added to the CDeviceDoc class.
Sub component: KernelService (97) v2:
A virtual OnPrint method is added to the CTransportDoc document and its descendant document CPipeTransportDoc.
Sub component: csDatabase (95) v2:
A virtual OnPrint method is added to the CDatabaseDoc document and its descendant document CcsDatabaseDoc.
Version 1.1.34.142 (30/6-98 KTN):
CConSysClient:
Sub component: DataServers (86) v20
Small bugs in the server corrected.
Version 1.1.34.137 (29/6-98 TW):
Removed message log: The ConSys message: "Connection to %s failed. Pipe error" has been removed in CPipeTransport::Create to avoid the ConSys log to be filled with this message by the new auto reconnect mode of the ConSys clients.
Version 1.1.34.136 (26/6-98 TW,KTN):
Dataservers Buildrequest's changed:
All Dataserver build request's has been changed - dll name and dataserver name are now hard coded into the request. Before, the dll name and dataserver name was taken from the database informations. The change has been made avoid errors when CCsDatabase::BuildRequest and other methods build a request with another dataserver than the default dataserver.
Error in data server update:
Sub component: DataServers (86) v15
The data servers did not remember the last value written to them. The result was that when an illegal value was written, the correct value was not retransmitted to the client.
CPacketServer modified for new use of CConSysClient.
Sub component: DataServers (86) v15
Deletion of the CDataRequest transmitted to the data server is postponed until destruction of the CPacketServer. This allows the remote connections from the server to make reconnects.
ConSys Client modified for reconnect after a connection break.
Sub component: ConSysClient (85) v17 and KernelService (97) v28
The ConSys Client now tries to reconnect hen a connection is lost. Because the client needs the request to reconnect, the request must exist during the entire lifetime of the client. This is important when the preserveRequest option is TRUE. The kernel service and packet server is modified to reflect this.
Option UseDumpDataserver added:
The CCsDatabase::Buildrequest using selection list has been updated with a new parameter: useDumpDataServer - default FALSE to ensure backwards compatibility. Likewise the CUniqueParameterSelectionList and CUniqueParameterSelection has been changed to include the useDumpDataServer option parameter.
Version 1.0.33.136 (19/6-98):
MemCheck added
The headers for MemCheck is added to all .cpp and .c files. To enable MemCheck define MEMCHECK in the settings of the component. MemCheck MUST be installed on the computer.
Close of invalid handles:
Sub component: KernelServeice (97) v25
A number of CloseHandle on invalid file handles was removed by if statements.
Memory leak detected:
Sub component: KernelServeice (97) v25
A file handle was not closed due to a assignment of the handle to NULL. The assignment was moved in Transport.cpp line 1162.
Termination problems for CMainThread solved.
State bug in transport layer:
Sub component: KernelServeice (97) v26
When a file transport failed to access a remote computer, a write to this channel could bring the system down.
Version 1.0.33.134 (27/5-98):
CTableConversion extended
Sub components: Indices (22) v22, G64Crate (94) v22 and resources (99) v23
The CTableConversion is now a defined conversion to be used by the system. An extra constructor is added. The constructor uses the database information for loading a conversion table from a specified file name.
Version 1.0.33.131 (27/5-98):
Message numbers changed !!!
The message numbers has been changed - now has a range for each type. Messages have been moved between severity's.
Added Message Class:
A general CInformation message class has been added. General message classes CWarning, CError has been changed to generate general warning and error messages.
Bug in CPacketServer corrected. (date:4/06/98)
Sub component: Dataservers (86) v11
When the data server returned data, the handle in the data packet was not initialized. Instead of the default handle value (NULL), it now contains the correct handle id from the request.
The changes is made in DataServers.cpp lines 295, 342 and 488.
The CcsDatabase class is extended for handling runtime classes of the classes defined in the DataTypes table
Sub component: csDatabase (95) v26
The database now loads the list of defined data types at startup. It then stores a list of the corresponding runtime classes. A added method IsDBKindOf is added for comparison between a object and the database data type id.
Version 1.0.33.128 (15/5-98):
Database: Added new functions for computer name management.
CserverNotResponding message: Added information about the computer not responding. Changed serialization.
Corrected errors:
Serialization Errors: The serialization of the objects CmfcFileException, CmfcArchiveException was wrong - the load direction where wrong - data read.
Error Messages changed
The error messages written to the ConSys log and send to the clients has been changed to give more precise and shorter messages.
Uncorrected errors:
Unloading/Stopping the kernel: Is very likely to hang - an old problem not yet looked into.
Corrected errors:
ConSys Client initialization: Error messages generated during in the construction of the ConSys client were not send to the client application. This was due to ConSys client constructor implementation. Status: Corrected.
Packet Server initialization: Error messages generated during construction of the packet server where not send to the client application due to a wrong implementation of the constructor. Status: Corrected.
Packet Server transmission error: Data following a message to the client application were not transmitted. Status: Corrected.
Last Modified 18 January 2019