Академический Документы
Профессиональный Документы
Культура Документы
CoDeSys V 3.x
SysComAsync.library
CONTENT
1 OVERVIEW 3
2 LIBRARY MODULES 4
CHANGE HISTORY 6
libdoc_e.dot / V1.0
1 Overview
Note: It depends on the target system, which system libraries can be used in the application program.
This library supports the asynchronous serial communication with a target device. It
automatically includes the library SysCom.library for synchronous communication, whose
modules are used as a basis for the corresponding asynchronous functionality. The modules
of SysCom.library make available their parameters to the SysComAsync.library in appropriate
structures. Thus these parameters can be used by the methods and wrapper-methods of
SysComAsync.library.
Note: For the asynchronous processing of the tasks the library also uses the base library CmpAsyncMgr.library.
For this purpose the component CmpAsyncMgr must be available!
libdoc_e.dot / V1.0
2 Library Modules
Due to the fact that the async-functionality for file accesses is basing on the modules of
SysCom.library, using wrapper-methods and shared structures (DUTs), the async-modules
always need the following input parameters:
Input-Variable Datentyp Beschreibung
The functions:
SysComOpen
SysComOpen2
SysComPurge
SysComRead
SysComSetSettings
SysComSetTimeout
SysComGetSettings
SysComClose
SysComWrite
ComSettings
ComSettingsEx
COM_Baudrate
libdoc_e.dot / V1.0
COM_Parity
COM_Ports
COM_StopBits
COM_Timeout
The structures (DUTs, Data Unit Types) are named according to the following syntax:
t<function of SysCom.library>. Example: tSysComOpen.
The return value of each function is given in the structure element pulOut resp. pOut or
pszOut.
Example:
DECLARATION:
udStateOpen: UDINT := ASYNCSTATE_INVALID;
ParamOpen : tSysComOpen;
TestFB : SysComAsyncFB;
Result: UDINT;
IMPLEMENTATION:
ParamOpen.pResult := adr(Result);
ParamOpen.pulOut := adr(hCom);
ParamOpen.wPort := 1;
hJob := TestFB.SysComOpenAsync(adr(ParamOpen), adr(udStateOpen),
adr(Result));
When calling the method SysComOpenAsync, the asynchronous job gets started. The job will
be finished as soon as the status has got one of the following three values:
For a description of the particular parameters please see the chapters on the corresponding
functions in the documentation on SysCom.library.
libdoc_e.dot / V1.0
Change History
Version Description Date