FlObject	

FlObject	

Class FlCTfile 	

class FlCTfile  : public CObject;

Description
Class CTfile definition.
Public Constructors
FlCTfile(char* name  = FlTask::Proces ( )) ;
Constructor, parameter is tag with segment and offset.

FlCTfile(const FlCTfile& ct ) ;
Copy constructor.

~FlCTfile() ;
Destructor.

Public Members	
int HeaderLength() ;

int Index() ;
Table information: name, type, header length, record length, no. Of records.

int IsOpen() ;
Check if archiv eis opened.

char* Name() ;

int NoRecords() ;

int NoTables() ;
Total number of tables in CT file.

void* ReadHeader() ;
File information to retrieve.

int ReadIndex(int index ) ;
Open a table.

void* ReadRecord(int rec ) ;

int RecordLength() ;

int Type() ;

Private Data
CT ctp - CT file buffer pointer.
char file [ MAX_FILE_NAME ] - CT file name.
int hdrlen - Current header length in bytes.
void* header - Pointer to last read header.
int idx - CT actual index number.
int isopen - Flag marking if CT file is already open.
int ncts - CT number of tables in file.
int reclen - Current record length in bytes.
void* record - Pointer to last read record.

Class FlTag 	

class FlTag  : public CObject;

Description
Class FlTag definition.
Public Constructors
FlTag(TAG t ) ;
Constructor, parameter is tag with segment and offset.

FlTag(const FlTag& t ) ;
Copy constructor.

FlTag(int g ) ;
Constructor, parameter is global tag number.

virtual ~FlTag() ;
Destructor.

Public Operators	
FlTag& operator=(char* ) ;

FlTag& operator=(double ) ;

FlTag& operator=(float ) ;

FlTag& operator=(int ) ;

FlTag& operator=(long ) ;

FlTag& operator=(short ) ;

FlTag& operator=(unsigned int ) ;

FlTag& operator=(unsigned long ) ;

FlTag& operator=(unsigned short ) ;

FlTag& operator=(FlTag& ) ;
Assignment operator.

operator char() ;
Conversions.

operator char*() ;

operator double() ;

operator float() ;

operator int() ;

operator long() ;

operator short() ;

operator unsigned int() ;

operator unsigned long() ;

operator unsigned short() ;

operator!=(FlTag ) ;

operator==(FlTag ) ;

Public Members	
int ChangeRead() ;

int Compare(TAG t ) ;

int Dimension(char* Name  = NULL,char* Dim  = NULL) ;
Get the tag dimension.

int ForcedWrite() ;

TAG Id() ;
Tag id.

BOOL IsValid() ;

int Read() ;
Read tag value from RTDB.

int ReadNoClear() ;

i16 Type() ;
Get the tag type.

void Value(VAL& v ) ;

VAL Value() ;
Tag value manipulation.

int Write() ;
Write tag value to RTDB.

Private Data
char* buf - Buffer for messages.
int dimension 
TAG tag 
i16 type 
VAL value 

Class FlTagList 	

class FlTagList  : public CObject;

Description
Class FLTagList definition.
Public Constructors
FlTagList(FlTag* t ,FlTagList* prev ) ;
Constructor, parameter is pointer to FlTag object.

~FlTagList() ;
Destructor.

Public Members	
FlTagList* First(FlTagList* f  = NULL) ;

TAG Id() ;
Tag id.

FlTagList* Next(FlTagList* n  = NULL) ;

FlTagList* Previous(FlTagList* p  = NULL) ;

FlTag* Tag() ;

Private Data
FlTag* PFlTag 
FlTagList* header - Pointer to first record.
FlTagList* next - Pointer to next record.
FlTagList* previous - Pointer to previous record.

Class FlTask 	

class FlTask  : public virtual CObject;

Description
Class FlTask definition.
Public Constructors
FlTask(const FlTask& ) ;
Copy constructor.

FlTask(char* name  = _T ( SKELETON ),char* desc  = _T ( Skeleton Task )) ;
Constructor, parameters are task name and descripition.

~FlTask() ;
Destructor.

Public Members	
virtual void CTload() ;
Virtual function for loading CT file; called from 'Init'.

int ChangeReadTag(FlTag* t ,int count  = 1) ;

void Exit() ;
Exit of the FactoryLink task.

void FlSleep(int msec ) ;

int ForcedWriteTag(FlTag* t ,int count  = 1) ;

int GetNoWaitmSec() ;

int GetRunMode() ;

int Init() ;
Initialisation of the FactoryLink task.

BOOL InternetCloseConnection(HANDLE sem  = NULL) ;

BOOL InternetConnectTo(CString Connection  = _T ( ),
int Flags  = 0,
HANDLE* Sem  = NULL) ;

int InternetGetLastError() ;

virtual void Polling() ;
Virtual function for processing no wait event.

void ReCycle() ;

Run(int wait  = 1) ;

SetEvent(FlTag& tag ,
FL_FUNC_EVENT event ,
void* data ) ;

void SetRunMode(int wait  = 1) ;

virtual void Starting() ;
Virtual function for starting of task; called from 'Constructor'.

virtual void Stopping() ;
Virtual function for shutdown of task; called from 'Exit'.

BOOL WSACleanUp() ;

int WSAGetError() ;

BOOL WSAStartUp(WORD Version  = MAKEWORD ( ( BYTE ) 1, ( BYTE ) 1 )) ;

int Write() ;

int WriteTag(FlTag* t ,int count  = 1) ;

CString Xlate(CString Xlate ,... ) ;

static char* Application() ;
Task settings retrieval.

static char* Description() ;

static char* Domain() ;

static id_t GetId(BOOL SecondId  = false) ;

static KENV* GetKenv() ;

static char* Name() ;

static char* Proces() ;

static int ReadNoClearTag(FlTag* t ,int count  = 1) ;

static int ReadTag(FlTag* t ,int count  = 1) ;

static void RunTimeManager(int ,
char* ,
... ) ;
Display the state and message on the RTM screen.

static char* User() ;

Private Members	
BOOL InternetLock(HANDLE* sem ) ;
Number of users of the internet coonection.

BOOL InternetUnLock(HANDLE sem ) ;

Private Data
int InternetUsers - Number of users of the internet coonection.
_PNH OldHandler - Default exception handler.
static int Status - State of FL task.
static char fl_app [ MAX_DIR_NAME ] - FactoryLink application directory.
static char fl_desc [ MAX_PROC_DESC ] - FactoryLink task description.
static char fl_domain [ MAX_USR_NAME ] - FactoryLink application domain.
static char fl_name [ MAX_PROC_NAME ] - FactoryLink application name.
static char fl_proc [ MAX_PROC_NAME ] - FactoryLink task name.
static char fl_user [ MAX_USR_NAME ] - FactoryLink application user name.
FLDTP* fldtp - Direct Tag Processing array.
static id_t id - FactoryLink identification number of task.
static id_t id2 - FactoryLink identification number of task.
static KENV kenv - FactoryLink Kernel environment.
int m_iCount - If count > 0 then polling mode.
int m_iRunMode - Polling or exception handling.
HANDLE semInternet - Internet usage semaphore.

Class FlWinInetData 	

class FlWinInetData ;

Description
Class which handles function which must be constructed at run time since we cannot absolutely gurantee wininet will be available. To avoid the loader bringing up a message such as "Failed to load due to missing export...", the functions are constructed using GetProcAddress. The SMTP functions then checks to see if the function pointers are NULL and if it is it returns failure and sets the error code ERROR_CALL_NOT_IMPLEMENTED which is what the OS would have done if it had implemented a stub for it in the first place !!.
Public Constructors
FlWinInetData() ;
Constructors /Destructors.

~FlWinInetData() ;

Public Data	
HINSTANCE m_hWininet - Member variables Instance handle of the "Wininet.dll" which houses the 2 functions we want.
LPINTERNETATTEMPCONNECT m_lpfnInternetAttemptConnect 
LPINTERNETAUTODIALHANGUP m_lpfnInternetAutoDialHangup 
LPINTERNETGETCONNECTEDSTATE m_lpfnInternetGetConnectedState