LabMap®
Handbook
The seventeenth edition
Dr. Dmitry A. Kazakov,
Rüdiger zum Beck
December 2012
© Copyright cbb software GmbH
Table Of Contents
- Registry keys (general)
- Virtual registers
- AK (AK interface)
- Cast (System interface)
- DiCom (DiCom 4000 interface)
- DMX (Digital MultipleX device interface)
- ExtFix (External fixation device interface)
- FLG (Driver's aid interface)
- IAVCAN (IAV CAN iterface)
- ModBus (MODBUS/TCP interface)
- Net (Network TCP/IP interface)
- NICAN (National Instruments' CAN-bus interface)
- ODBC (Open DataBase Connectivity interface)
- PGMNet (Network Pragmatic Generic Multicast interface)
- PLU (PLU 401 interface)
- RC (Infrared remote control interface)
- SPS (OPC interface)
- User (User registers interface)
- VCI (Virtual CAN interface of IXXAT)
- Virt (Virtual registers interface)
- VXL (CAN interface through XL driver library of Vector Informatik GmbH)
LabMap® is a 32-bit MS-Windows® multithreading application providing a high level interface for industrial communication, control, measurement, and logging. LabMap® allows asynchronous viewing and modification of the system variables from potentially unlimited number of applications running on same or different LAN/WAN network hosts. LabMap® has an open architecture supporting smooth integration of new hardware and software components. It has integrated support of measurement units and time stamping of the system variables. The software functions under Microsoft Windows® (x86 platform). This manual reflects the version 5.5 of LabMap®.
1.1. Hardware and software requirements
Depending on the actual system configuration and used components the following hardware and software are necessary:
| Option | Required hardware | Required Software | |||||||
| Basic system | IBM PC® with an x86 processor |
|
|||||||
| AK interface | COM port |
|
|||||||
| Cast interface |
- |
- |
|||||||
| DiCom interface | AVL DiCom 4000 device, COM port, Special serial cable |
|
|||||||
| DMX interface | Either of the following:
|
|
|||||||
| ExtFix interface | COM port, the external fixation device |
|
|||||||
| IAVCAN interface | A CAN adapter card by IAV |
|
|||||||
| FLG interface | Any hardware supporting TCP/IP (such as an Ethernet adapter, modem, ISDN card) |
|
|||||||
| LSC interface | - |
|
|||||||
| MODBUS/TCP interface |
Any hardware supporting TCP/IP (such as an Ethernet adapter, modem, ISDN card) |
|
|||||||
| Net interface | Any hardware supporting TCP/IP (such as an Ethernet adapter, modem, ISDN card) |
|
|||||||
| NI-CAN interface | A CAN adapter card by National Instruments |
|
|||||||
| ODBC interface |
- |
|
|||||||
| OPC
interface (see) |
- |
|
|||||||
| PGMNet interface |
Any hardware supporting PGM packets (such as an Ethernet adapter.) |
|
|||||||
| PLU interface | Pierburg PLU 401 |
|
|||||||
| RC interface | Volltronic's remote control device, COM port. |
|
|||||||
| RRR interface | AVL 6801A01 transputer link ISA card | ||||||||
| User interface | - | - | |||||||
| VCI interface |
A CAN adapter card compatible with IXXAT's virtual CAN interface |
|
|||||||
| Virtual interface | - | - | |||||||
| VXL
|
A CAN adapter card of Vector Informatik GmbH supported by XL driver library |
|
1.2. Architecture overview
LabMap® operates
as a
software bus system. It offers an abstraction of the application
level from the hardware specific and decoupling the hardware
interface modules from the application level. In other words
there are two levels of abstraction supported by the bus system:
The application abstraction
interface
exposes LabMap® as a set of variables (registers).
Each register has a type, value, timestamp and I/O direction. The
four basic I/O requests are supported for each register:
LabMap® offers a variety of synchronization mechanisms to an application:
The hardware abstraction interface of LabMap® allows easy integration of new hardware devices and communication protocols into the system. Each class of hardware devices or communication protocol supported by LabMap® is represented by a hardware interface. The hardware interface is responsible for implementation of the basic I/O operations upon the registers assigned to it. LabMap® uses a messages mechanism for interacting with the hardware interfaces. A hardware interface is developed as dynamic-link library which code can be maintained independently from the LabMap® core.
Additionally to the basic configuration cbb software GmbH offers different plug-ins.
1.3.1. Remote access interface
The remote access interface (LabNet.dll) allows LabMap® to manipulate registers of remote hosts also running LabMap®. The remote access functions over TCP/IP network protocol. LabMap® running as the server can limit the number of simultaneous client connections. Additionally it can maintain lists of allowed and denied hosts. The remote access interface supports register mapping mechanism. A screen shot of a MMI controlling a Zoellner dynamometer from a remote host accessed via modem internet connection is shown on fig.1.1:
![]()
Figure 1.1. Remote MMI
The dynamometer parameters on Fig 1.1 are indicated on-line in a graphical from using the on-line graphics plug-in. The remote access interface allows to integrate several LabMap® hosts into one distributed system. The system variables (registers) can be either shared by all hosts of the system or be local for each host. Each host may function as a server of an arbitrary number of remote host. A server usually maintains the system variables related to the hardware connected to the host. The clients may remotely access the variables maintained by the server. At the same time a server may access the system variables provided by other hosts. Typical configurations are shown on figures 1.2-4:
![]()
Figure 1.2. Star topology: one server - several clients
Here the server runs a man-machine interface software (MMI) and communicates with the hardware attached to it. Several client hosts monitor the system state. This configuration is used when the hardware is shared by several hosts. Actually each of the hosts may run MMI. However, only one at time should have control (have access to) the hardware. The arrows on the figure indicate the client-server relations. Connections between server and client are point-to-point. Note also that the actual topology of the underlying network can be any, as long it supports TCP/IP.
Figure 1.3. Star topology: several servers - one client
Here several hosts are connected to the hardware. They work as servers for the single client that runs MMI. This configuration is usual when the hardware is scattered over the network hosts. In the shown example RRR and SPS are connected to different hosts. Being servers these hosts provide the corresponding hardware specific registers for the client running MMI.
![]()
Figure 1.4. Gateway
In this case a host is simultaneously a server and a client. It works as a gateway to access some remote host having a hardware attached to it. This is the typical situation when some hosts of the network are connected over slow communication lines like modem link. The gateway host controls the communication to the remote host, so that network traffic over the slow line remains bearable. It mirrors all necessary registers of the remote host for other hosts of the network.
1.3.2. On-line graphics (oscillograph)
The on-line graphics plug-in allows µs precision timings measurements of system parameters and their graphical representation on-line (fig.1.2).
Figure 1.2. On-line graphics plug-in
Features:
1.3.3. XY-graph
The on-line graphics plug-in allows µs precision timings measurements of system parameters and their graphical representation on-line (fig.1.3).
Figure 1.3. XY-graph plug-in
Features:
1.3.4. On-line log
The on-line log allows to log values of the selected registers. Features:
1.3.5. On-line monitor
The on-line monitor allows to watch the integral state of the registers. Screen shot is shown on Fig.1.4:
![]()
Figure 1.4. On-line monitor
1.3.6. Bus messages monitor
The bus messages monitor allows to watch the raw data of some messages-oriented interfaces. Screen shot is shown on Fig.1.5:
![]()
Figure 1.5. Bus messages monitor
Features:
1.3.7. Multicast server
The multicast server plug-in provides an
efficient efficient one-to-many IP communication, conserving bandwidth by
reducing traffic between hosts through filtering out the packets required by the
hosts
accessible along the routing path.
Multicast groups. Traffic control is based on the multicast group concept. A multicast group contains all receivers interested in particular multicast stream. The group can stretch across local network borders. Hosts declare their wish to attend a group using IGMP (Internet Group Management Protocol: RFC 3376.) For this reason all the routers and switches between the producer and all receiver hosts, have to support IGMP to get advantage of filtering. This in particular requires the hosts to run at least Windows 2003 Server® Server. When a host wishes to join a multicast group, its request propagates up to the producer host. This causes IGMP-capable devices to start routing the IP packets of the group down to the receiver. Otherwise multicast packets are dropped. When the receiver leaves the group, and there are no other receivers along the path, the IGMP-capable device stops routing and thus the packets of the group get dropped again. This policy allows effective filtering of the multicast IP packets Multicast IP packets have the class D of IP addresses. The Internet Numbers Authority (IANA) controls assignment of IP multicast addresses. The addresses 224.0.0.0 to 238.255.255.255 can be used for implementation of proprietary protocols. Though among this range some addresses are reserved. Each multicast group has a unique address of the above class. Further the number of groups can be limited by the hardware. It is important to note that within one group there can be many multiplexed packet streams. So the group determines the topology of routing and filtering and not the content. Multiplexing is achieved on the port basis.
Multicast transport. Differently to broadcasting, multicasting was designed with reliability in mind. LabMap® uses reliable multicasting protocol PGM (Pragmatic General Multicast: RFC 3208.) The network packets used are neither TCP nor UDP. The protocol takes responsibility for resending lost packets as necessary. Technically the multicast stream is buffered in the routing nodes. The negative acknowledgements from clients propagate up to the last routing node, which has the lost packet. The packet is then resent down to the client. Therefore PGM has no typical drawbacks of UDP communication, yet provides an efficient one-to-many connection.
The LabMap® multicast server supports and unlimited number of multicast groups and an unlimited number of ports multiplexed in a group. Note that as was stated above, traffic filtering is based solely on the group basis. The packets of all ports within a group are routed together. Each configured port in a group has a corresponding publisher. Any LabMap® register can be published by any of publishers. The publisher is responsible for broadcasting the events associated with changing the state of the published registers as well as for periodic broadcasting the information about the registers published. The clients can connect to the publisher's broadcasting at any time. Within the broadcasting period described above any new client receives the whole information about all published registers. The data sent within this period are called frame. The frame length determines how quickly a client can connect to the publisher. Shorter frames require wider bandwidth and have bigger overhead, because within one frame register state is updated incrementally, allowing to reduce the traffic.
Windows 2003 Server® by default does not have PGM installed. The Fig 1.5 represents a network properties dialog called using Start → Settings → Network connection → some connection. The component Reliable Multicast Protocol must be installed and enabled there.
Figure 1.6. Network connection properties dialog of Windows 2003 Server®
The LabMap® multicast server can be configured on-line. The user dialog is invoked from the system menu as shown on the fig. 1.7.
Figure 1.7. Multicast server configuration in LabMap® menu
The configuration dialog is shown on fig. 1.8.
Figure 1.8. Multicast server configuration dialog
The configuration dialog allows creation and deletion multicast publishers. Publishers are automatically organized into multicast groups according to its addresses. The publisher properties dialog is shown on the fig. 1.9.
Figure 1.9. Multicast publisher properties dialog
The registers to publish can be selected using the register publishing dialog (fig. 1.10):
Figure 1.10. Register publishing dialog
The publishing period when non-zero limits the publishing rate of the register to the specified number of milliseconds. Otherwise, the register state change is published as soon as possible.
1.4.1. AK server
LabMap® can be remotely accessed using the AK protocol. LabAKSrv is an application implementing the AK server for LabMap®.
1.4.2. Log files converter
LabMap® log files conversion utility can be used to obtain text files from.
1.4.3. Remote registers mapper
The utility program LabNetMap provides a simplified way of automatic network registers creation. The registers are mapped to the registers of some remote LabMap® host. When possible the utility creates the network registers with the same numbers as the remote registers have. The created registers will have the names of the remote ones. The utility has the following arguments:
labnetmap <host-handle> <timeout> [<message-handle>] "<prefix>" [<first-temp-handle>]
where:
For instance, the command
labnetmap 10 1000 "Exported"
Here the host register is 10, the connection timeout is 1s, the prefix is "Exported". When using shell command lines, make sure that the standard error stream is redirected to the terminal. Alternatively one can store it into a file:
labnetmap 10 1000 "Exported" 2> error.txt
2. Installation and Components
The general structure of LabMap® is shown on the fig.2.1:
![]()
Figure 2.1. The software structure
The software structure allows user-written applications to access the system variables and parameters over the standard interface independently from the actual hardware configuration. The programmer interface is provided by LabMap.dll. It implements user requests using the hardware specific interfaces. The software has an open architecture. Hardware interfaces can be added at needs without modification of LabMap.dll and user applications. The following hardware interfaces are presently supported:
|
Intrface name |
Hardware |
Implemented by |
C/C++ Prototypes |
| AK | Devices supporting the AK protocol | LabAK.dll | LabAK.h |
| Cast | Operating system | LabCast.dll | |
| DiCom | AVL® DiCom 4000 device | LabDiCom.dll | LabDiCom.h |
| DMX | DMX-512 devices | LabDMX.dll | LabDMX.h |
| ExtFix | The external fixation device used in the Medizinishe Universität zu Lübeck | LabExtFix.dll | LabExtFix.h |
| FLG | Ergo-drive FLG servers (driver aid unit) | LabFLG.dll | LabFLG.h |
| IAVACAN | CAN-bus (the Controller Area Network) via adapters cards by IAV | LabIAVCAN.dll | LabIAVCAN.h |
| Net | Allows building systems distributed over TCP/IP sockets | LabNet.dll | LabNet.h |
| LSC | The LSC application maintained by AVL Zoellner GmbH | LabLSC.dll | LabLSC.h |
| Map | It responds no hardware directly, rather uses other interfaces to implement complex operation visible for other application as simple variables | LabMap.dll | LabMap.h |
| ModBus | MODBUS/TCP hosts | LabModBus.dll | LabModBus.h |
| NI-CAN | CAN-bus (the Controller Area Network) via adapter cards by National Instruments | LabNICAN.dll | LabNICAN.h |
| ODBC | ODBC-complaint database | LabODBC.dll | |
| PGMNet | IGMP-capable routing devices. Additionally Windows Server 2003® is required | LabPGMNet.dll | LabPGMNet.h |
| PLU | Pierburg PLU 401 devices | LabPLU.dll | LabPLU.h |
| RC | Volltronic's remote control device | LabRC.dll | LabRC.h |
| RRR | RRR (German abbreviation of "dynamometer controlling computer") is a computer (based on the inmos® T805 processor) controlling in real-time the roller dynamometer. The RRR is connected to the host computer via transputer link using AVL® 6801A01 transputer link card. For more information, please, refer Zoellner documentation | LabMap.dll | LabMap.h |
| SPS | OPC interface to communicate with the devices controlled by an OPC server. For the interface description see. | LabSPS.dll | |
| VCI |
CAN-bus (the Controller Area Network) via adapter cards by IXXAT |
LabVCI.dll | LabVCI.h |
| Virt |
On-line evaluated registers |
LabVirt.dll | LabVirt.h |
| User |
Memory (user variables) |
LabUser.dll | LabUser.h |
| VXL |
CAN-bus (the Controller Area Network) via adapter cards by Vector Informatik GmbH |
LabVXL.dll | LabVXL.h |
LabMap.exe provides dialogue based user interface. The executable and DLL files should be placed into the Windows home directory and the system registry should be configured. The LabMap® may be started either manually by invoking the LabMap.exe or automatically by starting an application that uses any of interface DLLs.
LabMap.exe always starts minimized. If one opens its main panel it looks as shown on the fig.3.1:
Figure 3.1. The main panel
The main panel contains the following elements:
The main panel menu has the following additional items defined:
The log panel of LabMap® appears when user clicks on the Log button of the main panel. The log panel is shown on the fig.3.2:
Figure 3.2. The log panel
Each message on the log panel occupies exactly one line and consists of four fields:
The data flow panel appears on clicking on the Data button of the main panel. The data flow panel is shown on fig.3.3:
Figure 3.3. Data flow panel
The data flow panel contains the following elements:
To watch over a register one should open the handle watch panel by typing a number in the edit box of the main panel and pressing ENTER. The handle watch panel is shown on fig 3.4-6:
![]()
Figure 3.4. Output register watch panel
![]()
Figure 3.5. Input register watch panel
![]()
Figure 3.6. Record register watch panel
Input registers accept values from the host computer. The values can be set by the operator using the watch panel and/or by an application over the programmer interface. Output registers read-only values to the host computer. Record registers are place holders for grouped input registers periodically requested by the host computer. A watch panel contains the following elements:
gray
The register is not marked for logging blue
The register is marked for logging. Note that this does not mean that the register is being logged. It only means that it will be logged if the logging will be active.
gray
There was no operation on the register, hence its state is undefined green
The last operation was successful yellow
An operation is in progress. Notice that an operation is always in progress for a handles sent automatically each n ms (see discussion concerning output handle properties below) red
The last operation failed
Figure 3.7. Manual value set
All the applications communicating working with LabMap® will be notified that the value has been changed exactly the same way as it would be if the value were actually changed by the hardware.
|
|
In most cases changing value of an output handle has no sense and could be potentially very dangerous, because the value would no more respond to the actual value held by the hardware |
One can quickly switch a watch panel from one handle to another. Clicking on the handle number field pops up the panel shown on the fig.3.8. One can choose the desired handle to watch out of the list by simple mouse click. The list contains all the known (declared) registers.
![]()
Figure 3.8. Handle selection panel
The registers in the selection panel can be sorted by name, handler and number. One can also directly type the register number or name using the keyboard. If the input unambiguously identifies a register it will be shown. Alternatively one can use the arrows and enter key to select a register. LabMap® members desktop locations of all watch panels that were not closed before terminating LabMap®. So that they reappear on the same places by next start of LabMap®.
3.5. Modifying handle properties
The properties panels are shown on fig. 3.9-10:
Figure 3.9. Output handle properties
Figure 3.10. Input handle properties
A register has the following properties:
Default timeout The default timeout is one for all handles. The timeout is set in milliseconds. Changing it affects all registers having default timeout Specific timeout The specific timeout is unique for each register. The timeout is set in milliseconds No time limit When selected, all operations on the register are not time limited
Upon request The value should be explicitly requested On change The value is automatically updated when it is changed, but not oftener than each n ms Each The value is automatically updated each n ms. The effective timeout for handles requested to be sent each n ms, is calculated as the specified_timeout + n
The properties dialog may contain additional interface-specific information as discussed below.
When user attempts to watch an unknown register, LabMap® opens the handle creation panel shown on fig.3.11:
![]()
Figure 3.11. Handle creation panel
There are four types of registers supported:
The record registers are place holders for grouping other registers to speed up data transmission. The groups are automatically filled by LabMap® to achieve optimal performance. Currently only the RRR supports records. For floating-point registers input (software) and output (hardware) measurement units can be set. See LabMapSetUnits for further information.
3.7. Properties of CAN handles (IAV, NICAN, VCI, VXL interfaces)
The properties panel for a CAN-bus handle is shown on fig. 3.12:
Figure 3.12. CAN-Handle properties panel
The adapter / port configuration panels are specific to the interface. Usually they contain settings for the baud rate, polling intervals etc. For a NICAN CAN-port the configuration panle is shown on fig. 3.13:
Figure 3.13. CAN configuration panel
The CAN-message configuration dialogs are shown on fig 3.14-16

Figure 3.14. CAN message advanced configuration mode
Figure 3.15. CAN message slice configuration
Figure 3.16. CAN message as-is configuration
3.8. Properties of ModBus handles (MODBUS/TCP)
The properties panel for a ModBus handle is shown on fig. 3.17:
Figure 3.17. ModBus-Handle properties panel
3.9. Properties of Net handles (Network TCP/IP interface)
The properties panel for a network handle is shown on fig. 3.18:
Figure 3.18. Net-Handle properties panel
The properties panel for a Net handle with browse dialog is shown on fig. 3.19:
Figure 3.19. Net-handle properties panel with browse dialog
The configuration/properties panel for the remote server configuration is shown on fig. 3.20:
Figure 3.20. Net-Handle remote server configuration dialog
3.9. Properties of User handles (User registers interface)
The properties panel for a User handle is shown on fig. 3.21:
![]()
Figure 3.21. User-Handle properties panel
3.10. Properties of Virt handles (Virtual registers interface)
The properties panel for a Virt handle is shown on fig. 3.22:
![]()
Figure 3.22. Virt-handles properties panel
3.11. Properties of PGMNet handles (Pragmatic Generic Multicast interface)
The properties panel for a PGMNet register is shown on fig. 3.23:
Figure 3.23. PGMNet register properties panel
The configuration/properties panel for the remote server configuration is shown on fig. 3.24:
Figure 3.24. PGMNet remote server configuration dialog
LabMap® provides bindings to other programming languages. The bindings are available for:
Further bindings are provided to engineering frameworks:
This document describes C/C++ bindings.
The programmer interface consists of two large parts:
Hardware specific interfaces are not recommended for use unless you exactly understand and know what you are going to do with them. An application using a hardware dependent interface looses an advantage of being hardware independent.
LabMap.dll exports the following functions (all of them have C call conventions):
The functions marked by the
icon
are implemented by all
interface DLLs, i.e. they exist in both hardware-independent and
hardware-specific forms. For instance, when you use LabMapSendInt, it has the effect that a new value
will be sent down to the hardware responsible for the specified register, say,
to RRR.
Then the same effect will have also a call to LabMapSendInt. As
for send commands, you should be very careful, because sending a
value via a hardware dependent interface which is not responsible
for the register may cause undesired side effects (apart from
malfunction).
LabIAVCAN.dll additionally (to the functions marked by
)
exports the following functions (all of them have C call
conventions):
LabNet.dll additionally exports the following functions (all of them have C call conventions):
| LabNetDisconnect |
| LabNetGetConnectionInfo |
| LabNetGetHandleInfo |
| LabNetMapHandle |
The header files for hardware interfaces are listed in the interfaces table. The header files can be used with an ANSI C or ISO C++ compiler. When using Microsoft Visual C++ compiler, make sure that the run-time libraries are linked in the shared (DLL) form. LabMap® is MFC (Microsoft Foundation Class library) free. However, you are free to use MFC in applications linked to LabMap®. Doing so, remember that MFC run-time library must be linked as a DLL (shared). Make sure that multithreaded versions of the DLLs are used.
If other not stated the result of an interface function is encoded as follows:
| Code | Meaning | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| < 0 (negative) | Failure. The result value encodes the error reason:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 0 | Success | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > 0 (positive) | Success (and result if any). Value 1 has ResRRRSuspicious code which indicates that the operation perhaps returned an erroneous value. However there is no way to determine this. For instance, log read operations return this code when the returned value was obtained by an extrapolation of the log data |
To avoid blocking LabMap® uses messages technique. A potentially blocking operation is not executed on the caller's context. Instead of this it causes sending some message to the interface implementing the operation. Figure 4.1 illustrates execution of LabMapSendInt on the example of the SPS interface:
![]()
Figure 4.1. Execution of a blocking operation
The caller might belong to any system process. The messages technique allows to cross the process borders when the operation cannot be executed on the caller's context. Usually there is no necessity to send a message explicitly. It is recommended to use higher level interface functions instead. Note also that hardware-dependent interfaces support only a subset of messages listed below:
| Message (symbolic name) | Event (sent when) | Data |
| CmdRRRCloseHandle | A system handle injected into LabMap.exe should be closed to release the system resource. The message is sent when it is not possible to do from the caller's context. This message also serves synchronization purpose upon exit. LabMap.exe sends it to each hardware interface as a notification upon exit. After that it waits for the handle, which usually is the handle of the dispatcher thread of the interface (gets signaled upon thread completion). The handle is returned by LabMapDispatcher call. If it is zero, then the CmdRRRCloseHandle will not be sent. | HANDLE to be closed |
| CmdRRRCompleted | This message is sent to LabMap.dll upon operation completion (usually failed) for a remotely accessed register. The register's state and error code are scheduled to be sent to the remote clients. | Pointer to the remote host caused operation completion (can be 0) |
| CmdRRRConfigure
|
This message is sent to an interface when the interface gets selected in the register properties dialog box. The interface may subclass the dialog box to show additional configuration fields. The message can be ignored if the interface does not support interactive register configuration. | Handle to the dialog box (HWND) |
| CmdRRRDelete | It is sent to an interface when a register served by the interface is being deleted. The message is processed internally, so an interface should not processes it. | |
| CmdRRRGotAccess | A user has gained access to the exclusive registers. All connected remote hosts will be notified upon this message. | unsigned number: user ID, pointer to the remote host (can be 0 or missing) |
| CmdRRRInterfaceLoad | This message is sent to LabMap.dll to notify it that a new interface was loaded (possibly in a process other than LabMap.exe). The data packet contains the name of the interface (as a null-terminated string). | The interface name (null-terminated) |
| CmdRRRLogCease | This message is sent upon graceful deactivation of logging. | |
| CmdRRRLogCreate | This message is sent to indicate that a log file should be created. The data packet contains the name of the log file (as a null terminated string). It can be empty to indicate that the current log file should be closed without opening a new one. | The log file name (null-terminated) |
| CmdRRRLogStart | This message is sent upon logging activation. | |
| CmdRRRLogStop | This message is sent upon logging deactivation. | |
| CmdRRRLogout | Notifies that a user has logged out. | User name (not null-terminated) |
| CmdRRRLostAccess | A user has lost access to the exclusive registers. All connected remote hosts will be notified upon this message. | unsigned number: user ID, pointer to the remote host (can be 0 or missing) |
| CmdRRRModified | Modification of a remotely accessed register that changes the value of the register. The register's value and time stamp are scheduled to be sent to remote clients. | Pointer to the remote host caused operation completion (can be 0). |
| CmdRRRRefreshed | Modification of a remotely accessed register that does not change the value of the register, i.e. when the new value is equal to the old one. The register's value time stamp is scheduled to be sent to remote clients. | Pointer to the remote host caused operation completion (can be 0) |
| CmdRRRRegisterConfig |
Register configuration request. It is sent to subclass a
window with a register configuration subdialog. The message is used only internally. The data packet contains a handle to the window to subclass (HWND), the window area used to place the register configuration controls (RECT), and the unit name. The last can be empty. When the interface rejects the configuration attempt it should post WM_RRRFinalized to the parent window with WPARAM set to ResRRRNotHandled. |
1) Handle to the parent window (HWND); 2) Rectangle to put the device unit configuration controls (RECT); 3) Null-terminated device unit name. |
| CmdRRRRemoteDelete | Notifies that a remotely connected register has been deleted. This message is sent to LabMap.dll. | |
| CmdRRRRendezvous | Notifies an interface that about a rendezvous request pending. Rendezvous are used internally for synchronous calls to the interfaces. This mechanism is never used by LabMap.dll itself and provided for interface developers. It is upon an interface to choose which kind of rendezvous it will use. If it does, its dispatcher thread need not to react to the message, because it is processed internally, so that the dispatcher will not be directly aware of it. | |
| CmdRRRRequest |
The value of a register has been requested. The receiver initiates asynchronous I/O to get the register's value from the hardware | |
| CmdRRRSend |
The new value of a register has been set. The receiver initiates asynchronous I/O to send the register's value to the hardware | |
| CmdRRRStart |
The hardware configuration start. Usually this command is followed by a sequence of CmdRRRStartHandle commands ended by the CmdRRRStartFinal command | |
| CmdRRRStartFinal |
The hardware configuration end. This command follows a sequence of CmdRRRStartHandle commands. This is the last command of the configuration sequence | |
| CmdRRRStartHandle |
A register should be configured. Depending on the way the register is requested the hardware is configured. Upon start this command is sent for each known register except for ones included in records. The data packet contains two unsigned numbers | Two unsigned numbers: 1) copy of the register's status field; 2) copy of the register's request policy field |
| CmdRRRStop |
End of closing the connection to the hardware. This command ends a sequence of CmdStopHandle commands | |
| CmdRRRStopHandle |
The hardware should disconnect a register. For each CmdRRRStartHandle sent upon start a corresponding CmdRRRStopHandle will be sent upon stop | Two unsigned numbers: 1) copy of the register's status field; 2) copy of the register's request policy field |
| CmdRRRStopInitial |
Start of closing the connection to the hardware. This command begins a sequence of CmdStopHandle commands | |
| CmdRRRUnitConfig |
Device unit configuration request. It is sent to subclass a window with a unit configuration subdialog (see LabMapUnitConfig). The message is used only internally. When sent to LabMap.dll (the first stage of message processing), the data packet contains, a handle to window to subclass, the window area, interface name and optional, unit name. LabMap.dll dispatches the message to the interface responsible for the unit dialog. At this stage its data/ packet contains no interface name. When the interface rejects the configuration attempt it should post WM_RRRFinalized to the parent window with WPARAM set to ResRRRNotHandled. | 1) Handle to the parent window (HWND); 2) Rectangle to put the device unit configuration controls (RECT); 3) Null-terminated interface name; 4) Null-terminated device unit name. |
| CmdRRRUpdateState | The status fields of register's watch panel has to be refreshed | |
| CmdRRRUpdateValue | The value field of register's watch panel has to be refreshed | |
| CmdRRRUpdateWatch | Entire register's watch panel has to be refreshed | |
| CmdRRRWatch | Register's watch panel has to be shown. The X, Y coordinates are sent as the message data. When one of the coordinates is negative, the register panel is closed. When both X and Y are positive it is opened if does not exist. Otherwise, the existing panel gains focus and the coordinates are ignored. | Two signed numbers: 1) the X coordinate of the watch panel; 2) the Y coordinate. |
Only messages marked by the
icon are
sent to all interface DLLs. Others are processed by the LabMap.dll only.
The values of registers can be accessed asynchronously by several processes scattered over the network. The access concept is user-based. Any process using LabMap® should log in as a user (see LabMapLogIn). User names are global for the network. User list is maintained by LabMap®. Any user may read register values. In contrary to this write access is restricted. Figure 4.2 illustrates register access:
Figure 4.2. Accessing registers
All registers can be subdivided into two classes
Not only writing to exclusive registers is restricted by this way. Here is the full list of actions that will fail without having an access to the register:
There are two ways of accessing an exclusive register:
Accessing register in a networking environment should be considered more carefully. Each host running LabMap® has its own copy of all register values and user list. When a register is accessed (written for instance) the local host decides whether the access is accepted or denied. For performance sake the local host relies on its own information, remote hosts are not asked. LabMap® software tries to synchronize register owning information, so that each host would have it same. Similarly the updated value or state of a register is sent to all other hosts viewing the register. Only remote registers (ones handled by LabNet.dll interface) or registers viewed by some remote hosts are subject of synchronization. Such registers are global, i.e. their copies in each of LabMap®s have same values and owners. Other registers remain local, i.e. each LabMap® has its own unsynchronized copy of it with possible different values and owners. Values of registers are provided with time stamp in universal coordinated time (UTC). Clocks of all hosts viewing the global registers should be synchronized as precise as possible.
The interface LabNet.dll has several operating modes:
When hosts are linked in read-only mode they remain isolated in terms of register owning. It means that different users may simultaneously access them. They still may share some registers, however exclusively accessed registers may neither be sent nor requested remotely. Note also that if a read-write connection is established in parallel to the read-only one, the isolation would be lost.
The blackboard is a ring buffer allocated in the shared memory that contains the most recent updates of the register values and the signals raised for the registers. An application may periodically inspect the blackboard contents to figure out whether a value of a register was changed. Unlike the way the subroutine LabMapWaitForUpdate acts, the blackboard. mechanism allows catching all value updates. See LabMapSetIntCallBack, LabMapSetRealCallBack, LabMapSetSignalCallBack and LabMapSetStringCallBack for further information.
LabMap® offers an option of constraining the register values by setting value bounds. A value constraint is a pair of bounds defining a contiguous interval of register values. For string registers the bounds limit the string length. Several constraints can be set independently on the same register with the restriction that the constraints comprise a set of nested intervals of values. For each constraint one can define one of the following reactions on bounds violation:
| Reaction (symbolic name) | Description | Effects on virtual registers | ||
| Bounds | Bounds error | |||
| in | out | |||
| BoundsRRRPass | The value is set into the register as-is. The special registers named "Bounds in", "Bounds out", "Bounds over", "Bounds under" handled by LabMap.dll monitor bounds entering and leaving. One can use LabMapSetIntCallBack to monitor such events without polling. Additionally the function LabMapCheckBounds provides an easy way of checking which bounds have been violated by the current register value. | register number | register number | - |
| BoundsRRRSaturate | The value is saturated to the corresponding bound and the result is set into the register. | - | - | - |
| BoundsRRRDiscard | The value is ignored, the register state and value remain unchanged. The special LabMap.dll register "Bounds error" monitors the values discarded due to bounds violation. Its value is set to the register number which value was discarded accompanied by the discarded value. Usually this register is marked for logging to track down unfeasible values. | - | - | register number and value |
| BoundsRRRSignal | The register sate is set to StatusRRR*BoundError depending on which bound has been violated. The register value is not changed. The special LabMap.dll register "Bounds error" monitors the values discarded due to bounds violation as in the case of BoundsRRRDiscard. | - | - | register number and value |
The bounds are checked for all operations which might change the register value. This includes the register handlers. So an output register bounds can be used to prevent unfeasible values received from the hardware. Similarly, bounds set on an input register will prevent sending illegal values to the hardware as a result of a software fault. Bounds are set using the following calls: LabMapSetIntBounds, LabMapSetRealBounds, LabMapSetRealSIBounds, LabMapSetStringBounds. Note that no bounds can be set on any of the virtual registers handled by LabMap.dll (see). The register bounds can be removed using the function LabMapDeleteBounds.
int LabMapAcceptMessage
(
unsigned char * Command,
unsigned * HandleNo,
void * Data,
int * Size
);
This function is used by interface handlers to pick up a message from the queue of the handler. When the queue is empty the handler enters wait state. The Command parameter receipts the operation code. The HandleNo parameter accepts the number of the register. Note that some messages do not related to any specific register. In this case zero is returned. The Data parameter points to the buffer to store the message data. The Size parameter initially contains the size of the data buffer. After successful completion it will have the actual size of the data packet. If the function fails with the ResRRRDataOverrun code, the Command and HandleNo parameters would be properly set according to the actual packet in the queue. The packet itself remains in the queue.
|
|
|
int LabMapAccess (void);
This function is used to gain the access to the exclusively accessed registers. The operation fails when some other user already has the access. See also: LabMapDeaccess, LabMapGetOwner, LabMapLogIn.
RECT LabMapBottomOf (void);
This function returns a pointer to the rectangle corresponding the area bottom of the window subclassed by LabMapUnitConfig. When specified there it causes the parent window to be extended downwards with unit configuration controls.
int LabMapCanExit (void);
This function checks if the LabMap.exe is the single application that uses the software. If yes (return value is not zero) the LabMap.exe could be terminated.
Return value 0 The LabMap.exe cannot be terminated other It can be terminated
int LabMapCatchAll (unsinged HandleNo, int CatchAllFlag);
This function is used to control the callbacks for the register HandleNo. The callback subroutine is set using the functions LabMapSetIntCallBack, LabMapSetRealCallBack, LabMapSetStringCallBack. By default the callback subroutine [when enabled see LabMapEnableCallBack, LabMapDisableCallBack] is called only when the new value differs from the old one. This behavior can be changed to catch all value changes. The parameter HandleNo is the register number. The parameter CatchAllFlag indicates the desired behavior. If CatchAllFlag is zero the callback will be called only when the new value differs from the old one. Otherwise it will be called always.
int LabMapCheckBounds (unsinged HandleNo);
This function is used to check the current register value against the bounds set upon the register HandleNo. Upon successful completion the result is the number of an interval of values violated by the current register value. It is the most enclosing (wide) interval if several of them do not contain the value. The result is zero if the current value is within all bounds. Note that newly set bounds are initially violated no matter which value the register has.
int LabMapCreate
(
unsigned * HandleNo,
const char * Name,
const char * Server,
unsigned Status,
unsigned TimeOut,
unsigned Each,
const char * InputUnit,
const char * OutputUnit
);
This function creates a new register. The created register number is returned via the parameter HandleNo. The parameter Name specifies the register name. Note that some hardware interfaces may impose additional requirements on the name appearance. Usually it is a set of parameters in square brackets at the name end. Further, the hardware may support no on-fly register creation. Refer the corresponding hardware interface documentation. The parameter Server specifies the name of the interface that serves the register. The interface is loaded if necessary. The parameter Status contains the desired status bits. The following bits can be used:
Bits group Description HandleInteger, HandleReal, HandleString. These bits specify the register type. Exactly one of these bits shall be set. If no HandleReal bit applied, then the parameters InputUnit and OutputUnit are ignored. HandleInput This bit indicates the register I/O direction. When set, the register is designated for send data operations. In this case the parameter Each is ignored. Otherwise it is a output register, i.e. one designated for request operations. HandleDefaultTimeout, HandleNoTimeout These bits are mutually exclusive. If one of them is set then the parameter TimeOut is ignored. If none of these bits is set the parameter TimeOut specifies the time limit for I/O operations. HandleOnChange, HandleUponRequest These bits determine the register's policy. They are mutually exclusive and cannot be applied when the bit HandleInput is set. The parameter Each limits the frequency the data updates / requests happens. It is ignored if HandleUponRequest is applied. HandleExclusive This bit is set to limit access to the register. HandleInUse When this bit is set, the newly created register will be accessed by the application as if LabMapRegAccess were called immediately after the register creation. This bit is ignored when the bit HandleExclusive is not set. HandleTemp This bit is set to disable register persistence. A persistent register will reappear after the system restart. HandleNewFromRRR This bit is set to enable callbacks for the register immediately after its creation. It has the effect as if LabMapEnableCallBack were called for the register before any I/O operation on it. It is preferable to an explicit call to LabMapEnableCallBack.
The parameter TimeOut specifies the register operation time limit in ms. It is ignored if no specific time limit is used (see above). The parameter Each limits the register I/O frequency (see above). It is specified in ms. The parameters {Input|Output}Unit specify the measurement units of the register. They shall be compatible. Both parameters are ignored (and thus can be zeros) if the created register is not a floating-point one.
int LabMapDeaccess (void);
This function is used to allow other users to access the exclusive registers. The user may lose general access either by calling LabMapDeaccess, or when LabMapAccess is called by a user named 'supervisor', or when LabMapRegAccess is called by another user or when all applications of the user exit. See also: LabMapAccess, LabMapGetOwner, LabMapLogIn.
int LabMapDelete (unsigned HandleNo);
This function deletes the specified register. Persistent registers can be deleted as well.
int LabMapDeleteBounds (unsigned HandleNo, unsigned BoundsNo);
This function is used to remove a pair of value bounds set on the register HandleNo. All value checking bounds set on a register are enumerated from 1. The bounds with greater numbers include ones with lesser numbers, so that all intervals are nested. When BoundsNo is zero all bounds are removed.
int LabMapDisableCallBack (unsinged HandleNo);
This function is used to disable callbacks for the register HandleNo. The callback is set using the functions LabMapSetIntCallBack, LabMapSetRealCallBack, LabMapSetSignalCallBack, LabMapSetStringCallBack. The parameter HandleNo may be given as zero to disable callbacks for all registers. Initially the callbacks are enabled for all registers.
int LabMapDispatcher (void * Event);
This function is called by the LabMap.exe
to initiate processing incoming commands
(see LabMapSendMessage). It is
made once upon start from each of interface DLLs. It allows
interface DLLs to start necessary thread in the context of the LabMap.exe. Usually at least
one thread (so called dispatcher thread) is started to
run endless loop in which it calls the Lab
AcceptMessage
to pick up incoming messages from the command queue. The
parameter Event is a pointer to HANDLE. The LabMapDispatcher returns there the
handle of the dispatcher thread. Then the dispatcher thread will
be notified upon exit (see CmdRRRCloseHandle).
Zero can be used to indicate that no notification upon exit is
necessary.
int LabMapEnableCallBack (unsinged HandleNo);
This function is used to enable callbacks for the register HandleNo. The callback is set using the functions LabMapSetIntCallBack, LabMapSetRealCallBack, LabMapSetSignalCallBack, LabMapSetStringCallBack. The parameter HandleNo may be given as zero to enable callbacks for all registers. Initially the callbacks are enabled for all registers.
int LabMapFindHandle
(
unsigned * HandleNo,
const char * Name,
unsigned Flags,
const char * Server
);
This function searches for the first register with the name matched
by the pattern. The parameter
HandleNo is the pointer to a register number. The searching
process starts from the next register. To start search
from the first register use zero as the initial value. The number of
the first found register is returned via this parameter. If no
register found the value is not changed. ResRRRWrongHandle is returned
as
the result. The parameter Flags controls the name matching
process. It is combination of the following bits:
Bit (symbolic name) Value Description FindRRRCaseSensitive 1 When set, the name matching is case sensitive. Otherwise it is not FindRRRPrefix 2 When set the value of the Name parameter should match the prefix of the register name. Otherwise the whole register name shall be matched. FindRRRMatchParameters 4 When set the register name includes the parameters put in square brackets. When this bit is clean the rest of the name starting with the first appearance of the left square bracket is not counted as a part of the register name.
The parameter Server identifies the name of the interface that should serve a found register. For instance, "Virt" for the virtual registers interface. This parameter can be zero if any interface is acceptable.
int LabMapFirstHandle (void);
This function returns the first available handle number. Note that it is not necessarily declared. See also LabMapLastHandle.
int LabMapGenStatus (unsigned GenStatus);
This function returns the code used for the specified generic status. The register status codes (values) may be changed by the configuration (see). This function allows to get the values of the standard status codes such as "timeout". The parameter GenStatus specifies the status code which value is to returned:
Generic status Code Symbolic value Success (no error) 0 StatusRRRSuccess Illegal register number 1 StatusRRRWrongHandle The register is off-line 2 StatusRRROffLine Operation timed out 3 StatusRRRTimeout The register is not ready 4 StatusRRRNotReady Error 5 StatusRRRError Operation is not available for the register 6 StatusRRRNotAvailable Value constraint error in an upper bound 7 StatusRRRUpperBoundError Value constraint error is a lower bound 8 StatusRRRLowerBoundError
Zero is returned if the status is not undefined.
int LabMapGetBase
(
unsigned HandleNo,
unsigned Index;
unsigned * BaseHandleNo
);
This function is used to enumerate all registers which the registers indicated by HandleNo depends on. Usually only registers of the virtual interface (Virt) are dependent from other registers. The parameter Index is zero-based index. The base registers of a register are enumerated starting with 0. The parameter BaseHandleNo accepts the result. ResRRRNotHandled is returned if there is no more base registers.
int LabMapGetError (unsigned HandleNo, unsigned * Error);
This function requests the extended error code associated with the register specified by the parameter HandleNo. The error code is stored into the variable pointed by the parameter Error. The extended error code is a 4-bytes value.
|
|
|
int LabMapGetErrorText
(
unsigned HandleNo,
char * Text,
int Size
);
This function stores the text describing the register status
into the text buffer. The Size parameter defines the
maximal available space in the text buffer pointed by the
parameter Text. When LabMapGetErrorText
is
called from LabMap.dll it tries to call
the corresponding Lab
GetErrorText
function from the interface responsible for processing the
register. Only if that DLL does not contain this interface
function, it forms the error text by itself. This feature allows
an interface DLL to define error messages according to the
hardware specific.
int LabMapGetIntBounds
(
unsigned HandleNo,
unsigned BoundsNo,
unsigned * OnError,
int * From,
int * To
);
This function is used to get the current register value bounds set on the register HandleNo. All value checking bounds set on a register are enumerated from 1. The parameter BoundsNo specifies which bounds to get. The bounds with greater numbers include ones with lesser numbers, so that all intervals are nested. The parameters OnError, From and To are pointers to the variables accepting the bounds. OnError receives one of the values BoundsRRRPass, BoundsRRRSaturate, BoundsRRRDiscard, BoundsRRRSignal. From is set to the lower bound. To is set to the upper bound.
int LabMapGetInterfaceName
(
unsigned HandleNo,
char * Name,
int Length
);
This function gets the name of the hardware interface serving a register. It stores the interface name (such as "Map", "Virt" etc) with terminating NUL into the buffer pointed by the parameter Name. The parameter Length defines the buffer size. When the buffer is shorter than the name, it is truncated and ResRRRSuspicious is the result.
int LabMapGetInt
(
unsigned HandleNo,
int * Value
);
int LabMapGetIntEx
(
unsigned HandleNo,
int * Value,
unsigned char Stamp [8]
);
These functions get the current value of the integer register specified by the parameter HandleNo. It does not start any operation on the register, just the last value is returned (see also LabMapRequest). Values of both input and output registers may be requested. The parameter Stamp accepts the time stamp of the value. It is warranted that the time stamp corresponds the value. The return code ResRRRSuspicious indicates that the value of the register is not yet defined or the last operation over it was erroneous. Nevertheless the parameter Value is set to the actual register value.
int LabMapGetInUnits
(
unsigned HandleNo,
char * String,
int Length
);
This function places the text describing the input measurement units of a floating-point register. The input measurement units are used for values coming from the software side. The parameter Size defines the maximal available space in the text buffer pointed by the parameter String. See also: LabMapGetOutUnits, LabMapSetUnits.
int LabMapGetName
(
unsigned HandleNo,
char * Name,
int Length
);
This function gets the name of a register. It stores the name with terminating NUL into the buffer pointed by the parameter Name. The parameter Length defines the buffer size. See also LabMapSetName. When the buffer is shorter than the name, it is truncated and ResRRRSuspicious is the result.
int LabMapGetOutUnits
(
unsigned HandleNo,
char * String,
int Length
);
This function places the text describing the output measurement units of a floating-point register. The output measurement units are used for values coming from the hardware side. The parameter Size defines the maximal available space in the text buffer pointed by the parameter String. See also: LabMapGetInUnits, LabMapSetUnits.
int LabMapGetOwner (char * UserName, int Length);
This function returns the name of the user which currently has general access to the exclusive registers. The name is returned into the text buffer pointed by the parameter UserName. The size of the buffer is specified by the parameter Length. When nobody has access, empty string is returned. See also: LabMapAccess, LabMapDeaccess, LabMapLogIn.
int LabMapGetRealBounds
(
unsigned HandleNo,
unsigned BoundsNo,
unsigned * OnError,
float * From,
float * To
);
int LabMapGetRealSIBounds
(
unsigned HandleNo,
unsigned BoundsNo,
unsigned * OnError,
float * From,
float * To
);
This function is used to get the current register value bounds set on the register HandleNo. All value checking bounds set on a register are enumerated from 1. The parameter BoundsNo specifies which bounds to get. The bounds with greater numbers include ones with lesser numbers, so that all intervals are nested. The parameters OnError, From and To are pointers to the variables accepting the bounds. OnError receives one of the values BoundsRRRPass, BoundsRRRSaturate, BoundsRRRDiscard, BoundsRRRSignal. From is set to the lower bound. To is set to the upper bound. The bounds are returned in the current input units in case of LabMapGetRealBounds or in SI units for LabMapGetRealSIBounds.
int LabMapGetReal
(
unsigned HandleNo,
float * Value
);
int LabMapGetRealEx
(
unsigned HandleNo,
float * Value,
unsigned char Stamp [8]
);
int LabMapGetRealSI
(
unsigned HandleNo,
float * Value
);
int LabMapGetRealSIEx
(
unsigned HandleNo,
float * Value,
unsigned char Stamp [8]
);
These functions get the current value of the floating-point register specified by the parameter HandleNo. It does not start any operation on the register, just the last value is returned (see also LabMapRequest). Values of both input and output registers may be requested. The returned value is converted from the output measurement units to either input (LabMapGetReal) or SI units (LabMapGetRealSI). See also: LabMapSetUnits. The parameter Stamp accepts the time stamp of the value. It is warrantied that the time stamp corresponds the value. The return code ResRRRSuspicious indicates that the value of the register is not yet defined or the last operation over it was erroneous. Nevertheless the parameter Value is set to the actual register value.
int LabMapGetSequenceNo
(
unsigned HandleNo,
unsigned * SequenceNo
);
This function provides a simple way to determine whether the value of a register was set. Each value set into the register has an unique 32-bit number. It repeats only after the value was set 232 times. An application may detect value change by comparing the current value of the function returns via the parameter SequenceNo with the previous one. Note that the sequence number of a register is changed even if the same value with the same time stamp is set. The return code ResRRRSuspicious indicates that the value of the register is not yet defined or the last operation over the register was erroneous.
int LabMapGetStatistics
(
unsigned * SendBufferUse,
unsigned * ReceiveBufferUse,
unsigned * SendSpeed,
unsigned * ReceiveSpeed
);
This function returns some statistical data. The monitor thread periodically calls this function on the LabMap.exe's context so that the interface DLLs might use it for some sort of slow polling. The returned data are SendBufferUse and ReceiveBufferUse in % (0..100), SendSpeed and ReceiveSpeed in bytes/s.
int LabMapGetStatus (unsigned HandleNo, int Clean);
This function returns the status of a register. It does not initiate any I/O. The parameter HandleNo is the number of the register. It must not be necessarily declared but should be in the range of the values returned by functions LabMapFirstHandle and LabMapLastHandle. The return value is negative if the handle number is wrong. Otherwise it looks as follows:
| Bits | Symbolic name | Description | ||
| 000000FF16 | HandleRRRStatus | Mask of the status code of the last operation with the handle. The status code is usually specific to the interface, however there are predefined status codes common for all devices. The function LabMapGenStatus is used to obtain these codes. | ||
| FFFFF00016 | HandleStateMask | Mask of the other state bits | ||
| 0000100016 | HandleDefaultTimeout | The default time out is used (otherwise, the handle specific time out is used) | ||
| 0000200016 | HandleError | The last operation on the register failed | ||
| 0000400016 | HandleInRecord | The handle is member of a record | ||
| 0000800016 | HandleInUse | The handle is in use. Each known, registered handle has this bit set. If this bit is clean the state of other bits is undefined | ||
| 0001000016 | HandleInput | An input register, i.e. one which value is sent to the hardware. Otherwise the register is an output one | ||
| 0002000016 | HandleInteger | The value of the register is of integer type | ||
| 0004000016 | HandleNewFromRRR | The state of the register was changed since the last
operation. LabMap® always sets this
bit when a response related to the register comes from the hardware or
its value is modified. The function LabMapGetStatus
cleans this bit if the parameter Clean is not zero. It allows
an application to poll the handle state.
|
||
| 0008000016 | HandleOnChange | The register's value is automatically sent by the hardware when the value is changed. This bit has no sense for input registers | ||
| 0010000016 | HandlePending | An operation on the register is in progress. On its completion either HandleReady or HandleError bit will be set | ||
| 0020000016 | HandleReady | The last operation on the register was successful | ||
| 0040000016 | HandleReal | The value of the register is of floating point type | ||
| 0080000016 | HandleRecord | A record register | ||
| 0100000016 | HandleString | The value of the register is of string type | ||
| 0200000016 | HandleUndefined | The register's state is undefined because no operation on it was yet executed | ||
| 0400000016 | HandleUponRequest | The value is not automatically sent by the hardware. This bit has no sense for input handles. When neither this nor HandleOnChange is set the handle is sent cyclically each n ms | ||
| 0800000016 | HandleExclusive | The register is accessed exclusively | ||
| 1000000016 | HandleNoTimeout | No timeout. All operations over the handle are not time limited | ||
| 0000080016 | HandleTemp | The register is temporal. Otherwise, the register is persistent |
Note that this function requires register access when the parameter Clean is not zero and the bit HandleNewFromRRR has to be reset.
int LabMapGetStringBounds
(
unsigned HandleNo,
unsigned BoundsNo,
unsigned * OnError,
unsigned * From,
unsigned * To
);
This function is used to get the current register value bounds set on the register HandleNo. For a string register bounds determine the value length. All bounds set on a register are enumerated from 1. The parameter BoundsNo specifies which bounds to get. The bounds with greater numbers include ones with lesser numbers, so that all intervals are nested. The parameters OnError, From and To are pointers to the variables accepting the bounds. OnError receives one of the values BoundsRRRPass, BoundsRRRSaturate, BoundsRRRDiscard, BoundsRRRSignal. From is set to the lower bound. To is set to the upper bound.
int LabMapGetString
(
unsigned HandleNo,
char * Value,
int * Length
);
int LabMapGetStringEx
(
unsigned HandleNo,
char * Value,
int * Length,
unsigned char Stamp [8]
);
These functions get the current value of the string register specified by the parameter HandleNo . It does not start any operation on the register, just the last value is returned (see also LabMapRequest). Values of both input and output registers may be requested. The parameter Length specifies the maximal size of the buffer pointed by the parameter Value. This includes the NUL-byte which is always added to the end, however the string may contain any symbols including the NUL. The string may be truncated to fit the size of Value. The actual string length is returned into the parameter Length (added terminating NUL is not counted). The parameter Stamp accepts the time stamp of the value. It is warranted that the time stamp corresponds the value. The return code ResRRRSuspicious indicates that the value of the register is not yet defined or the last operation over it was erroneous. Nevertheless the parameter Value is set to the actual register value.
unsigned LabMapGetStringLength
(
unsigned HandleNo
);
This function returns the value length of a string register. The string length does not include the terminating NUL. Thus a consequent call to LabMapGetString should provide a buffer, which is one character larger. The parameter HandleNo is the register number. The result is 0 if the register is not in use or not string.
int LabMapGetTimeStamp
(
unsigned HandleNo,
unsigned char Stamp [8]
);
This function gets the time stamp of a register, i.e. the time its value has been modified. The time stamp is changed even if the value of the register is not altered, but simply rewritten. The parameter Stamp is a 64-bit unsigned integer representing the number of 100-nanoseconds intervals since 1 January 1601 in coordinated universal time (UTC). The representation corresponds to the FILETIME structure of the Windows operating system. It is not recommended to use arithmetic operations on time stamps. Instead, you should use Windows API. The return code ResRRRSuspicious indicates that the value of the register is not yet defined or the last operation over the register was erroneous.
|
|
|
unsigned LabMapGetUnitMessage (unsigned WindowMessage);
This function can be used in a window procedure to deal with messages sent from a unit configuration subdialog: It returns an WM_RRRx value corresponding to the parameter WindowMessage. The result is 0, when there is no such value, i.e. when the specified Windows message is not used for unit configuration. The following sample code illustrates usage:
BOOL CALLBACK Proc (HWND Window, UINT Message, ...)
{
switch (Message)
{
case WM_CLOSE :
... // Processing normal window messages
default : // All other messages
switch (LabMapGetUnitMessage (Message))
{
case WM_RRRFinalize : // Config closed
...
case WM_RRRModified : // Config modified
...
default :
break;
}
return 0;
int LabMapGetVersion
(
char Version [25]
);
This function stores the build time of the LabMap.dll into the string specified by the Version parameter. The string is null-terminated 25 characters long. The build time has the following format Thu Feb 03 15:45:56 2000.
int LabMapGetWaitCount
(
unsigned HandleNo,
unsigned * Count
);
This function retrieves the number of tasks currently waiting for register I/O completion (see LabMapWait). The parameter Count accepts the result.
4.44. LabMapGetWaitForUpdateCount
int LabMapGetWaitForUpdateCount
(
unsigned HandleNo,
unsigned * Count
);
This function retrieves the number of tasks currently waiting for register value update (see LabMapWaitForUpdate). The parameter Count accepts the result.
unsigned LabMapGetWindowMessage (unsigned UnitMessage);
This function gets the Windows message by its symbolic WM_RRRx value (see LabMapUnitConfig and LabMapRegConfig). The result is 0 if UnitMessage is illegal.
int LabMapLastHandle (void);
This function returns the last available handle number. Usually, but not necessarily, it is the last declared handle. One can use the result of this function as the upper margin of an iterator over all handles. Note also, that two calls to the function may deliver different results, when the operator declares a new handle between the calls. See also LabMapFirstHandle.
RECT LabMapLeftOf (void);
This function returns a pointer to the rectangle corresponding the area left of the window subclassed by LabMapUnitConfig. When specified there it causes the parent window to be extended leftwards with unit configuration controls.
int LabMapLogEvent
(
unsigned HandleNo,
const char * Message
);
This function writes a message into the event log. The handle number is reported when not zero. The time stamp is automatically added to the message. The interface field is set according to the DLL the function is called from.
int LabMapLogIn (const char * UserName);
This function should be called before all others to register an application using LabMap®. The access to the exclusive registers is user-based. Only one user may access the exclusive registers for update. Several applications may represent the same user. To gain access to the exclusive registers an application representing the user has to call LabMapAccess. No other application associated with any other user will be able to gain access until LabMapDeaccess is called or all applications associated with the user exit. Two users are predefined. They are "nobody" and "supervisor". An application is automatically assigned to the user "nobody" till LabMapLogIn is called. The user "supervisor" always has a back-door access to the registers. It may also gain access explicitly by force. This allows to deprive a user of access. For this, a "supervisor" application calls LabMapAccess and then LabMapDeaccess, which will have the effect that no application will have access to the exclusive registers. See also: LabMapAccess, LabMapDeaccess, LabMapGetOwner.
int LabMapRaise
(
unsigned HandleNo,
unsigned Signal
);
int LabMapRaiseEx
(
unsigned HandleNo,
unsigned Signal,
const unsigned char Stamp [8]
);
These functions raises a signal (the parameter Signal) for the register HandleNo. The parameter Stamp contains the time stamp of the value.
There are HandleRRRStatus + 1 predefined signals used by the system. The signal 0 is raised when a virtual register is evaluated but the evaluation produces no result. The signals 1..HandleRRRStatus are raised when an error occurs (see LabMapSetError). The signal number is equal to the error status code.
int LabMapRegAccess (unsigned HandleNo);
This function is used to gain explicit access to the exclusively accessed register specified by the parameter HandleNo. The operation fails when some other user already has the access. See also: LabMapRegDeaccess, LabMapRegGetOwner, LabMapLogIn.
int LabMapRegConfig
(
unsigned HandleNo,
HWND Parent,
const RECT * Area,
const char * Unit
);
This function is used to subclass the window specified by the parameter Parent with the controls of a register configuration dialog. The register to configure is specified by the parameter HandleNo. The controls of the configuration subdialog are added to the parent window. The window size is changed if necessary and its controls are moved to give place to the new controls. Windows messages are used for further communication with the unit configuration subdialog. Once configuration is completed the parent window appearance is restored. Note that not all interfaces support device units or register configuration. The parameter Unit is optional. It specifies the unit name of the register if it cannot be determined otherwise. Unit can be 0 or contain an empty string. The parameter Area points to a rectangle in Parent's client area co-ordinates where the configuration subdialog has to be shown. If the area is not big enough, it is enlarged as necessary. This causes Parent window to be resized and its controls right and bottom of the area to be moved. The functions LabMapBottomOf, LabMapLeftOf, LabMapRightOf, LabMapTopOf return pointers to the special rectangle values used to extend Parent window across one of its margins. When Area is 0, the whole client area of Parent is used. Upon successful completion of LabMapRegConfig, the process of subclassing is engaged. Parent is notified about any further faults (and events) through the Windows messaging mechanism. The following table summarizes the messages sent to Parent upon notification events and to control the configuration subdialog:
| Notification | WPARAM | LPARAM | Message is sent to parent upon ... | ||||||||||
| WM_RRRFinalize | Error | - | This message is sent on closing of the unit configuration subdialog.
WParam contains the error code:
|
||||||||||
| WM_RRRModified | 0 or 1 | - | This message is sent when either the register configuration controls are changed or when changes made are committed. In the former case WPARAM is 1, in the latter case it is 0. | ||||||||||
| WM_RRRRegName | - | register name | This message is sent to notify successfully committed changes made. Committing has no other effect on the register than posting this and WM_RRRModified messages. To actually change the register configuration, the application has to call LabMapSetName with the name obtained from this message. | ||||||||||
| WM_RRRRegType | - | register type | This message is sent to notify about the name of the register's type. The register type is specific to the interface. | ||||||||||
| WM_RRRUnitName | - | unit name | This message is sent to notify about the name of the register's device unit. | ||||||||||
| Command | WPARAM | LPARAM | Message is sent to parent for ... | ||||||||||
| WM_RRRChange | subunit number | unit name | This message is sent to the parent window to change either the subunit selected or the unit name or both. WPARAM if not zero indicates the subunit to select (1..). LPARAM if not zero specifies the new unit name. If unit name is changed then committing changes will rename the device unit. Note that this message itself does not commit anything. | ||||||||||
| WM_RRRClose | - | - | This message is sent to drop the configuration subdialog. Parent is returned to its original state. | ||||||||||
| WM_RRRCommit | buffer length | message buffer | This message commits all changes made. Observe that this has no other effect than checking the register configuration. Upon success this message returns 0. If it fails the result is 1 and the message buffer contains error description. WPARAM specifies the message buffer length (including terminating NUL). LPARAM is the message buffer pointer. When WPARAM is 0, LPARAM is ignored. Before WM_RRRCommit returns 0 (success) it posts WM_RRRRegName to Parent with the full register name reflecting the changes made. The application may use LabMapSetName to apply the changes to the register. |
The messages codes specified in the table above are not constant, but registered windows messages. To get the actual Window message code one should use LabMapGetWindowMessage:
LabMapGetWindowMessage (WM_RRRClose)
The parent window procedure automatically routes command messages to the configuration subdialog, so there is no need to care about them. LabMapRegConfig returns ResRRRBusy if a register configuration is already active. It returns ResRRRAccessDenied if the application has no access to the register.
See also LabMapUnitConfig for unit configuration.
int LabMapRegDeaccess (unsigned HandleNo);
This function is used to allow other users to access the exclusive register specified by the parameter HandleNo. The user may loose explicit access either by calling LabMapRegDeaccess, or when LabMapRegAccess is called by a user named "supervisor", or when all applications of the user exit. See also: LabMapRegAccess, LabMapRegGetOwner, LabMapLogIn.
int LabMapRegGetOwner
(
unsigned HandleNo,
char * UserName,
int Length
);
This function returns the name of the user which currently has access to the exclusive registers. The name is returned into the text buffer pointed by the parameter UserName. The size of the buffer is specified by the parameter Length. When nobody has access, empty string is returned. See also: LabMapRegAccess, LabMapRegDeaccess, LabMapLogIn.
int LabMapRequest (unsigned HandleNo);
This function requests the value of a register. It initiates an I/O to request the actual register value from the hardware. However it does not wait for I/O completion (see LabMapWait).
RECT LabMapRightOf (void);
This function returns a pointer to the rectangle corresponding the area right of the window subclassed by LabMapUnitConfig. When specified there it causes the parent window to be extended rightwards with unit configuration controls.
int LabMapSend (unsigned HandleNo);
This function sends the actual value to the hardware. It initiates an I/O to send the the new value to the hardware. However it does not wait for I/O completion. See also LabMapSendInt, LabMapSendReal, LabMapSendRealSI, LabMapSendString, LabMapWait, LabMapWaitForUpdate.
int LabMapSendInt (unsigned HandleNo, int Value);
This function sends the value provided by the parameter Value to the hardware. It initiates an I/O to send the new value to the hardware. However it does not wait for I/O completion. See also LabMapSend, LabMapSendReal, LabMapSendRealSI, LabMapSendString, LabMapWait, LabMapWaitForUpdate.
int LabMapSendMessage
(
unsigned char Command,
unsigned HandleNo,
void * Data,
int Size
);
This function sends a message to the interface associated with the DLL it is called from. The message is placed into the queue of the interface. So LabMapSendMessage sends a message to the interface implemented by LabMap.dll , while LabMapSendMessage sends a message to LabMap.dll. User are discouraged from using this function without clear understanding of what they are doing.
int LabMapSendReal (unsigned HandleNo, float Value);
int LabMapSendRealSI (unsigned HandleNo, float Value);
These functions send the value provided by the parameter Value to the hardware. The value is converted to the output measurement units from either the input measurement units (LabMapSendReal) or the SI units (LabMapSendSI). It initiates an I/O to send the the new value to the hardware. However it does not wait for I/O completion. See also LabMapSend, LabMapSendInt, LabMapSendString, LabMapSetUnits, LabMapWait, LabMapWaitForUpdate.
int LabMapSendString
(
unsigned HandleNo,
const char * Value,
int Length
);
This function sends the value pointed by the parameter Value to the hardware. The string may contain NUL characters. The parameter Length defines the length of the string. It initiates an I/O to send the the new value to the hardware. However it does not wait for I/O completion. See also LabMapSend, LabMapSendInt, LabMapSendReal, LabMapSendRealSI, LabMapWait, LabMapWaitForUpdate.
int LabMapSetBits
(
unsigned HandleNo,
unsigned CleanMask,
unsigned SetMask,
unsigned ToggleMask,
);
int LabMapSetBitsEx
(
unsigned HandleNo,
unsigned CleanMask,
unsigned SetMask,
unsigned ToggleMask,
const unsigned char Stamp [8]
);
These functions perform a bit wise operation upon an integer register. The following sequence of operations is atomically applied to the register value:
Value := Value and not CleanMask
Value := Value or SetMask
Value := Value xor ToggleMask
The combination of the three masks allows to implement all possible dyadic Boolean operations. Most important instances are:
Operation CleanMask SetMask ToggleMask Value or X 0 X 0 Value and X not X 0 0 Value xor X 0 0 X not Value 0 0 FFFFFFFF16
int LabMapSetError
(
unsigned HandleNo,
unsigned Status,
unsigned Error
);
int LabMapSetErrorEx
(
unsigned HandleNo,
unsigned Status,
unsigned Error,
const unsigned char Stamp [8]
);
These functions modify the status of a register. It should be used by interface handlers only. The function is used to report an error status of the register as well as successful operation completion when the register value remains unchanged. See also LabMapSetInt, LabMapSetReal, LabMapSetRealSI, LabMapSetString. The parameter Stamp contains the time stamp to be set for the register.
int LabMapSetIntBounds
(
unsigned HandleNo,
unsigned OnError,
int From,
int To
);
This function is used to apply bounds checks to the register HandleNo. The parameter OnError is one of the values BoundsRRRPass, BoundsRRRSaturate, BoundsRRRDiscard, BoundsRRRSignal. It determines how bounds violation has to be responded. The parameters From..To define the values interval. It is allowed to apply many intervals to the same register under the restriction that all intervals are nested. Bounds can be removed using the function LabMapDeleteBounds. Note that no bounds can be set on any of the virtual registers handled by LabMap.dll (see).
int LabMapSetInt
(
unsigned HandleNo,
int Value
);
int LabMapSetIntEx
(
unsigned HandleNo,
int Value,
const unsigned char Stamp [8]
);
These functions set the value provided by the parameter Value. It has the same effect as if the value would come from the hardware. So it also completes a pending I/O operation if any. The parameter Stamp contains the time stamp of the value.
int LabMapSetIntCallBack
(
LabMapIntCallBack * CallBack
);
This function sets the call back subroutine to process changes of the integer registers values. The call back is called each time the value of an integer register is changed (i.e. differs from the previous one. See also LabMapCatchAll). The callback shall have __stdcall call conventions and the following parameter profile:
void LabMapIntCallBack
(
unsigned HandleNo,
int Value,
const unsigned char Stamp [8],
int Overrun
);
The parameter HandleNo is the number of the register which value was changed. The parameter Value is the new value of the register. The parameter Overrun indicates when set that an unknown number of register values modifications were lost. The parameter Stamp contains the time stamp of the value. The parameter CallBack can be specified as zero to indicate that no call back is set. See also LabMapEnableCallBack and LabMapDisableCallBack.
int LabMapSetName
(
unsigned HandleNo,
const char * Name
);
This function sets a new name for the specified register. See also LabMapGetName.
|
|
Setting a new name for a register has the effect of restarting the register via the interface responsible for its handling. For this the messages CmdRRRStopHandle and CmdRRRStartHandle are sent to the interface. What a particular interface does upon receiving these messages is up to the interface. Note also that the register name may have some special meaning for the interface. Usually it should end with some interface specific parameters in the square brackets. Refer to the interface documentation for more information. |
int LabMapSetRealBounds
(
unsigned HandleNo,
unsigned OnError,
float From,
float To
);
int LabMapSetRealSIBounds
(
unsigned HandleNo,
unsigned OnError,
float From,
float To
);
This function is used to apply bounds checks to the register HandleNo. The parameter OnError is one of the values BoundsRRRPass, BoundsRRRSaturate, BoundsRRRDiscard, BoundsRRRSignal. It determines how bounds violation has to be responded. The parameters From..To define the values interval. It is allowed to apply many intervals to the same register under the restriction that all intervals are nested. In the function LabMapSetRealBounds the parameters From and To are specified in the current input units. In the function LabMapSetRealSIBounds they are in SI units. Bounds can be removed using the function LabMapDeleteBounds.
int LabMapSetReal
(
unsigned HandleNo,
float Value
);
int LabMapSetRealEx
(
unsigned HandleNo,
float Value,
const unsigned char Stamp [8]
);
int LabMapSetRealSI
(
unsigned HandleNo,
float Value
);
int LabMapSetRealSIEx
(
unsigned HandleNo,
float Value,
const unsigned char Stamp [8]
);
These function set the value provided by the parameter Value. It has the same effect as if the value would come from the hardware. So it also completes a pending I/O operation if any. The value is converted to the output measurement units from either the input measurement units (LabMapSetReal) or the SI units (LabMapSetRealSI). See also LabMapSetUnits. The parameter Stamp contains the time stamp of the value.
int LabMapSetRealCallBack
(
LabMapRealCallBack * CallBack,
int InInputUnits
);
This function sets the call back subroutine to process changes of the floating-point registers values. The call back is called each time the value of a floating-point register is changed (i.e. differs from the previous one. See also LabMapCatchAll). The callback shall have __stdcall call conventions and the following parameter profile:
void LabMapRealCallBack
(
unsigned HandleNo,
float Value,
const unsigned char Stamp [8],
int Overrun
);
The parameter HandleNo is the number of the register which value was changed. The parameter Value is the new value of the register. The parameter Stamp contains the time stamp of the value. The parameter Overrun indicates when set that an unknown number of register values modifications were lost. The parameter CallBack can be specified as zero to indicate that no call back is set. The parameter InInputUnits indicates, when set, that the callback receives the value in the input units. Otherwise SI units are used.
int LabMapSetSignalCallBack
(
LabMapSignalCallBack * CallBack
);
This function sets the call back subroutine to process signals for a register. The call back is called each time a signal is raised. The callback shall have __stdcall call conventions and the following parameter profile:
void LabMapSignalCallBack
(
unsigned HandleNo,
unsigned Signal,
const unsigned char Stamp [8],
int Overrun
);
The parameter HandleNo is the number of the register which value was changed. The parameter Signal is the signal number. The parameter Overrun indicates when set that an unknown number of register values modifications were lost. The parameter Stamp contains the time stamp of the value. The parameter CallBack can be specified as zero to indicate that no call back is set. See also LabMapEnableCallBack and LabMapDisableCallBack.
int LabMapSetStringBounds
(
unsigned HandleNo,
unsigned OnError,
unsigned From,
unsigned To
);
This function is used to apply bounds checks to the register HandleNo. The parameter OnError is one of the values BoundsRRRPass, BoundsRRRSaturate, BoundsRRRDiscard, BoundsRRRSignal. It determines how bounds violation has to be responded. The parameters From..To define the interval of value lengths. It is allowed to apply many intervals to the same register under the restriction that all intervals are nested. Bounds can be removed using the function LabMapDeleteBounds. Note that no bounds can be set on any of the virtual registers handled by LabMap.dll (see).
int LabMapSetString
(
unsigned HandleNo,
const char * Value,
int Length
);
int LabMapSetStringEx
(
unsigned HandleNo,
const char * Value,
int Length,
const unsigned char Stamp [8]
);
These functions set the value pointed by the parameter Value. The string may contain NUL characters. The parameter Length defines the length of the string. It has the same effect as if the value would come from the hardware. So it also completes a pending I/O operation if any. The parameter Stamp parameter contains the time stamp of the value.
int LabMapSetStringCallBack
(
LabMapStringCallBack * CallBack
);
This function sets the call back subroutine to process changes of the string registers values. The call back is called each time the value of a string register is changed (i.e. differs from the previous one. See also LabMapCatchAll). The call back shall have __stdcall call conventions and the following parameter profile:
void LabMapStringCallBack
(
unsigned HandleNo,
const char * Value,
unsigned Length,
const unsigned char Stamp [8],
int Overrun
);
The parameter HandleNo is the number of the register which value was changed. The parameter Value is the new value of the register. The parameter Length is the new value length. The parameter Stamp parameter contains the time stamp of the value. The parameter Overrun indicates when set that an unknown number of register values modifications were lost. The parameter CallBack can be specified as zero to indicate that no call back is set. See also LabMapEnableCallBack and LabMapDisableCallBack.
int LabMapSetTimeOut (unsigned HandleNo, int TimeOut);
This function sets timeout for all operations on the register specified by parameter HandleNo. The time out is specified by the parameter TimeOut in ms. Zero value cause the default timeout to be used. A negative value indicates that the operations over the handle are not limited in time.
int LabMapSetUnits
(
unsigned HandleNo,
const char * Input,
const char * Output
);
This function changes the measurement units of a floating-point register. The parameter Input is the pointer to the string containing the input measurement units. The parameter Output is the pointer to the string of output measurement units. Both strings must be matched completely, otherwise an error reported. Input and output units must be convertible. When a parameter Input or Output is specified as zero, the corresponding unit of the register is not changed. The input measurement units are used when the value comes from or goes to the software side. Applications using the LabMap® are working with the input units when they use LabMapGetReal, LabMapSendReal, LabMapSetReal interface functions. They may also request the values in SI units via LabMapGetRealSI, LabMapSendRealSI, LabMapSetRealSI interface functions. The output measurement units are used for communication with the hardware. See also LabMapGetInUnits, LabMapGetOutUnits.
RECT LabMapTopOf (void);
This function returns a pointer to the rectangle corresponding the area top of the window subclassed by LabMapUnitConfig. When specified there it causes the parent window to be extended topwards with unit configuration controls.
int LabMapUnitConfig
(
const char * Class,
const char * Unit,
HWND Parent,
const RECT * Area
);
This function is used to subclass the window specified by the parameter Parent with the controls of a device unit configuration dialog. The controls of the configuration subdialog are added to the parent window. The window size is changed if necessary and its controls are moved to give place to the new controls. Windows messages are used for further communication with the unit configuration subdialog. Once configuration is completed the parent window appearance is restored. The parameter Class specifies the interface handling the unit. It can be a not yet loaded interface, in which case it is loaded first. The parameter Unit is the name of the device unit. Note that not all interfaces support device units or configuration. The parameter Unit can be 0 or contain an empty string to indicate that a new unit has to be created. The parameter Area points to a rectangle in Parent's client area co-ordinates where the configuration subdialog has to be shown. If the area is not big enough, it is enlarged as necessary. This causes Parent window to be resized and its controls right and bottom of the area to be moved. The functions LabMapBottomOf, LabMapLeftOf, LabMapRightOf, LabMapTopOf return pointers to the special rectangle values used to extend Parent window across one of its margins. When Area is 0, the whole client area of Parent is used. Upon successful completion of LabMapUnitConfig, the process of subclassing is engaged. Parent is notified about any further faults (and events) through the Windows messaging mechanism. The following table summarizes the messages sent to Parent upon notification events and to control the configuration subdialog:
| Notification | WPARAM | LPARAM | Message is sent to parent upon ... | ||||||||||||
| WM_RRRFinalize | Error | - | This message is sent on closing of the unit configuration subdialog.
WParam contains the error code:
|
||||||||||||
| WM_RRRModified | 0 or 1 | - | This message is sent when either the unit configuration controls are changed or when changes made are committed. In the former case WPARAM is 1, in the latter case it is 0. | ||||||||||||
| WM_RRRSubunit |
This message is used to inform about subunits the unit has. Each time a the list or selection there is modified a sequence of WM_RRRSubunit is sent. It starts with WPARAM = 0 and ends with one with LPARAM = 0: |
||||||||||||||
| 0 | total number of subunits | The first message of the sequence specifies the total number of subunits. If the number is 0, then the unit has no subunits and further messages are not sent. | |||||||||||||
| subunit number | subunit name | For each subunit this message is sent in the order of subunits number. WPARAM specifies the subunit number 1... LPARAM is the pointer to the subunit name | |||||||||||||
| subunit number | 0 | The last message of the sequence. WPARAM specifies the subunit selected | |||||||||||||
| WM_RRRUnitName | - | unit name | This message is sent to notify about the device unit name. Normally it is one specified by the parameter Unit. | ||||||||||||
| Command | WPARAM | LPARAM | Message is sent to parent for ... | ||||||||||||
| WM_RRRChange | subunit number | unit name | This message is sent to the parent window to change either the subunit selected or the unit name or both. WPARAM if not zero indicates the subunit to select (1..). LPARAM if not zero specifies the new unit name. If unit name is changed then committing changes will rename the device unit. Note that this message itself does not commit anything. | ||||||||||||
| WM_RRRClose | - | - | This message is sent to drop the configuration subdialog. Any not committed changes are ignored. Parent is returned to its original state. | ||||||||||||
| WM_RRRCommit | buffer length | message buffer | This message commits all changes made. Observe that this has the effect of unit restart. So all registers served by the device unit will be stopped and then started again. Upon success this message returns 0. If fails the result is 1 and the message buffer contains error description. WPARAM specifies the message buffer length (including terminating NUL). LPARAM is the message buffer pointer. When WPARAM is 0, LPARAM is ignored. | ||||||||||||
The messages codes specified in the table above are not constant, but registered windows messages. To get the actual Window message code one should use LabMapGetWindowMessage:
LabMapGetWindowMessage (WM_RRRClose)
The parent window procedure automatically routes command messages to the configuration subdialog, so there is no need to care about them. LabMapUnitConfig returns ResRRRBusy if a unit device configuration is already active. It returns ResRRRAccessDenied if the application has no general access.
See also LabMapRegConfig for unit register configuration.
int LabMapWait (unsigned HandleNo);
This function waits for the completion of an operation on the register specified by parameter HandleNo. It immediately returns if no operation on the register is pending. Waiting does not consume CPU time. Arbitrary number of threads may wait for arbitrary set of registers.
int LabMapWaitEx (unsigned HandleNo, unsigned TimeOut);
This function waits for the completion of an operation on the register specified by parameter HandleNo. It immediately returns if no operation on the register is pending. Waiting does not consume CPU time. Arbitrary number of threads may wait for arbitrary set of registers. The parameter TimeOut (in ms) limits the time of waiting. If the time limit is expired before operation completion LabMapWaitEx returns ResRRRTimedOut.
int LabMapWaitForUpdate
(
const unsigned * HandleList,
int Count
);
This function waits for update of any of the registers from the list pointed by the parameter HandleList . Each element of the list is a register handle. The length of the list is defined by the Count parameter. The function returns when either value of at least one of the listed registers is changed or an error occurs during any operation upon a listed register. Waiting does not consume CPU time. Arbitrary number of threads may wait for arbitrary set of registers.
|
|
Do not expect that sequential calls to LabMapWaitForUpdate will catch all modification events upon a register. The thread issuing LabMapWaitForUpdate might be preempted before it enters waiting. Being preempted it may loose a register modification. See also LabMapSetIntCallBack, LabMapSetRealCallBack, LabMapSetStringCallBack which are able to catch all register modifications. |
int LabMapWaitForUpdateEx
(
const unsigned * HandleList,
int Count,
unsigned TimeOut
);
This function waits for update of any of the registers from the list pointed by the parameter HandleList. Each element of the list is a register handle. The length of the list is defined by the parameter Count. The function returns when either value of at least one of the listed registers is changed or an error occurs during any operation upon a listed register. Waiting does not consume CPU time. Arbitrary number of threads may wait for arbitrary set of registers. The parameter TimeOut (in ms) limits the time of waiting. If the time limit is expired before operation completion LabMapWaitForUpdateEx returns ResRRRTimedOut.
|
|
Do not expect that sequential calls to LabMapWaitForUpdateEx will catch all modification events upon a register. The thread issuing LabMapWaitForUpdate might be preempted before it enters waiting. Being preempted it may loose a register modification. See also LabMapSetIntCallBack, LabMapSetRealCallBack, LabMapSetStringCallBack which are able to catch all register modifications. |
int LabMapWatch
(
unsigned HandleNo,
int X,
int Y
);
This function is used to pop up the register watch panel. The parameter HandleNo is the register number. The parameters X and Y are the panel coordinates when it is created. If the panel already exists, the coordinates are ignored. The coordinates can be specified negative, in which case the panel is closed if it exists.
The configuration data for LabMap® are stored in the windows registry. The location and contents of the registry folder is determined upon start as described follows:
The format of the configuration file is similar to one of the registry. The file consists of key-value pairs:
| -- This is a comment reset = "HKEY_CURRENT_USER\\Software\\LabMap\\Config" AutoExit = 0 ConsoleX = -1 ConsoleY = -1 . . . |
The key-value pair has the syntax:
<Name>=<Value>
Here <Value> is either a string or signed integer. The key name should be put in double quotation marks if it contains spaces. The string values are always in double quotation marks. Within the quotation marks the standard C++ escape sequences are recognized:
| Sequence | Code | Sequence | Code |
| \a | Bell (0716) | \' | Single quotation mark |
| \b | Backspace (0816) | \" | Double quotation mark |
| \f | Formfeed (0C16) | \\ | Backslash |
| \n | New line (0A16) | \? | Literal question mark |
| \r | Carriage return (0D16) | \0oo | Octal ASCII character code 0oo (000...0778) |
| \t | Horizontal tab (0916) | \1oo | Octal ASCII character code 1oo (100..1778) |
| \v | Vertical tab (0B16) | \xhh | Hexadecimal ASCII character code hh (00..FF16) |
The file may contain comments start with --, # or ;. A comment continues to the end of the source line.
The first line of this file determines the registry disposition. It has the syntax of a registry key. Though the value itself is never stored in the registry. The value specifies the registry folder. It can start with HKEY_LOCAL_MACHINE (this is the default) or with HKEY_CURRENT_USER. The rest of the value is name of the folder. The key name can be one of the following (case insensitive):
| Key | Disposition |
| initialize | The specified by the value registry folder is initialized from the file, if it does not already exist. In the latter case the file contents is ignored |
| reset | The registry folder is replaced by the file contents |
| share | The registry folder is replaced by the file contents and upon LabMap® completion is stored back into this file. Thus the contents of the file reflects the last configuration of LabMap® |
| take | The rest of the file is ignored. Upon LabMap® completion the registry folder is stored into this file |
| use | The specified registry folder is used and the rest of the file is ignored |
The following table describes the most important keys:
| Key name | Value | Description | |||||||||||||||
| AK.IgnoreAKErrors | 0 | When set to 1 the general error code in AK responses is ignored. Otherwise it is used to generate the error status of the corresponding register. This is the default behavior. The AK error code is set into the field HandleRRRStatus. | |||||||||||||||
| AutoExit | 0 | Being set to 1 this parameter causes the LabMap.exe exit if no application communicates with it. By default the LabMap.exe remains active so that there is no necessity to restart it when an application starts | |||||||||||||||
| ClockKeeper.ResyncPeriod | 10000 | This is the period of time in ms in which the clock keeper thread resynchronizes the system ticks with the system clock. System ticks have very high resolution, usually more than 3 ticks per µs, but have no bias to any time. The system clock is very inaccurate. LabMap® translates ticks to clock reading to achieve best possible accuracy of time stamps. This is a statistical procedure performed periodically by the clock keeper thread. By default, it is done each 10s. | |||||||||||||||
| Enable | 0 | Unlike other parameters this one is read each time a user
tries to unlock the panel. The valid parameter values:
|
|||||||||||||||
| DefaultTimeout | 15000 | The default timeout in ms | |||||||||||||||
| DiCom.Port | 1 | The serial port used by the DiCom interface | |||||||||||||||
| DiCom.ReadIntervalTimeout | 2000 | The maximum time (ms) allowed to elapse between the arrival of two characters on the DiCom communications line. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| DiCom.ReadTotalTimeoutConstant | 0 | The constant (ms) used to calculate the total timeout period for DiCom read operations. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| DiCom.ReadTotalTimeoutMultiplier | 2000 | The multiplier (ms) used to calculate the total timeout period for DiCom read operations. For each read operation, this value is multiplied by the requested number of bytes to be read. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| DiCom.WriteTotalTimeoutConstant | 0 | The constant (ms) used to calculate the total timeout period for DiCom write operations. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| DiCom.WriteTotalTimeoutMultiplier | 2000 | The multiplier (ms) used to calculate the total timeout period for DiCom write operations. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| DMX.<board> | a text | The string containing the description of a DMX adapter. See DMX board description. | |||||||||||||||
| EnforcedExitTimeout | 0 | The value is in ms and specified the timeout before the termination dialog is forcedly closed. The termination problem dialog appears when some interfaces fail to complete gracefully before the time specified by ExitTimeout. The dialog is closed either when the problem disappears, the operator presses the dialog button or the time specified by this key expires. When the value is 0 or negative, no enforced exit timeout is set. | |||||||||||||||
| ExtFix.<server> | a text | The string containing the number of the serial port the external fixation device is connected to. See the external fixation interface. | |||||||||||||||
| ExtFix.ReadIntervalTimeout | 2000 | The maximum time (ms) allowed to elapse between the arrival of two characters on the external fixation interface communications line. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| ExtFix.ReadTotalTimeoutConstant | 0 | The constant (ms) used to calculate the total timeout period for external fixation interface read operations. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| ExtFix.ReadTotalTimeoutMultiplier | 2000 | The multiplier (ms) used to calculate the total timeout period for external fixation interface read operations. For each read operation, this value is multiplied by the requested number of bytes to be read. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| ExtFix.WriteTotalTimeoutConstant | 0 | The constant (ms) used to calculate the total timeout period for external fixation interface write operations. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| ExtFix.WriteTotalTimeoutMultiplier | 6000 | The multiplier (ms) used to calculate the total timeout period for external fixation interface write operations. For further information see Windows API help for the COMMTIMEOUTS structure | |||||||||||||||
| FLG.<server> | a text | The IP address or name of the FLG server named <server>. See FLG interface for further information. | |||||||||||||||
| ExitTimeout | 2000 | The value is the time (ms) the LabMap® waits for an interface shutdown. Upon exit the LabMap® tries to shut down all interfaces by sending them the CmdRRRCloseHandle message. An error message box pops when an interfaces does not complete within the specified time. The operator may either continue waiting or shut down per force. The later option may cause a persistent system damage, because the LabMap® is terminated rather than ended. The DLLs used by the LabMap® are not notified and may remain in undefined state. See also EnforcedExitTimeout. | |||||||||||||||
| IAVCAN.<board> | a text | The description (see) of an CAN adapter card supported by the IAVCAN interface. | |||||||||||||||
| HostsAllow | a text | The list of hosts allowed to connect to the server. The list is white space separated. Each element of the list is a dotted IP address (like 123.45.6.78). An asterisk (*) is allowed in place of a number to indicate any number. For instance: 123.45.*.*. When empty any host is allowed (if not denied by HostsDeny list), otherwise at least one item of the list should match the host address. | |||||||||||||||
| HostsDeny | a text | The list of hosts not allowed to connect to the server. The list has the same format as one of HostsAllow key. When empty no host is denied, otherwise neither of list items should match the host address. To be accepted a remote host must have its address in the HostsAllow list and be absent in the HostsDeny list. | |||||||||||||||
| Log.SyncPeriod |
10000 |
Log file synchronization period in ms. The value determines how frequently the log file buffers should be flushed onto the hard disk. The log file when opened is represented by three files <log>.head, <log>.tail1, <log>.tail2, where <log> is the log file name. <log>.head contains the log file body. It is written sequentially. The files <log>.tailn contain additional information about current log status. They are periodically overwritten by truns. Each time the period specified by the parameter expires, <log>.head is flushed and one of <log>.tailn is overwritten after that they are swapped. | |||||||||||||||
| MaxConnections | 10 | The maximal number of remote clients allowed to connect to the server | |||||||||||||||
| ModBus.<server> | a text | The IP address or name of the MODBUS/TCP server named <server>. See ModBus interface for further information. | |||||||||||||||
| ModBus.Port | 502 | The TCP/IP port used for communication with the MODBUS/TCP servers. | |||||||||||||||
| MonitorRate | 500 | This parameter defines how frequently the system must be monitored to determine timeout state | |||||||||||||||
| NICAN.<board> | a text | The description (see) of an CAN adapter card supported by the NI-CAN interface. | |||||||||||||||
| ODBC.<database> | a text | The description of the database connection of the ODBC interface. | |||||||||||||||
| ODBC..ReconnectDelay (s) | 5 | The delay before an attempt to reconnect to the server will be taken, when a connection attempt was failed or else connection loss was detected. | |||||||||||||||
| PGM.FrameLength | 1000 | The multicast server frame length is ms. Within one frame the multicast server sends full state of all published registers to all ports of all multicast groups. That means that a client connecting to any of the group should become fully functional within this time interval. The value of the parameter PGM.MaxFrameTraffic has higher priority than the frame length. I.e. the actual frame length can appear larger if there is too much traffic. | |||||||||||||||
| PGM.MaxFrameTraffic | 128*1024 | The multicast server traffic limit in bytes/s. Each publisher (a combination of a multicast group and a port) is limited by this parameter, so that the traffic consumed by the synchronization data packets should not exceed the specified limit. If it does, the efficient frame length is increased beyond the value specified by the parameter PGM.FrameLength. Note that PGM.MaxFrameTraffic does not limit the traffic of the incremental data packets. | |||||||||||||||
| PGM.Publishers | a text | A comma separated list of publisher names. A publisher is a combination of a multicast group and port. Each publisher has a name. The publisher name cannot contain delimiters .,;:, brackets [], blanks. Publisher names are case-insensitive. For each name in the list, the registry should contain a key named PGM.Publisher.<publisher>. For example, if the value of the variable is: X, Y, then there should exist keys PGM.Publisher.X and PGM.Publisher.Y. The publishers specified in the list are configured and activated upon LabMap® start. | |||||||||||||||
| PGM.Publisher.<publisher> | a text | The publisher configuration string. The configuration string has the
following syntax:
The fields can be separated by tabs and spaces. Fields are
An example of publisher configuration string: 233.0.0.1:23=100,200,301:10,302:10 |
|||||||||||||||
| PGMNet.<publisher> | a text |
The description (see) of a listened publisher for the PGMNet interface. |
|||||||||||||||
| Port | 1056 | The TCP/IP port used to listen remote connections. | |||||||||||||||
| Port.<host> | 1056 | The TCP/IP port used to connect to remote server. The suffix <host> indicates the remote host nick name (see remote client configuration for further information). The port number can be overridden by the contents of the Server.<Host> registry key. | |||||||||||||||
| PLU.Port | 1 | The serial port used by the PLU interface. | |||||||||||||||
| PLU.ReadIntervalTimeout | 2000 | The maximum time (ms) allowed to elapse between the arrival of two characters on the PLU communications line. For further information see Windows API help for the COMMTIMEOUTS structure. | |||||||||||||||
| PLU.ReadTotalTimeoutConstant | 0 | The constant (ms) used to calculate the total timeout period for PLU read operations. For further information see Windows API help for the COMMTIMEOUTS structure. | |||||||||||||||
| PLU.ReadTotalTimeoutMultiplier | 2000 | The multiplier (ms) used to calculate the total timeout period for PLU read operations. For each read operation, this value is multiplied by the requested number of bytes to be read. For further information see Windows API help for the COMMTIMEOUTS structure. | |||||||||||||||
| Priority | normal | The scheduling priority class of the LabMap®
process.The valid values are:
|
|||||||||||||||
| RC.Port | 1 | The serial port used for the remote control interface. | |||||||||||||||
| RemotePollLimit | 100 | The polling limit in ms used for remote registers. | |||||||||||||||
| Schedule.Priority.<task> | normal | The scheduling priority set for the thread implementing some
task. <task> is the name of the
thread. For instance, the
Schedule.Priority.FLG.Server1.I/O specifies the scheduling
priority for the I/O task servicing a connection to the server Server1
of the FLG handler. The valid values are:
By default all tasks are scheduled using the normal priority level. One can tune priorities to achieve a better performance. However, one should use this option with a great care. |
|||||||||||||||
| Schedule.StackSize.<task> | 0 | The stack size used by <task> in bytes. The default 0 applies some reasonable value. | |||||||||||||||
| Server.<host> | a text | The name of the remote host. This value is used to initialize the host name variable. The suffix <host> indicates the remote host nick name (see remote client configuration for further information). | |||||||||||||||
| SpawnTimeout | 30000 | If an application tries to use the LabMap® while the LabMap.exe is not active, it will automatically started. This operation is timed out by this parameter (in ms) | |||||||||||||||
| StatusN | a text | The default error message text for the RRR error code N. The error codes not defined in the registry are reported in numeric form. See also below. | |||||||||||||||
| <handler>.StatusN | a text | The error message text for the RRR error code N of the interface DLL handler. For instance, the error text for the error encoded by 1 by the interface AK, will be taken from the registry key AK.Status1. If this registry key does not exist or contains the empty text, then the key Status1 will be tested. If this test fails the error code will be reported in numeric form | |||||||||||||||
| SPSHost | a text | The IP name (or dotted number) of the host running the OPC server | |||||||||||||||
| SPSID | a text | The 32 digit (hexadecimal) identifier of the OPC server. For instance, the Siemens OPC server is indentified by the number: B6EACB3042D511D095170020AFAA4B3C. Refer to the documentation of the server you intend to use | |||||||||||||||
| SPSRefreshRate | 50 | The time interval (ms) used to poll the OPC server | |||||||||||||||
| SPSServer | a text | The name of the OPC server used to communucate with. For instance, the Siemens OPC server has the name OPC.SimaticNET. Refer to the documentation of the server you intend to use | |||||||||||||||
| SPSTraceFile | file name | The name of the trace file used by the Softing OPC client. By default it is empty, which means no tracing. This is a debugging feature, use it with care. | |||||||||||||||
| SPS<prefix> | a text | The prefix associated with the name <prefix>. See register's name prefixes for further information | |||||||||||||||
| TableEach | 100 | The last record handle is usually reserved for table requests. The RRR sends table elements packed in the record when any of them is being changed, but not oftener than it is specified by this parameter (in ms). For more information, refer Zoellner's documentation | |||||||||||||||
| TableRecord | 3004 | The handle used for the table record | |||||||||||||||
| TableElements | 10 | The number of table elements | |||||||||||||||
| TableElement_ N | handle no. | The handle of the table element N | |||||||||||||||
| TimerResolution | 1 | The minimum timer resolution in ms used for scheduling LabMap®. This is the best possible value superseding the system default, which is usually 10ms. This value sets the lower bound of the thread re-scheduling interval. If for instance, it is set to 100, then as a consequence, no register can be updated more frequently than once in 100ms, if that happens from one thread, which is normally the case. Lesser values of this parameter cause improve performance but also may cause heavy CPU penalties on very slow machines with a big number of threads running. | |||||||||||||||
| VCI.<board> | a text | The description (see) of an CAN adapter card supported by the VCI interface. | |||||||||||||||
| VXL.<board> | a text | The description (see) of an CAN port supported by the VXL interface. | |||||||||||||||
| N | a text | Definition of the RRR handle N. There is no need to edit handle definitions manually. For the format of register definition see below. | |||||||||||||||
| handler | a text | The name of the DLL providing the interface | |||||||||||||||
| handler.QueueSize | 0 | The maximal size of the interface message queue in bytes. The default is zero, which does not limit the message queue. Note that when the queue of an interface becomes full, the interface cannot be used in a meaningful way. |
5.1. Register definition string
The format of the register definition string is:
>handler>[input-unit:output-unit:watch-unit][sharing]direction:type:timeout:policy:X:Y:name
here:
| handler | The name of the interface responsible for the register. For instance RRR. Each referenced interface must have a DLL implementing it. The DLL is dynamically loaded by the LabMap® during start. The name of the DLL must be put in the registry (see DLL name parameter) | ||||||
| input-unit | A text string defining the input unit of the register. For instance m/s. Input units are meaningful for only floating-point registers. | ||||||
| output-unit | A text string defining the output unit of the register. For instance m/s. Output units are meaningful for only floating-point registers. | ||||||
| watch-unit | A text string defining the watch units of the register, i.e. the measurement unit used for register's value representation on the watch panel. For instance km/h. Watch units are meaningful for only floating-point registers. | ||||||
| sharing | !=shared register, otherwise - exclusive register | ||||||
| direction | I=input register, O=output register | ||||||
| type | I=integer, R=real (floating point register), S=string, B=Block (record register) | ||||||
| timeout |
|
||||||
| policy |
|
||||||
| X | X-co-ordinate of the watch panel's left-upper corner. If co-ordinates are not negative the watch window will be automatically opened by start. | ||||||
| Y | Y-co-ordinate of the watch panel's left-upper corner. | ||||||
| name | A text string defining the register's name |
For instance, register 2810 could be defined as:
>RRR>[m/s:m/s:km/h]O:R:0:100:-1:-1:Speed
here:
Within a register configuration string some integer numbers can be specified in the based format. The based format has the following syntax:
| <number> | ::= | <signed-number>|<unsigned-number> |
| <signed-number> | ::= | [+|-]<unsigned-number> |
| <unsigned-number> | ::= | <decimal-number>|<based-number> |
| <based-number> | ::= | <base>#<based-numeral># |
| <base> | ::= | 2 | 3 | ... | 16 |
Here <based-numeral> is a number in the specified <base>. Examples of based integer numbers:
| Based integer | Value |
| 2#101# | 5 (1012) |
| 16#FFFF# | 65535 (FFFF16) |
| 123 | 123 |
| -8#77# | -63 (-778) |
There are registers predefined by the hardware independent interface. They are recognized by their names. Most of them have the LabMap.dll specified as the handler (>Map>). They may have any desired numbers. The following table gives description the registers:
| Name (case insensitive) | Type | Mode | Handler | Description | |||||||||||||||
| Averaged missed scheduling time | Real [s] |
Output | any with device units |
The value, when requested returns the moving average time by which the registers of the specified units missed the next scheduling time. Note that when this register is queried manually rather than periodically, it would respond even if the unit is busy. The value is queried asynchronously to the unit thread. | |||||||||||||||
| Clock | String |
Output |
LabMap.dll | The current local time in the format hh:mm. | |||||||||||||||
| Bounds error | String | Output | LabMap.dll | When bounds violation of a register leads to value loss, that is when the bounds violation reaction is either BoundsRRRDiscard or BoundsRRRSignal, then this string register receives the value: <no>#<value>. Here <no> is the register number, <value> is the discarded value in a printable format. | |||||||||||||||
| Bounds in | Integer | Output | LabMap.dll | This register contains the number of another register which value was most recently appeared with value bounds. Note that initially when bounds are first set the register is counted to be out of the bounds no matter of its actual value. Also when the register has several bounds then entering any number of them simultaneously would yield only one setting of the described register. | |||||||||||||||
| Bounds out | Integer | Output | LabMap.dll | This register contains the number of another register which value was most recently leaved value bounds. Initially when bounds are first set the register is counted to be out of the bounds no matter of its actual value. When the register has several bounds then leaving any number of them simultaneously would yield only one setting of the described register. | |||||||||||||||
| Bounds
over |
Integer |
Output |
LabMap.dll | This register contains the number of another register which value was most recently crossed an upper value bound. To catch both upper and lower bound violation, use the bounds out register instead. Initially when bounds are first set the register is counted to be out of the bounds no matter of its actual value. When the register has several bounds then leaving any number of them simultaneously would yield only one setting of the described register. | |||||||||||||||
| Bounds
under |
Integer | Output | LabMap.dll | This register is similar to the bounds over, but catches lower value bound violations. | |||||||||||||||
| Density | Real [g/cm³] |
Output | LabPLU.dll | The measured density (the hardware unit shall be set to g/cm³) | |||||||||||||||
| Handle to trace | Integer | Input | LabMap.dll | The number of the traced register. | |||||||||||||||
| Handle enqueued | Integer | Output | LabMap.dll | The last bit of this register's value is toggled each time an operation over the traced register is requested and, hence, a corresponding message is queued into the messages queue. | |||||||||||||||
| Handle I/O started | Integer | Output | LabMap.dll | The last bit of this register's value is toggled each time an I/O start message associated with the register is removed from the messages queue. | |||||||||||||||
| Handle I/O ended | Integer | Output | LabMap.dll | The last bit of this register's value is toggled each time a I/O operation associated with the register ends. | |||||||||||||||
| Host | String | Input | LabNet.dll | The name or IP address of the remote host. This register is
initialized upon start with the value of Server.<Host> key from the registry. Sending
this register causes reconnection to the host. This is the legal way to
switch the interface from one remote server to another. The name or IP
address may be followed by specification of the operating modes put in
round brackets. The following modes are supported (case insensitive):
The modes can be separated using spaces and/or commas. For instance: RRR.Hall_1.cars.com (ro). Here the registers are accessed in read-only mode using no internal time synchronization. |
|||||||||||||||
| Host clock adjustment | Real [s] |
Output | LabNet.dll | The clock adjustment register. In the case of internal time synchronization with the remote host, this register is set each time clock adjustment is evaluated. The frequency is determined by the parameter sync of the connection. The value is the duration to add to a remote time stamp to get an equivalent local time stamp. The register shall have a time dimension. The register policy is ignored. | |||||||||||||||
| Host register number | Integer | Output | LabNet.dll | The remote register number. This register is used for browsing the remote registers. When the register is requested its actual value + 1 is used as the starting point of the search. After completion the value is either 0 or the number of a used remote register. | |||||||||||||||
| Host register name | String | Output | LabNet.dll | The remote register name. The name of the found remote register is stored here after a successful search using the host number register. | |||||||||||||||
| Host register status | Integer | Output | LabNet.dll | The remote register name. The status of the
found remote register is stored here after a successful search using
the host number register. The
status contains the following bits properly set::
|
|||||||||||||||
| Host register unit | String | Output | LabNet.dll | The remote register input units. The units of the found remote register is stored here after a successful search using the host number register. Note that this register is set only if a floating-point remote register was found. | |||||||||||||||
| Host round-trip time | Real [s] | Output | LabNet.dll | The round-trip time encountered during clock adjustment. In the case of internal time synchronization with the remote host, this register is set each time clock adjustment is evaluated. The frequency is determined by the parameter sync of the connection. The value is the round-trip time of the last time synchronization packet. The register shall have a time dimension. The register policy is ignored. | |||||||||||||||
| Last console log message | String | Output | LabMap.dll | The register contains the last message written to the
console. The message format is:
Here <no> is the register number, <server> is the name of the interface reporting, <text> is the message text. The time stamp of the register is one of the message. |
|||||||||||||||
| Log file | String | Input | LabMap.dll | The name of the log file. A send operation causes closing of the currently used log and opening a new one. The value can be empty. In this case the log file is closed without opening a new one. | |||||||||||||||
| Log handle on | Integer | Input | LabMap.dll | The number of a register to be marked for logging. A send operation causes the register with the number equal to the sent value to be marked for logging. When zero is provided all registers are marked. | |||||||||||||||
| Log handle off | Integer | Input | LabMap.dll | The number of a register to be unmarked for logging. A send operation causes the register with the number equal to the sent value to be unmarked for logging. When zero is provided all registers are unmarked. | |||||||||||||||
| Log status | Integer | Input | LabMap.dll | The status of the log file. When zero, it indicates that the log is
inactive. Errors indicated by the register are associated with the log
file operations. This register can be also used to control the log
status:
|
|||||||||||||||
| Missed scheduling time count | Integer | Output | any with device units |
The value, when requested returns the number of times when the registers of the specified units missed the next scheduling time. Note that when this register is queried manually rather than periodically, it would respond even if the unit is busy. The value is queried asynchronously to the unit thread. | |||||||||||||||
| name.x | Real | Input | LabVirt.dll | X-coordinate of the name-spline points (see also). When sent the value defines the x-coordinate of a spline point. Spline names are case insensitive. | |||||||||||||||
| name.y | Real | Input | LabVirt.dll | Y-coordinate of the name-spline points (see also). When sent a new point is added to the spline with the coordinates x, y, where x is the actual value of name.x and y is the value of name.y. Spline names are case insensitive. | |||||||||||||||
| name.reset | Integer | Input | LabVirt.dll | Reset register for the name-spline points (see also). When sent all the points of the spline name are removed. Spline names are case insensitive. | |||||||||||||||
| Owner | String | Output | LabMap.dll | The name of the user which currently has the access to the exclusively accessed registers | |||||||||||||||
| Parameters | String | Input | any with device units |
For the interfaces supporting multiple device units the
register with this name is used to create, modify, delete units. The
register value determines the unit parameters when sent:. The value of unit name register
determines the unit name. Using
LabMapSetString to set it appropriately
before sending the parameters
register.
|
|||||||||||||||
| PGM frame length | Real [s] |
any | LabMap.dll | The minimal length in seconds of the informational frame
multicast server
publisher. The frame length determines how
quickly a client may synchronize itself with the server. The value set
has a lower priority than the
frame traffic limitation.
|
|||||||||||||||
| PGM frame traffic limit | Real [1/s] |
any | LabMap.dll | The maximal traffic in bytes per second of the informational frame
multicast server. The
frame length determines how quickly a client
may synchronize itself with the server. The traffic limitation
influences only informational packets. The incremental data packets are
not counted. Note also, that the protocol used by LabMap®
supports coalescing of the informational and incremental packets. That
is, when an incremental packet is about to be sent and it is determined
that an informational packet could be sent as well, both are merged in
one packet. This optimization need to be kept in mind when the frame
size is determined. Because in this case the data packet will be counted
to the frame.
|
|||||||||||||||
| PGM group (IP address) | String | any | LabMap.dll | The group of a multicast server
publisher. The group is an IP address of D class. The behavior of this
register depends on its I/O direction
|
|||||||||||||||
| PGM published handle | Integer | any | LabMap.dll | The number of a published register.
|
|||||||||||||||
| PGM publisher configuration | String
|
any | LabMap.dll | The configuration string of a multicast server
publisher. The configuration string format is described
above.
|
|||||||||||||||
| PGM publisher name | String | any | LabMap.dll | The name of a multicast server
publisher. Publisher names are case-insensitive. They can contain
digits, letters and underline (_) characters. The behavior of this
register depends on its I/O direction:
|
|||||||||||||||
| PGM publisher port | Integer | any | LabMap.dll | The port of a multicast server
publisher.
|
|||||||||||||||
| PGM publishing period | Integer | any | LabMap.dll | The period of a published register. The period controls coalescing of
frequent register state changes, when they are published as described
above.
|
|||||||||||||||
| Polling interval | Real | Input | LabDiCom.dll | The polling interval used for the DiCom 4000 interface. When set to zero no polling is made. Otherwise the interface tries to get the actual information from the device in the specified intervals. The state of the register reflects the I/O communication state. It goes off-line when an I/O error occurs. | |||||||||||||||
| Queued requests | Integer | Output | any with device units |
The value, when requested returns the number of requests pending in the queue of the register's unit queue. Note that when this register is queried manually rather than periodically, it would respond even if the unit is busy. The value is queried asynchronously to the unit thread. | |||||||||||||||
| Register | String, Integer |
Input, Output |
any, with device units |
These registers are used for enumeration and matching of
the device registers. Two combinations are used:
|
|||||||||||||||
| Response time | Real, s | Output | any | When requested the result is the response time of the interface dispatching thread, i.e. the time require to post a message to the thread and get a response to it. | |||||||||||||||
| Restart | Integer | Input | any | When a value is sent to the register the corresponding interface is restarted. For instance, when the register is associated with the LabMap.dll interface, then sending any value to the register would restart the interface. The register associated with the LabMap.dll resets all interfaces as if the Soft Reset menu item were selected on the main panel. | |||||||||||||||
| Tasks statistics | String | Output | LabMap.dll | The register, when requested will contain the statistics of the internal tasks. The statistics is a string containing for each thread a description consisting of the task name followed by tabulation (ASCII 0916) and the information text of the current task state. The task descriptions are separated by new line character (ASCII 0A16). | |||||||||||||||
| Temperature | Real | Output | LabPLU.dll | The measured temperature (the hardware unit shall be set to °C) | |||||||||||||||
| Unit | String | Output |
any, |
This register is used together with the parameters register to modify device units of the interfaces which have such. It can also be used to enumerate the existing units. When requested the result is the unit name lexicographically greater than the current register value. When there is no such unit, the result is an empty string. |
5.3. User-defined registers (LabUser)
The hardware independent interface offers an ability to define registers maintained by an application. Registers with LabMap.dll specified as the handler (>Map>) are considered to be user-defined. A user application may get and set values of such registers using standard technique. User defined registers can be sent and requested. In this case ending of the sent or request operation lies on the user application, which can do it either by setting a value or by setting error (LabMapSetError). This feature can be used for implementation of interfaces provided by the user application. For instance, a register can be defined for some complex operation involving some set of other registers and I/O. Sending a new value to the register would initiate the operation by a thread in a user application (see LabMapWaitForUpdate). Upon operation completion the thread would call LabMapSetError or LabMapSet{Int|Real|String}[Ex] which will end the pending state of the register.
Alternatively one can use the LabUser.dll specified as the handler (>User>) for the registers where no reaction is required. The send and request queries are immediately satisfied. This way one can implement shared variables not related to any specific hardware. Such variable is assigned using an appropriate LabMapSendInt[Ex], LabMapSendReal[SI][Ex], LabMapSendString[Ex] function.
5.4. Remote access interface (LabNet)
The remote access interface is provided by the LabNet.dll.
The name of a remote register name may end with additional properties specification put in square brackets. For instance, register 2810 could be defined as:
>Net>[m/s:m/s:km/h]O:R:0:100:-1:-1:Speed [2810.RRR]
Here the additional properties specification is [2810.RRR]. It has the following format:
[<Register>.]<Host>
<Register> specifies the register number (based) on the server side. This allows to map a remote register to any desired register of the remote server. In the given example both registers on the client and server sides have same number, so '2810.' could be omitted. <Host> defines the nick name of the remote server. In our example it is 'RRR'. When this part is missing the nick name is assumed to be empty. Each unique nick name indicates a separate connection to some remote server. For each such name a virtual input string register named 'Host [<Host>]' shall be declared (host name register). In our example it should have the name Host [RRR]. This register is initialized with the contents of the registry key Server.<Host>. It always contains the name of remote server. A send operation over this register causes reconnection to the designated remote server. An off-line error on the register indicates that the remote server is currently off-line. Note that there is no need to manually reconnect to the remote server on an error, because LabNet.dll does it automatically. So the connection is restored as soon as possible. The remote host registers can be browsed from the client side using the host number register (see).
The remote access interface has an extended API supporting temporal connections to remote hosts. An application may connect to a remote host, enumerate the registers of the remote host, map remote host registers through the local ones. When a connection is closed all registers related to the connection are automatically removed. The following functions are provided by LabNet.dll (the function prototypes are declared in LabNet.h):
int LabNetConnect
(
unsigned * Index,
const char * HostName,
unsigned TimeOut
);
This function creates a new connection to the remote host identified by the parameter HostName. It can either a name or IP address followed by a list of modes placed in round brackets. For instance: host1.hall2.myplant.com (ro, sync). See host name register for available modes. The list of modes can be omitted. A connection is represented by a set of registers used to communicate with the remote host. The registers are created as temporal. They are removed upon closing the connection (see LabNetDisonnect). The parameter Index is the pointer to the connection index. The returned upon success value should be used in all consecutive calls related to the connection. Note that registers associated with a new connection are initially accessed using LabMapRegAccess. This ensures that the application calling LabNetConnect may use the registers. Therefore you should be careful when a full access (rw mode) is established to a remote host. Such connection may distort applications running on the remote host, because any access gained to either to the system as a whole or to a network register will propagate to the remote host. ResRRRTimedOut is returned when the remote host connection is closed due to a time-out. ResRRRAccessDenied indicates a refused connection or an illegal host name. ResRRRNoHandlesLeft is returned if there is no free registers left. Other errors indicate a system fault.
int LabNetConnectEx
(
unsigned * Index,
const char * HostName,
unsigned TimeOut,
unsigned * HostHandleNo,
unsigned * RegStatusHandleNo,
unsigned * RegNameHandleNo,
unsigned * RegNumberHandleNo,
unsigned * RegUnitHandleNo
);
This function is similar to LabNetConnect except that it additionally allows to specify the desired number of the temporal registers which will be created for the connection. The additional parameters are pointers to the desired registers numbers. When the values of these registers are valid and unused register numbers, they will be used for the corresponding temporal registers. Otherwise the function will choose another number and it will replace the number pointed by the parameter.
int LabNetDisconnect
(
unsigned Index
);
This function closes a connection opened by LabNetConnect (see). The connection is identified by the parameter Index (see LabNetConnect). ResRRRWrongHandle is returned if the index is illegal. All registers associated with the closed connection are removed.
5.4.4. LabNetGetConnectionInfo
int LabNetGetConnectionInfo
(
unsigned Index,
unsigned * HostHandleNo,
unsigned * RegStatusHandleNo,
unsigned * RegNameHandleNo,
unsigned * RegNumberHandleNo,
unsigned * RegUnitHandleNo
);
This function requests the numbers of special registers associated with the connection identified by the parameter Index (see LabNetConnect). The special registers are automatically created upon establishing the connection. They can be used for browsing the remote host registers (see host number register). ResRRRWrongHandle is returned if the index is illegal. The registers are returned via pointers. Any of the pointers can be zero if the corresponding register number is not required.
int LabNetGetHandleInfo
(
unsigned Index,
unsigned * HandleNo,
unsigned * Status,
const char * Name,
unsigned NameLength,
const char * Units,
unsigned UnitsLength
);
This function searches for a remote host register and requests information about it. The connection is identified by the parameter Index (see LabNetConnect). ResRRRWrongHandle is returned if the index is illegal. The parameter HandleNo is the pointer to the remote host register number. It shall be initialized with the number preceding the search starting point. The function finds the first remote host register with the number greater than HandleNo points to. To find the first remote host register one may specify zero. ResRRRNoHandlesLeft is returned if there is no remote registers with numbers greater than the value HandleNo points to. Otherwise, the number of the found register is returned via HandleNo. The remaining parameters are used only if a register was found. All of them can be zero if no information required. The parameter Status accepts the remote host register status (see LabMapGetStatus). The parameter Name accepts the remote host register name. The parameter NameLength specifies the length of the buffer Name. The parameter Units accepts the input measurement units of the remote host register. The parameter UnitsLength is the length of the buffer Units. ResRRRAccessDenied is returned if the application has lost access to the special registers associated with the connection. ResRRRTimedOut and ResRRRNotHandled may indicate connection problems.
int LabNetMapHandle
(
unsigned Index,
unsigned * HandleNo,
const char * Name,
unsigned Status,
unsigned TimeOut,
unsigned Each,
const char * Units
);
This function maps a remote host register. It creates a local remote register mapped to the remote register. All operations over the local register were performed on the remote one via the LabNet interface. The connection is identified by the parameter Index (see LabNetConnect). ResRRRWrongHandle is returned if the index is illegal. The parameter HandleNo is the pointer to a remote host register number to be mapped. The number of the newly create local register is stored into HandleNo. The parameters Name, State, TimeOut, Each and Units have same meaning as for LabMapCreate (see). The parameter Name can be specified as zero if the name is no matter, The values of the parameters Name, Status and Units are usually obtained using LabNetGetHandleInfo. The bits:
should be set according to the desired timings policy of the newly created register. The parameter TimeOut specifies the time limit (ms) for I/O operations with the local register if neither HandleDefaultTimeout nor HandleNoTimeout is set. The parameter Each is required for output registers if either HandleOnChange is set, or HandleUponRequest is clean. The bit HandleNewFromRRR can be added to automatically enable callbacks for the new register. Note that the created register will be temporal, exclusive, accessed by the application called LabNetMapHandle. It will be removed by LabNetDisconnect. ResRRRNoHandlesLeft is returned if no free registers are available. ResRRRWrongPolicy is returned if the specified register policy is illegal. Other return codes indicate a system fault.
5.5. DiCom 4000 interface (LabDiCom)
The interface to the exhaust gas analyzer device AVL DiCom 4000 is provided by the LabDiCom.dll. The registers handled by the interface shall have names ending with a numeric code in square brackets. For instance:
>DiCom>O:R:0:0:-1:-1:CO [340]
Here the register is attached to the DiCom's measurement value 340 (in this case it is CO in % of volume). The code is device specific, refer to AVL documentation for the list of codes and their meaning. All DiCom registers are output ones except for one named polling interval used to control the communication with the device. The serial port used for the communication is specified by the registry key DiCom.Port. The port should have the following settings (Start / Settings / ControlPanel / Ports):
Baud rate: 9600 Data bits: 8 Parity: none Stop bits: 1 Flow control: none
Pin connection for the serial cable:
Note that the AVL DiCom 4000 device responds with data only during a measurement. The data contain only the values related to the measurement. During self test and in the configuration menu the device responds with NAK (signaling that data are not ready). Note also that many values are measured in non-SI units (like % of volume etc.). Please, refer AVL documentation for details.
5.6. Remote control interface (LabRC)
The interface to the Volltronic's remote control device is provided by the LabRC.dll. The serial port used for the communication is specified by the registry key RC.Port. The ports should have the following settings (Start / Settings / ControlPanel / Ports). The interface recognizes three registers by their names.
Pos.1 String format Meaning '0'..'7' n <text> Here n is the line number encoded as '0'..'7' ASCII. <text> is sent to the LCD. Texts larger than 16 characters are wrapped to the next line. Wrapping of the last (8th) line of the display scrolls its contents up. STX STX n <text> ETX <sum> Here n is the line number encoded either as '0'..'7' ASCII or as 0..7 ASCII. <text> is sent to the LCD. <sum> is one character check sum calculated as xor (it is ignored). Texts larger than 16 characters are wrapped to the next line. Wrapping of the last (8th) line of the display scrolls its contents up.
The device should be configured once before use (see configuration menu->system of the device). The following device parameters should be set:
The interface to AK devices is provided by the LabAK.dll. Up to 8 AK devices can be simultaneously controlled. The serial or TCP/IP ports used for the communication are specified in the AK software configuration. AK registers are handled by the LabAK.dll (>AK>). The request policy of an AK register has the following meaning. Upon request registers are explicitly requested (see LabMapSend and LabMapRequest). On change and each registers are polled by the AK software. Note that no attempt to filter incoming data is made. I.e. on change is an equivalent of each. The name of an AK register name shall end with the additional properties specification put in square brackets. For instance, the register 3010 could be defined as:
>AK>[mg/l:mg/m³:mg/m³]O:R:0:100:-1:-1:Soot density [AKON.2.K0]
Here the additional properties specification is [AKON.2.K0]. It has the following format:
[!] <Tag>.<Port>[.K<Host>] [=<Field>] [,<Tag> [=<Field> [,<Tag> [=<Field>...]]]]
The four character <Tag> specifies the AK command associated with the register, like SMAN, SREM etc. The <Port> is the number of the virtual AK port used for the communication. The AK software maps the virtual ports to the hardware COM and TCP/IP ports. See AK software configuration for further information. The optional combination .K<Host> defines the beginning of the AK command sent to the device. Usually it is K0, refer to the AK device specification for further information. When missing, no Kn prefix is used. The optional specification =<Field> indicates the number of the field where the value should be taken from or placed to. It is possible to associate a register with several AK commands. For instance:
>AK>[km/h:km/h:km/h]O:R:0:100:-1:-1:Current speed [AWRX.1.K0=1,AWRT=2]
Here the register is associated with two AK commands: AWRX and AWRT. When a response to AWRX comes, then the value of the register is updated from the first data field. When a response to AWRT comes, then the value of the register is updated from the second data field. The number of the commands associated with a register is not limited. The fields are numerated from 1. Fields are separated by blank characters. When no field specified the whole response text is taken (decoded). One can have both a register with no field specified and an arbitrary number registers associated with different fields of the same AK command. Fields can be skipped, i.e. remain not associated with no register. If a response does not contain some fields the corresponding registers are not set. Fields can be applied to both output and input registers. The register associated with the first defined field of a command controls the policy of the AK command. It is a controlling register. For instance, if the register 2810 is associated with the field 1 of the AK command AWRX, and the register 2820 is associated with the field 2 of same command:
2810: >AK>[km/h:km/h:km/h]O:R:0:100:-1:-1:Current speed [AWRX.1.K0=1]
2820: >AK>[rpm:rpm:rpm]O:R:0:100:-1:-1:Motor revolutions [AWRX.1.K0=2]
then the policy of the register 2810 becomes the policy of the command AWRT. The same register governs the command direction too. I.e. if it is an input register then the values of the fields are sent to the AK host. If it is an output register, then the values from the AK host are used to set the registers associated with the fields. Note that <Port>[.K<Host>] is only specified for the first AK command associated with the register. This command is used when the register is requested (LabMapRequest) or sent (LabMapSend). The type of the controlling register is used to encode and decode the AK commands:
| Type | Input controlling register (sent) | Output controlling register (received) |
| Integer | A send request (LabMapSendInt) sends the [K<Host>] <value> command to the AK device. Here <value> is the register's value in ASCII format. The device responds with the acknowledge command. The error character of the acknowledge telegram defines the status of the register (see LabMapSetError). | A value request (LabMapRequest) sends the [K<Host>] command to the AKdevice. The device answers with <error> <value>. The character <error> of the acknowledge telegram defines the status of the register (see LabMapSetError). <value> is decoded as an integer integer and the result stored into the register if no field specified. Otherwise the specified field of <value> is decoded. The decoded text may start with characters other than digits or signs, so #?-24 is allowed and decoded as -24. Only when the text cannot be interpreted as a number, the value zero is set. |
| Real | A send request sends the [K<Host>] <value> command to the AK device. Here <value> is the register's value in ASCII format. The device responds with the acknowledge command. The error character of the acknowledge telegram defines the status of the register (see LabMapSetError). | A value request (LabMapRequest) sends the [K<Host>] command to the AK device. The device answers with <error> <value>. The character <error> of the acknowledge telegram defines the status of the register (see LabMapSetError). <value> is decoded as an floating-point value and the result stored into the register if no field specified. Otherwise the specified field of <value> is decoded. The decoded text may start with characters other than digits or signs, so #?-24.7e+1 is allowed and decoded as -2.47e+2. Only when the text cannot be interpreted as a number, the value zero is set. |
| String | A send request sends the [K<Host>] <value> command to the AK device. Here <value> is the register's value. Make sure that the value does not contain non-printable characters, for they may confuse the AK device. The device responds with the acknowledge command. The error character of the acknowledge telegram defines the status of the register (see LabMapSetError). | A value request (LabMapRequest) sends the [K<Host>] command to the AK device. The device answers with <error> <text>. The character <error> of the acknowledge telegram defines the status of the register (see LabMapSetError). <text> is stored into the register if no field specified. Otherwise the specified field of <text> is stored. When <text> is put in quotation marks, the marks are stripped out before storing. |
| Block | Not supported | Not supported |
Note that more than one register can be associated with the same AK command. For instance if registers 2000 and 2001 were declared as following:
>AK>[km/h:km/h:km/h]O:R:0:100:-1:-1:Current speed [AWRX.1.K0=1]
>AK>[rpm:rpm:rpm]O:R:0:100:-1:-1:Motor revolutions [AWRX.1.K0=2]
and the controlled register of AWRX is an output register. Then the response from the AK server:
AWRX 0 24.0 800.23
would set the register 2000 to 24.0 km/h and 2001 to 800.23 rpm. If a response does not contain some fields the corresponding registers are not set. In contrary to this if the response contains an error code it is reflected by all the registers associated with the command. The actual value can be requested using any register associated with the command for those the command appears first in the command list in square brackets. If the controlling register is input then the data field of the command will contain the value of the register as described above. When the register is associated with the whole command, the data field of the AK command sent to the host contains only the register value. Otherwise it also contains the values of all registers associated with the command separated by space and following the order of their fields. The actual values can be sent to the AK host using any of the registers associated with the command for those the command appears first in the command list in square brackets.
Treatment of AK errors. The AK status code 1-9 when appears in an AK response causes the corresponding registers to be set into the error state with the status numerically equal to the AK code. For example, the response:
AWRX 3 24.0 800.23
will set the status of all registers depending on the fields of the command AWRX to 3. This behavior can be undesired. When the exclamation sign ! appears in before the four character <Tag> in the declaration of the controlling register then the status of the corresponding AK command is ignored for all registers depending on the response to <Tag>. For example:
>AK>[mg/l:mg/m³:mg/m³]O:R:0:100:-1:-1:Soot density [!AKON.2.K0]
This will turn of error handling for AKON on the port 2.
5.8. NI-CAN interface (LabNICAN)
The NI-CAN interface is provided by the LabNICAN.dll. An adapter card by National Instruments supports up to 2 CAN ports. They can be used simultaneously. The name of a NI-CAN register shall end with additional properties specification put in square brackets. Note that the CAN adapter card provides each incoming data frame with the time stamp, which becomes the time stamp of the corresponding LabMap® register as the data are read from the buffer. A NI-CAN register could be defined as:
>NICAN>[::]O:I:0:-100:514:295:5 [Port1 ID=5 length=7 p=0123456]
Here the additional properties specification is [Port1 ID=5 length=7 p=0123456]. It has the format <board>.[<parameter> [<parameters>...]. Parameters can be separated by spaces, colons and points. Each parameter has the format <name>=<value>. In the given example <board> is Port1, the parameters are ID=5, length=7 and p=0123456. <board> indicates the name of a CAN adapter's port. For each board name there should be a string registry key named NICAN.<board> containing a description of the board. In the given example there should be a registry key named NICAN.Port1. The description of the board specifies the adaptor type, location, number of CAN ports, their baud rates, operating modes and memory used for buffered I/O. The following table provides the list of the valid register parameter names (case insensitive):
| Name | Abbreviations | Description | Default | ||||||||||
| and | a, andmask | See and-mask | all bits set | ||||||||||
| binary | b, bin | See binary | non-binary | ||||||||||
| double | See double | single | |||||||||||
| extendedid | extended, extID, extID, ext, e | The value is either 0 or 1. The value zero indicates that the arbitration ID has standard 11-bit size. The value one is used for extended 29-bit arbitration IDs | 0 | ||||||||||
| id | i | The value is the CAN arbitration ID. Each register should have a unique arbitration ID. It is a based unsigned integer or the wild-card *. When the CAN arbitration ID is specified as *, i.e. id=*, the register works in a special way depending on the I/O direction. The unsolicited frames sent and received by the special registers with id=* require queues to keep the frames. Due to design of underlying National Instruments software the buffer sizes cannot be provided by the buffer parameter as in the case of normal registers. It is set in the registry. See NICAN<port>.ReceiveQueueSize and NICAN<port>.SendBufferSize. | 0 | ||||||||||
| length | len, l | The length of the data field in bytes. CAN-bus messages may contain up to 8 bytes data. It is a based unsigned integer. | 8 | ||||||||||
| or | o, ormask | See or-mask | 0 | ||||||||||
| permutation | p, byteorder | See permutation | 87654321 | ||||||||||
| shift | <<, >> | See shift | 0 | ||||||||||
| signposition | sign, signat, signplace, signpos | See sign position | N/A | ||||||||||
| single | See single | single | |||||||||||
| status | stat, state | CAN bus general status as responded by a CAN controller.
When specified no other parameters are allowed. Only output
integer registers are allowed. When requested the result is the status
of the CAN controller:
|
N/A | ||||||||||
| xor | x | See xor-mask | 0 |
The input NI-CAN registers are used for sending CAN data frames. The outgoing data are post-processed as follows:
The 'upon request' and 'on change' output registers accept unsolicited CAN data frames. For the 'on change' registers the data are received only if they differ from the previously received data. The 'upon request' registers accept any data. A call to LabMapRequest causes sending a CAN remote frame. The 'upon request' and 'on change' registers can be used when the communicated CAN device sends the data frames either in arbitrary manner or in response to a CAN remote frame. On contrary to this the 'each' registers accept the data periodically. They accept all data frames regardless to their content. The hardware watchdog is configured to ensure that the data come within the specified time interval (1.5 of the value of the parameter policy). One can use such registers the CAN device sends data frames periodically. The incoming data are pre-processed as follows:
A description of an CAN adapter card supported by the interface has the following syntax:
<port>:<baud>[:<send>[:<receive>]]
| Parameter | Description |
| <port> | Is the port number 1..2. An adapter card supports up to two ports. |
| <baud> | The baud rate (kBaud). It is a based unsigned integer. |
| <send> | The size of the send buffer in CAN telegrams. It shall be greater than 20. It is a based unsigned integer. |
| <receive> | The size of the receive buffer in CAN telegrams. It shall be greater than 20. Note that the buffer should be big enough to buffer all incoming telegrams without data loss. It is a based unsigned integer. |
Here is an example of a board description:
0:500:100:200
5.9. PLU 401 interface (LabPLU)
The interface to the exhaust gas analyzer device Pierburg PLU 401 is provided by the LabPLU.dll. The registers handled by the interface shall have one of the following names: Density (measured by the device), Temperature (measured by the device). The serial port used for the communication is specified by the registry key PLU.Port.
The OPC interface is provided by the LabSPS.dll. It has the name SPS. The registry key SPSServer specifies the name of the OPC server. The registry key SPSHost gives the name of the network host running the OPC server. The registry key SPSID specifies the identifier of the server (32 hexadecimal figures). The registry key SPSRefreshRate determines how often the server variables should be polled (in ms). The name of a SPS register shall end with additional properties specification put in square brackets. A register could be defined as:
>SPS>[::]I:I:0:0:-1:-1:Feedback [type=I4 pref=WriteGroup name=M12ADWORD1,1]
Here the additional properties specification is [type=I4 pref=WriteGroup name=M12ADWORD1,1]. It has the format of a space separated list of tokens. Each token consists of the name and the string value assigned to it. The following table indicates the list of names that can be used for register properties configuration:
| Name | Abbreviations | Description | Default | ||||||||||||||||||||||||||||||
| name | n, nam | The name of the variable. This string is added to the name prefix to build the name of the OPC variable. | N/A | ||||||||||||||||||||||||||||||
| prefix | p, pref | The prefix used for the name. The name of the OPC variable associated with register is built as a concatenation of the prefix and the string given for the name parameter. The string <prefix> given for the prefix is used for search for the registry key SPS<prefix>. The value of the key is used as the prefix. In the given above example (pref=WriteGroup name=M12ADWORD1,1) the name of the register will be DP:[CP_L2_1:]Slave002M12ADWORD1,1, where DP:[CP_L2_1:]Slave002 is the value of the registry key SPSWriteGroup. | empty | ||||||||||||||||||||||||||||||
| type | t, typ | The type of the OPC variable associated with the
register. The following data types are currently supported:
|
N/A |
Due to the nature of the OPC the request policy have no effect on the output registers.
5.11. Virtual interface (LabVirt)
The Virt interface is provided by LabVirt.dll. This interface gives an ability to calculate registers out of other register values. Such a register could be defined as:
>Virt>[::]I:I:0:0:-1:-1:Sum [$1200 + $2810]
Here $1200 + $2810 is the expression used to evaluate the register. The expression in square brackets can be preceded by the trigger specification (see register policy)
5.11.1. Types, literals, register values and time stamps
Three data types are supported: integers (64-bit), dimensioned real (floating-point 64-bit) numbers of some measurement unit, and strings. Literals and variables are terms of the expression:
Real and integer are numeric types. There are several operations that accept any numeric types as arguments (no matter real or integer). For such operations when one operand is real and another is integer, the integer operand is converted to a real of unspecified unit. This allows an operand to gain an appropriate unit from the context.
Accessing the register data:
All calculations with real types are made in SI units. This may sometimes lead to surprises like in the expression 1[°C]+1[°C], which results in 548.3K=275.15°C rather than 2°C. When the measurement unit of a real is not explicitly specified, an appropriate SI unit is chosen from the context. Therefore the expression 1[°C]+1 is treated 1[°C]+1[K] , which gives the result 274.15K=2°C. The hardware unit of a virtual register may differ from the corresponding SI unit. In this case the register keeps the value in that unit. Yet it has no influence on the way the register value is evaluated, which as it was said, always happens in SI units.
Computation errors, like zero divide etc, lead to setting the register into an erroneous state. So its value remains unmodified.
5.11.3. Blanks and comments
Space, tabulation (HT), linefeed (LF) and carriage return (CR) are blank characters. They can be used to separate lexical tokens of an expression. Comments may appear everywhere one can put a blank character. There are two types of comments:
5.11.4. Identifiers
The following identifiers are predefined:
| Name(s) | Type | Meaning |
| Clock, T | Real [s] | The current time stamp. I.e. number of seconds passed from the operating system start. For triggered expressions the time stamp is one of the triggering event. |
| Pi | Real | π = 3.14... |
| Value | Of the trigger register | The value of the register triggered evaluation of the expression (see register policy) |
| Size | Real | The size of the currently used log file in bytes. The value is undefined if the on-line log plug-in is not present |
5.11.5. Prefix operations
Prefix operations are applied to one argument. Name of the operation is placed before the argument. For instance, sqrt 5.0. Here sqrt is the name of the operation that calculates square root. Brackets are not required. The following prefix operations are supported:
5.11.6. Infix operations
Infix operations are applied to two arguments. Name of the operation is placed between the arguments. For instance, 5.0 + 1. Here + is the name of the operation that calculates sum. The following infix operations are supported:
| Operation | Name(s) | Left Operand | Right Operand | Result | Example | ||
| Comparisons | !=, /=, >, <, >=, <=, =, >< |
Any | Same as left | Integer | $2810 != 10 [km/h]. One can compare two numeric or two string arguments. If one of the numeric arguments is real it should have units compatible with the units of another argument. Strings are compared lexicographically and the result indicates their relationship. The operation >< functions similarly to !=. Its result is always defined. If any of the arguments is undefined the result of is >< 1. | ||
| Multiplication | ·, * | Numeric | Numeric | Numeric | 4.0 * 2.1. If one of the arguments is real the result is also real. | ||
| Remainder | %, rem | Numeric | Numeric | Numeric | 45.0 % 5. If one of the arguments is real the result is also real. The arguments should have compatible units. The result inherits the units of the arguments. | ||
| Case insensitive comparison | %= | String | String | Integer | " Xy" %= "xY" results in 1. The operation compares two strings. First spaces, tabs, line feeds, carriage returns and the nul-characters are removed from the both sides of the arguments. Then the rests are compared, but case insensitive. | ||
| Bit wise and | &, and | Integer | Integer | Integer | 1 and 3 results in 1 | ||
| Concatenation | &, and, + | String | String | String | "a" and "b" results in "ab" | ||
| Exponentiation | **, ^ | Integer, Dimensionless real | Integer, Dimensionless real | Integer, Dimensionless real | 2**3. If one of the arguments is real the result is also real. The arguments should be dimensionless. For squaring and cubing dimensioned values, use operations x2 and x3. respectively. | ||
| Addition | + | Numeric | Numeric | Numeric | 45.0 + 5. If one of the arguments is real the result is also real. The arguments should have compatible units. The result inherits the units of the arguments. | ||
| Subtraction | - | Numeric | Numeric | Numeric | 45.0 - 5. If one of the arguments is real the result is also real. The arguments should have compatible units. The result inherits the units of the arguments. | ||
| Prefix | : | String, Integer |
Integer, Same as the left |
Of the left |
|
||
| Suffix | . | String, Integer |
Integer, Same as the left |
Of the left |
|
||
| Assignments | ->, #>, => |
Any | Register number | Of the left | "some text" -> 3010. The assignment operation causes execution of a send operation upon the specified register. In the given example the string "some text" is sent to the register 3010. The result of the operation is the sent value. The operation #> functions like ->, but performs the assignment if and only if the value of the left operand differs from the value of the target or the later is not defined. In other words #> has the semantic "send if other". The operation => causes setting the left operand value into the register. Unlike -> it does not send it to the hardware. The register number can be specified as a literal: "some text" -> <System messages>. | ||
| Division | / | Numeric | Numeric | Numeric | 4.0 / 2.1. If one of the arguments is real the result is also real. | ||
| Histeresis | <§> | Integer | Real (time) | Integer | ($2810 > 100 [k/m]) <§> 5 [s]. If the left argument is non zero the result of the operation will remain 1 as long as the right argument specifies. In the given example the condition that the speed represented by the register 2810 is greater than 100 km/h will be true at least 5 s. | ||
| Upper damper | </> | Real | Real | Real | $2810 </> 3 [m/s²]. The operation functions as a filter. The left argument is the signal to be filtered. The right argument is the upper limit of the signal's differential. The operation ensures that the result grows not faster than the limit states. In the given example the limit is 3 [m/s²] for the value taken from the register 2810 (has speed units). The units of the right argument should correspond to the units of the left argument's differential. For instance, if the left argument is measured in A, then the right argument could be A/s. | ||
| Lower damper | <\> | Real | Real | Real | $2810 <\> -3 [m/s²] </> 3 [m/s²]. The operation functions as a filter. The left argument is the signal to be filtered. The right argument is the lower limit of the signal's differential. It ensures that the result falls not faster than the limit states. In the given example the signal's differential is limited by the range -3..+3 [m/s²] using <\> and </> operations. The units of the right argument should correspond to the units of the left argument's differential. For instance, if the left argument is measured in A, then the right argument could be A/s. | ||
| Shifts | <<, >> |
Integer | Integer | Integer | 1 << 3 results in 8. | ||
| Else | else | Any | Of the left | Of the left | $2810 else 0, here the result of the operation is the value of the register 2810 if it is defined. Otherwise it is 0. The operation else functions as follows. If the left argument is defined, the result is the value of the left argument. Otherwise, if the the result is the value of the right argument. If the right argument is also undefined, then the result is undefined too. Using when and else one can build a select operator: $2810 when $1000 else -$2810. Here the result is the value of 2810 if 1000 is non-zero, or the negated value of 2810 otherwise. | ||
| Maximum | max | Numeric | Numeric | Numeric | 2 [km/h] max $2810. If one of the arguments is real the result is also real. The arguments should have compatible units. The result inherits the units of the arguments. | ||
| Minimum | min | Numeric | Numeric | Numeric | 50 [km/h] min $2810. If one of the arguments is real the result is also real. The arguments should have compatible units. The result inherits the units of the arguments. | ||
| Bit wise or | V, or | Integer | Integer | Integer | 1 or 3 results in 3 | ||
| Sum | sum | Any | Integer | Of the left | mean ($2810 * d T) sum $4001, here the value of the register 2810 is integrated, but only if the register 4001 is not zero. The right argument of sum is the reset signal. If it is zero the result of sum is also zero or empty string (for sum of strings). | ||
| Conditional parameter | when | Any | Integer | Of the left | $2810 when $1010, here the value of the register 2810 is used only if the value of the register $1010 is not zero. If the right argument of when is zero then the left argument is ignored and the result is treated as undefined. It has the same effect as if the value of the left argument were undefined. If the value of the right argument is not zero the result is the value of the left argument. So the operation when can be used for lazy expression computing. For instance, the expression min ($2810 when $1010) will calculate the minimum of the values of the register 2810, but only when $1010 is not zero. When $1010 is zero the expression is not be calculated, so its value remains unchanged. | ||
| Bit wise xor | xor | Integer | Integer | Integer | 1 xor 3 | ||
| Synchronization | ~ | Integer | Integer | Integer | %2810~%2820~%2830. The result of the operation is 1 when both operands reach a non-zero value. It functions as follows. Let both arguments are zero. Then the result is also zero. If one of the arguments becomes non-zero, the operation remembers that fact, but the result remains zero. Only when another argument becomes non-zero, the operation triggers. Its result becomes 1, and a new cycle begins. Together with the register update flag, the operation can be used to eliminate race condition. The expression above will be 1 only when all three registers are updated. The updates may happen asynchronously, i.e. first 2810, then 2830 and 2820 at last. For example, let we want to compose a string from two registers in a way that both have to be updated, we could do it as follows: $100 & $200 when %100~%200. |
Infix operations are associated according their priorities. Higher order operation are executed first. Operations of same priority are executed from left to right. For instance 2 + 3 * 4 + 5 is executed as 2 + (3 * 4) + 5 because * has a higher priority than +. The following table shows the priorities of the infix operations:
| Priority group | Priority | Operations | ||||||||||
| Member extraction | 8 | . | : | |||||||||
| Exponentiation | 7 | ** | ^ | |||||||||
| Multiplicative | 6 | · | % | * | / | << | >> | rem | ||||
| Additive | 5 | + | - | |||||||||
| Min/max | 4 | max | min | </> | <\> | |||||||
| Comparisons | 3 | != | /= | >< | < | <= | = | %= | > | >= | <§> | sum |
| Logic | 2 | & | and | or | V | xor | ~ | |||||
| Assignment | 1 | -> | => | #> | else | when | ||||||
5.11.7. Postfix operations
Postfix operations are applied to one argument. Name of the operation is placed after the arguments. For instance, 5.02. Here 2 is the name of the operation that calculates power. The following postfix operations are supported:
| Operation | Name(s) | Operand | Result | Example |
| Quadrate | 2 | Numeric | Numeric | $28102 |
| Cube | 3 | Numeric | Numeric | $28103 |
5.11.8. Brackets
Brackets either represent an operation or used to change the calculation order. The following brackets are supported:
| Operation | Brackets | Operand | Result | Example |
| Absolute value | |...| | Any | According to operand | |$2810|. The absolute value. For a string it is the string length (integer) |
| Order change | (...) | Any | Like the operand | (2+3)*5 |
| Truncation | [...] | Real | Real | [2.6] results in 2 |
| Alternative selector | {...} | list of alternatives |
One of the alternatives | {$200 case >0 then 1; =0 then 0; <0 then -1;}. Returns sign of the value of register 200 |
The alternative selector has the following two forms:
If-alternatives-selector is similar to an if statement. It has the following syntax:
{ <guard>[|<guard>...] then <alternative>;
...
<guard>[|<guard>...] then <alternative>;
[ others <alternative>; ]
}
Here <guard> is an integer expression, <alternative> are expressions of same type, if real they should have same units. The selector chooses one of the alternatives, which then becomes its result. For this it evaluates the first guard expression. If it is defined and not zero then the result of the first alternative is the result of the selector. If not, the second guard is of the first alternative is evaluated and when defined and non-zero the alterative is selected. The process continues until all guards of the first alternative are evaluated. If none of them fires the alternative, it continues to the second alternative. The process stops when one of the alternatives gets selected. The last alternative can be introduced by the keyword others. Its guard is always non-zero. Each alternative is ended by a semicolon ;, which can be omitted for the last alternative. If none of the alternatives is selected, the result of the selector is an undefined value. As such it can be tested using the else-operation, for instance. Examples:
| {$8010>0 then $8010->2100} | Send the value of 8010 to 2100, but only if it is positive, otherwise the result is undefined | |||
| {
|$8010|>0.001 then (sin $8010)/$8010; others 1 } |
|
|||
| { $8010<-10
| $8010>10 then "error"; $8010<-5 | $8010>5 then "warning"; others "OK"; } |
Results in "error" to 2100 if it is not in the range -10..10, else in "warning" if its out of -5..5, else in "OK". Note that the order of testing the guards is important here, because the choices overlap. |
Case-alternatives-selector is similar to a case statement. It has the following syntax:
{ <selector> case
<operator> <choice>[|<operator> <choice>...] then <alternative>;
...
<operator> <choice>[|<operator> <choice>...] then <alternative>;
[ others <alternative>; ]
}
Here <selector> is an expression, <operator> is a binary infix operation resulting in an integer value, <choice> is another expression. Combined together in
<selector> <operator> <choice>
they build an integer guard expression for the alternative it introduces. <alternative> are expressions of same type, if real they should have same units. The selector chooses one of the alternatives, which then becomes its result. For this it evaluates the guard expressions and selects the first alternative with a non-zero guard. The default alternative can be introduced by the keyword others. If none of the alternatives is selected, the result of the selector is an undefined value. Thus a case-alternatives-selector is equivalent to the following if-alternatives-selector
{ <selector> <operator> <choice>[|<selector> <operator> <choice>...] then <alternative>;
...
<selector> <operator> <choice>[|<selector> <operator> <choice>...] then <alternative>;
[ others <alternative>; ]
}
with essential difference that <selector> expression is evaluated only once. Examples:
| { $8010:5.2
case =0 then $8010:1.4->2100; =1 then $8010:1.4->2101; >1 then $8010:1.4->2102; } |
Extracts the field 5..6 from the value of 8010 and depending on the result sends the field 1..4 to different destinations. Note difference between alternative selector and expressions like <alternative> when<condition>else<alternative> . Latter evaluates both of the alternatives and only then selects one of them. It cannot be used if the alternatives have side effects, like -> used in the example. The alternative selector, evaluates an alternative only when that is selected. Thus only one of the alternatives is evaluated. |
| {$8010 case !="" then $8010} | Provided that 8010 is a string registers, the result is defined only if it contains a non-empty string, which is then the result. |
5.11.9. Register policies
An evaluated virtual interface register can be only output. The policy of a register has the following meaning:
>Virt>[::]I:I:0:0:-1:-1:Sum 8000->[$1200 + $2810]
Here the trigger specification is 8000->. It consists of the number of the triggering register and the triggering condition:
Condition syntax Condition of the triggered register evaluation Example <register>-> Each time a value is set to the register <register>. This happens even if the modified state of the triggering register is exactly same as the previous one. Note that when a send operation is initiated on a register, the latter's value is first set and then the register enters an operation-pending state. Upon operation completion the register enters ready state. In this case the virtual register evaluation will be triggered twice. 8000-> <register>=> Same as above, but only if the triggering register enters a settled state. That is: no operation is pending on the register and no error set. In the example of a send operation, the register will be triggered only once upon successful send completion.
If the triggering register has each n ms it will never trigger anything, because it is always either in an error or pending state. Thus it never can have a settled state. 8000=> Within a triggered expression the value of the triggering register is available via the variable Value. Carefully observe that Value may differ from the actual register value obtained via $<number>. The former is frozen to give an ability to track highly dynamic register updates in a race condition free way. Triggered registers are not evaluated on demand. That is, LabMapRequest would not cause register reevaluation. Also any other policies have no effect. Thus, should the register in the example above be declared on change, then the changes in the registers it depends on will not cause its reevaluation. Each n ms policy when used, only checks that the register gets reevaluated as requested. So the triggering register modification is the only event which may cause reevaluation. The time stamp of a triggered register is one of the triggering event.
|
|
|
5.11.10. Design notes
Designing formulae for calculation of virtual registers requires care and deep understanding of the way the system functions. One can encounter the following problems:
Note also that when expression evaluators <int>, <real>, <string> are used, the register should be calculated periodically (each policy). The reason is that the complete list of registers it depends on is unknown. Some of registers may be specified in a string value of an evaluator. Therefore there is no way to react on their changes.
The FLG interface is provided by LabFLG.dll. The interface allows to access the variables of an arbitrary number of FLG servers. Any variable of a server can be mapped to a register. For instance:
>FLG>[::]I:S:0:0:-1:-1:First message [Server1.first_message.text]
Here the additional register properties specification is [Server1.first_message.text]. It has the format <server>.<name>. In the given example <server> is Server1 and <name> is first_message.text. The value of <server> indicates the name of the FLG server the variable belongs to. For each server name there should be a string registry key named FLG.<server> containing the IP address or name of the host running the FLG server. In the given example there should be FLG.Server1 registry key. The value of <name> is the name of the FLG variable. It is case insensitive. The FLG variables can be read and written and be of integer, real or string type. The register policy determines the way the FLG variables are accessed. The policies on change and each are allowed. They are implemented using polling the FLG server in background.
The following values of the field <name> have special meaning as described in the following table. It is not obligatory to have any register with <name> field.
| Name | Type | I/O direction | Hardware unit | Description |
| AccelerateTo | Real | Input | km/h | Sending a value informs the FLG server about the current car velocity. It should be periodically sent together with MoveTo or MoveToLatitude / MoveToLogitude to cause the FLG server movement. |
| AttachmentName | String | Output | - | The name of the currently used FLG road profile attachment. This register can be used to enumerate the attachments. If the current value is empty, then the request operation will give the name of the first attachment (in alphabetical order). A next request will give the name of the next variable. When there is no more attachments it becomes empty. For more information about attachments see FLG. |
| AttachmentType | String | Output | - | The type of the attachment. When the register AttachmentName is requested and returns a non-empty attachment name, this register is set to the description of that attachment. The description has the format <type> <mapping> [<unit>]. Here type is either integer, contiguous, stepped or string. Mapping is either (s) or (t). When AttachmentName is requested and set to an empty string, this register is also emptied. |
| Browse | Integer | Input | - | Sending a non-zero value causes popping up the FLG server's variable browser. To make this handle working the registers VariableName, VariableValue (for both directions has to be declared) |
| ErrorWindow | Integer | Input | - | The handle to the error messages edit box. If a non-zero value is set the FLG server error messages are written into the edit box window which handle is equal to the sent value. |
| Exit | Integer | Input | - | Sending a non-zero value to this register ends the FLG server. |
| Hide | Integer | Input | - | When zero value is sent the FLG server leaves the sleep mode. Otherwise it enters the mode. In the sleep mode the server hides its window and consumes as little system resources as possible. |
| Host | String | Input | - | The IP address or name of the FLG server. Sending this register causes reconnection to the server. The state of this register reflects the connection state. |
| Inclination | Real | Output | rad | This register contains the road inclination corresponding to the time moment that last value of the MoveTo register was set. The value of the register is set automatically when a send operation over the MoveTo register is completed. An explicit requesting its value is meaningless. |
| LoadConfig | String | Input | - | The file name of a FLG server configuration. Sending this register causes loading the configuration from the specified file. |
| LoadProfile LoadProfile.Spline LoadProfile.Linear |
String | Input | - | The file name of a road profile. Sending this register causes loading the road profile from the specified file. The format of the road profile file is described in the FLG documentation. The suffix Spline vs. Linear indicates whether the points of the profile should interpolated using a 3rd order spline or a linear interpolation. The default is a spline interpolation. |
| Mode | Integer | Output | - | The current FLG mode. The mode register contains the FLG status and the user defined led bits. For a detailed description refer FLG documentation. |
| MoveTo | Real | Input | m | Sending a value informs the FLG server about the current car position on the road. It should be periodically sent together with AccelerateTo to cause the FLG server movement. The car position is evaluated relative to the road beginning. Usually it is obtained from an incremental encoder. |
| MoveToLatitude | Real | Input | rad | Sending a value informs the FLG server about the current car position on the road. It should be periodically sent together with AccelerateTo to cause the FLG server movement. Unlike the MoveTo register, MoveToLatitude sets the position in the form of a GPS latitude-longitude pair. Here GPS stands for Global Postioning System. The corresponding longitude value is taken from the MoveToLongitude register, which should exist and contain the value to the time moment when MoveToLatitude is sent. Upon setting MoveToLatitude causes no I/O with FLG. To use GPS MoveToLatitude, MoveToLongitude registers properly one should always set one of them and then send another ensuring atitude-longitude correctly sent to FLG. For example, an application may first call LabMapSetReal on MoveToLatitude and theh LabMapSendReal on MoveToLongitude. |
| MoveToLongitude | Real | Input | rad | See MoveToLatitude |
| MoveToStart | Integer | Input | - | Sending a non-zero value to this register causes the FLG server to jump to the beginning of the currently loaded road profile. Note that the value of the MoveTo register should be set to zero after applying MoveToStart. |
| Pause | Integer | Input | - | When zero value is sent the FLG server leaves the pause mode. Otherwise it enters the pause mode. In the pause mode the server retains the last position on the road regardless MoveTo register operations. |
| SetCarHeight | Real | Input | m | Sending a value causes the FLG to change the height of the driver's eye. See SetCarHeight in FLG documentation. |
| SetSpeed | Real | Output | km/h | This register contains the set speed corresponding to the time moment that last value of the AccelerateTo register was set. The value of the register is set automatically when a send operation over the AccelerateTo register is completed. An explicit requesting its value is meaningless. |
| Steering | Integer | Input | - | Sending a non-zero value turns the manual steering mode on. |
| SteerTo | Real | Input | 1/m | In the manual steering mode the FLG server should be periodically given the current curvature. The curvature is sent to the server via SteerTo register. The curvature is 1/R, where R is the radius of the curve, the vehicle would drive if the steering wheel is firmly hold in the current position. |
| StoreConfig | String | Input | - | The file name of the FLG server configuration. Sending this register causes reading the configuration from the server and writing it into the specified file. |
| TurnGreen | Integer | Input | - | The value of the register is the number of the traffic light to be turned green. Traffic lights are numerated from 1. Zero value turns all lights green. |
| TurnRed | Integer | Input | - | The value of the register is the number of the traffic light to be turned red. Zero value turns all lights red. |
| TurnYellow | Integer | Input | - | The value of the register is the number of the traffic light to be turned yellow. Zero value turns all lights yellow. |
| VariableName | String | Output | - | The name of the currently used FLG variable. This register can be used to enumerate the FLG variables. If the current value is empty, then the request operation will give the name of the first FLG variable (in alphabetical order). A next request will give the name of the next variable. |
| VariableValue | String | Any | - | This register can be declared as both input and
output. Moreover it can be done simultaneously:
|
5.13. MODBUS/TCP interface (LabModBus)
The MODBUS/TCP (ModBus) interface is provided by LabModBus.dll. The interface allows to communicate with an arbitrary number MODBUS servers using the class 2 protocol (FC1, FC3, FC15, FC16). Any MODBUS register can be mapped to a LabMap register. It is possible to map same MODBUS register to several different LabMap registers. An example of a register declaration:
>ModBus>[::]O:I:-1:100:-1:-1:Analogue input [Coupler1.type=i.addr=0.len=16]
Here the additional register properties specification is [Coupler1.type=i.addr=0.len=16]. It has the format <server>.[<parameter> [<parameters>...]. Parameters can be separated by spaces, colons and points. Each parameter has the format <name>=<value>. In the given example <server> is Coupler1, parameters are type=i, addr=0 and len=1. <server> indicates the name of the MODBUS/TCP server the register should be taken from. For each server name there should be a string registry key named ModBus.<server> containing the IP address or name of the host. In the given example there should be ModBus.Coupler1 registry key. The following table provides the list of parameter names:
| Name (case insensitive) | Abbreviations | Description | Default | ||||||||||||||||||||||||||||||||
| and | a, andmask | The value is the 64-bit and-mask applied to the incoming and outgoing data. It is a based unsigned integer. | all bits set | ||||||||||||||||||||||||||||||||
| address | addr | The address (counted from 0) of the register. Refer to the documentation of your MODBUS coupler for further information about the register location. It is a based unsigned integer. | 0 | ||||||||||||||||||||||||||||||||
| double | The value, when real and binary
is interpreted as a double precision IEEE 754 float. The number of bytes
is determined by the length. The representation is big-endian:
Here, the bit order shown in the bytes is big-endian (the most significant bit is the leftmost one), the number is S·F·2E:
|
single | |||||||||||||||||||||||||||||||||
| binary | b, bin | This parameter has no value. When specified it
has no influence on integer registers. For other types:
|
non-binary | ||||||||||||||||||||||||||||||||
| host | The host register, for instance [Coupler1.host]. No other parameters may appear. A host register should be input string. Its value is the IP address or name of the ModBus host. It is initialized from ModBus.<server> registry key. Its status reflects the connection state. When sent the value is the IP address or name of the host to connect to. | N/A | |||||||||||||||||||||||||||||||||
| length | l, len | The length of the registers (several consecutive registers can be accessed and treated as one value). The length is specified in bits. The byte-oriented data (all types except for bits) should have length 16*n. It is a based unsigned integer. | 1 item | ||||||||||||||||||||||||||||||||
| or | o, ormask | The value is the 64-bit or-mask applied to the incoming and outgoing data. It is a based unsigned integer. | 0 | ||||||||||||||||||||||||||||||||
| permutation | p, byteorder | The value is the byte permutation applied to the incoming and outgoing data. The lowest significant decimal digit of the value corresponds to the first data byte. It indicates which byte of the source data should be taken to produce the first byte of the destination data. This shall be a number in the range 1..8. Zero can be also specified, which means that the destination byte is always zero. The next decimal digit indicates the position of the second byte and so on. Note that the bytes numeration is machine independent. I.e. the values 0..255 correspond to the low order byte no matter which byte order has the given processor. For instance, the value 87654321 denotes a 1-1 permutation, while 12345678 would reverse the byte order. | 87654321 | ||||||||||||||||||||||||||||||||
| shift | <<, >> | The value is the number of bits to shift the incoming or outgoing data. It is a based unsigned integer in -63..63. For example: shift=5 divides to 25. It is equivalent to >>=5 and <<=-5. | 0 | ||||||||||||||||||||||||||||||||
| signposition | sign, signat, signplace | The position of the sign bit 1..64. If this option is specified, for the incoming data the result of byte permutation and bit masking is treated as a signed number in the complement format. For the outgoing data, negative numbers are converted to the complement format first with the sign placed into the specified position. For instance, if sign=3, then the bit sequence 101 is treated as -3 = -(not 101 + 1). | N/A | ||||||||||||||||||||||||||||||||
| single | The value, when real and binary
is interpreted as a single precision IEEE 754 float. The number of bytes
is determined by the length. The representation is big-endian:
Here, the bit order shown in the bytes is big-endian (the most significant bit is the leftmost one),, the number is S·F·2E:
|
single | |||||||||||||||||||||||||||||||||
| type | t, typ | The MODBUS register type (see) | word | ||||||||||||||||||||||||||||||||
| xor | x | The value is the 64-bit xor-mask applied to the incoming and outgoing data. It is a based unsigned integer. | 0 |
The following types (case insensitive) of the MODBUS registers are supported:
| Type | Abbreviations | Read command | Write command | Description |
| bits | b, bit | FC1, read coils | FC15, force coils | The value of the LabMap register is interpreted as a sequence of bits (up to 64 bits). Depending on the I/O direction the sequence of bits can be either read (output register) or written (input register). The address is the bit address of the first bit in the sequence. The least significant bit of the register value corresponds to the first bit on the hardware side. I.e. the value 10 decimal corresponds to the sequence of bits 1010, where 0 is the first bit of the sequence. |
| coil | c | FC5, write coil | This type is provided for input integer registers in order to support legacy MODBUS servers incapable of handling the FC15 command. The effect of sending an integer register of this type is that the coil is set on when the register value is not zero. When the value is zero the coil is set off. The parameter length, when specified, must be 1. | |
| integer | i, int, signed | FC3, read multiple registers | FC16, write multiple registers | This is similar to word (see below), but used for signed numbers. The negative values are represented as 2n + value, where n is the number of bits (binary complement format). The result is read/written as if it were of the type word. |
| word | w, words | FC3, read multiple registers | FC16, write multiple registers | The value of the LabMap register is interpreted as a sequence of words (two bytes each). Depending on the I/O direction the sequence of words can be read or written. The address is the word address of the first word in the sequence. The most significant bytes of the value go first in the sequence. |
| real | r, ieee | FC3, read multiple registers | FC16, write multiple registers | This type is used for only real registers. The values are either 4 or 8 bytes IEEE 754 real numbers packed into a sequence of two or four words respectively. For 8 bytes number the low order 32-bits of the mantissa are ignored when read and set to 0s when written. The byte layout is defined by the permutation parameter. The parameters sign position, shift, and-mask, or-mask, xor-mask can also be applied, though not recommended. The pre- and post- data processing are as described below. |
| permutated | p, permutation | FC3, read multiple registers | FC16, write multiple registers | This type is an equivalent to the type word, but
additionally it allows pre- and post-processing of the incoming and
outgoing data. The outgoing data are post-processed as follows:
The low order bits (according to the parameter length) of the result is sent to the hardware. The incoming data are pre-processed as follows:
|
The parameters permutation, and-mask, or-mask, xor-mask, shift and sign position can be specified for only the types permutated and real.
All register policies are allowed. If an output register is requested using on change or each policy, it will be automatically polled in background. One may use integer, real or string register types. The register value is converted as necessary. It is useful to have a ModBus register real, while the corresponding MODBUS register is integer. This allows to integrate the scaling operation into the hardware unit and access the values in their native units. For instance, let an analogue input is used for a temperature sensor (address 10). The analogue input has the value range 0..216-1 (0..65535). Let 0 correspond to the temperature -20°C and 65535 to 250°C. The hardware unit of the register should the following form a * K + b. Here K (kelvin) indicates that this is a temperature. The constants a and b can be found from the following set of equations:
-20°C = 253.15K = a*0 + b
250°C = 523.15K = a*65535 + b
So b = 253.15 [K] and a * 65535 + 253.15 = 523.15. This gives a = 280/65535 = 0.00412. Thus the register can be declared as:
>ModBus>[°C:0.00412*K+253.15:°C]O:R:-1:100:-1:-1:Temperature [Coupler1.t=w:addr=10.l=16]
In this case the values read from the two byte analogue input located at the address 10, will be automatically converted to temperature.
Configuration of various MODBUS couplers
All MODBUS couplers presented here work according to the same principle. The I/O modules behind the coupler are accessible over the MODBUS addresses mapped into the coupler's address space. The address values depend on the type of the coupler and is represented in the following table:
| Coupler type (vendor) | Digital input table start address | Digital output table start address | Analog input table start address | Analog output table start address |
| WAGO Fieldbus controller 750-842 |
0 | 0 | 0 | 0 |
| Phönix contact FL IL 24 BK-PAC Ethernet/Inline bus terminal |
0 | 38410 | 19210 | 57610 |
| Beckhoff Buscoupler for Ethernet BK9000 |
0 | 204810 | 0 | 204810 |
For all types of couplers the make-up of the I/O modules connected to a coupler results in different mapping of the corresponding I/O data into the address space of the coupler. When new modules are added at the end of the modules chain, the address mapping of the previous modules does not change. The data addresses of the added modules will have, depend on the addresses obtained by the previous modules. For information about the necessary address ranges of an I/O module see the appropriated manual from the vendor web site. (Phoenix, WAGO, Beckhoff)
An input variable on the hardware side is represented with an output handle on the LabMap side. An output variable on the hardware side is represented with an input handle on the LabMap® side.
| Coupler type (vendor) |
Notes and references |
| WAGO Fieldbus controller 750-842 |
For further information (e.g setup) refer Modular I/O System ETHERNET TCP/IP 750-342, 750-842 Manual. |
| Phönix contact FL IL 24 BK-PAC Ethernet/Inline bus terminal |
The coupler has a Web server, which generates the required pages for Web-based management and, depending on the requirements of the user, sends them to the "Factory Manager" or a standard Web-browser. Web-based management can be used to access static information (e.g., technical data, MAC address) or dynamic information (e.g., IP address, status information) or to change the configuration (password-protected). To use LabMap with the FL IL 24 BK-PAC change the configuration as follow:
For further information refer: |
| Beckhoff Buscoupler for Ethernet BK9000 |
For further information refer Documentation for the Beckhoff BK9000 Buscoupler for Ethernet |
5.14. ExtFix interface (LabExtFix)
This is the interface to the external fixation device (logger) used in Medizinishe Universität zu Lübeck. The interface is implemented by the LabExtFix.dll. An example of a register declaration:
>ExtFix>[::]O:I:0:0:-1:-1:On-line channel 1 [Device.1st on-line channel]
Here the additional register properties specification is [Device.1st on-line channel]. It has the format <server>.<name>. The field <name> indicates the logger's data requested via the register. In the given example it is the first on-line channel (1st on-line channel). The field <server> (Device) indicates the name of the server the register should be taken from. For each server name there should be a string registry key containing the number of the COM port the logger device is connected to. In the given example there should be ExtFix.Device registry key. The serial port used for the communication should have the following settings (Start / Settings / ControlPanel / Ports):
Baud rate: 115200 Data bits: 8 Parity: none Stop bits: 1 Flow control: none
The following table provides the list of valid names:
| Name (case insensitive) | Type | I/O direction | Description |
| 1st on-line channel | Integer, Real | Output | The value of the first on-line channel. When any of four on-line channels is requested the device responses with the new values of all four on-line channels. In other words only one channel (no matter which) should be requested. Note also that the device has the internal polling frequency 6.4 Hz. It means that it has no sense to query for new values more frequently. |
| 2nd on-line channel | Integer, Real | Output | The value of the second on-line channel |
| 3rd on-line channel | Integer, Real | Output | The value of the third on-line channel |
| 4th on-line channel | Integer, Real | Output | The value of the fourth on-line channel |
| Dump | Integer | Input | This register is used to request off-line data. The value is the number of the off-line channel 1..4 which data has to be requested. When sent the interface reads the values of the channel logged by the device. The progress of the operation is indicated by the Progress register. In the result of the channel dump, its off-line data become ready to request via the corresponding off-line channel register. |
| Progress | Real | Output | This register is indicates the progress of a off-line channel dump operation. A request to this register gives the current state of the channel dump 0..1, where 1 means ready. |
| 1st off-line channel | Integer, Real, String | Output | The value of the first off-line
channel. Before requesting the off-line data one should dump them
from the logger using the Dump register.
After a request to the register 1st count will returns the number of
off-line values currently available for requesting. Each request to the
1st off-line register will extract the most aged off-line value of the
1st channel and diminish the 1st count. Thus an application may read
the channel data using the following sequence:
The requested off-line register values can be filtered using the Filter register. The off-line registers will receive when requested only the values with the time stamp greater than one of the Filter register. When the off-line channel register can be a string. In this case the data exchange is made by 64K blocks. Each request to the off-line channel register stores up to 64*1024/sizeof (int) values. The register time stamp is equal to one of the first value in the buffer. The actual number of the values stored in the register buffer can be obtained as the length of the register divided to sizeof (int). |
| 2nd off-line channel | Integer, Real, String | Output | The value of the second off-line channel. |
| 3rd off-line channel | Integer, Real, String | Output | The value of the third off-line channel. |
| 4th off-line channel | Integer, Real, String | Output | The value of the fourth off-line channel. |
| 1st count | Integer | Output | The number of values of the first off-line channel ready to request. |
| 2nd count | Integer | Output | The number of values of the second off-line channel ready to request. |
| 3rdcount | Integer | Output | The number of values of the third off-line channel ready to request. |
| 4th count | Integer | Output | The number of values of the fourth off-line channel ready to request. |
| Command | String | Input | When sent the value of the register is transmitted as-is to the device. The response is placed into the Response register. This feature is provided for debugging purposes. |
| Filter | any | any | The time stamp of this register is used for filtering the off-line channels. |
| Response | String | Output | Here the device raw response is placed. See the Command register |
| Serial number | Integer | Output | When requested the interface stores the device serial number into the register. The register can be requested either directly or using the Dump register. The serial number is also set when the unit number is requested. |
| Unit number | Integer | Output | When requested the interface stores the device unit number into the register. The register can be requested either directly or using the Dump register. The unit number is also set when the serial number is requested. |
5.15. VCI (virtual CAN interface, LabVCI)
The VCI interface is provided by the LabVCI.dll. The interface supports a variety of CAN cards produced by IXXAT. Several cards and multiple CAN ports can be used simultaneously. A VCI register could be defined as:
>VCI>[::]O:I:0:-100:514:295:5 [Board1.ID=5.length=7.p=0123456]
Here the additional register properties specification is [Board1.ID=5.length=7.buffer=5.p=0123456]. It has the format <board>.[<parameter> [<parameters>...]. Parameters can be separated by spaces, colons and points. Each parameter has the format <name>=<value>. In the given example <board> is Board1, the parameters are ID=5, length=7 and p=0123456. <board> indicates the name of a CAN adapter. For each board name there should be a string registry key named VCI.<board> containing a description of the board. In the given example there should be a registry key named VCI.Board1. The description of the board specifies the adaptor type, location, number of CAN ports, their baud rates, operating modes and memory used for buffered I/O. The following table provides the list of the valid VCI register parameter names (case insensitive):
| Name | Abbreviations | Description | Default | ||||||||||
| and | a, andmask | See and-mask | all bits set | ||||||||||
| binary | b, bin | See binary | non-binary | ||||||||||
| can | c | The value is the number of the CAN-bus port used for communication. The adapter card may have several ports numbered starting with 0. Note that each referenced port shall be configured in the board description registry key (VCI.<board>) | 0 | ||||||||||
| id | i | The value is the CAN arbitration ID. Different registers may share arbitration ID. It is a based unsigned integer or the wild-card *. When the CAN arbitration ID is specified as *, i.e. id=*, the register works in a special way depending on the I/O direction. | 0 | ||||||||||
| double | See double | single | |||||||||||
| length | len, l | The length of the data field in bytes. CAN-bus messages may contain up to 8 bytes data. It is a based unsigned integer. | 8 | ||||||||||
| or | o, ormask | See or-mask | 0 | ||||||||||
| permutation | p, byteorder | See permutation | 87654321 | ||||||||||
| shift | <<, >> | See shift | 0 | ||||||||||
| signposition | sign, signat, signplace, signpos | See sign position | N/A | ||||||||||
| single | See single | single | |||||||||||
| status | stat, state | CAN bus general status as responded by a CAN controller.
When specified no other parameters are allowed except than the CAN
port parameter. Only output integer registers are
allowed. When requested the result is the status of the CAN controller:
|
N/A | ||||||||||
| xor | x | See xor-mask | 0 |
The input VCI registers are used for sending CAN data frames. The outgoing data are post-processed as follows:
The 'upon request' and 'on change' output registers accept unsolicited CAN data frames. For the 'on change' registers the data have an effect on the register value only if they comprise a value different from the actual register value. The 'upon request' registers accept any data. A call to LabMapRequest causes sending a CAN remote frame. The 'upon request' and 'on change' registers can be used when the communicated CAN device sends the data frames either in arbitrary manner or in response to a CAN remote frame. In contrary to this the 'each' registers accept the data periodically. They accept all data frames regardless to their content. One can use such registers the CAN device sends data frames periodically. The incoming data are pre-processed as follows:
Special registers can be specified as ones having the arbitration ID=*. Such registers can be only of string type. They may not have any parameters specified other than the CAN port number or maybe the length of the hardware buffer (if applicable).
A description of an CAN adapter card supported by the VCI interface has the following syntax:
{<adapter-type>:<adapter-number>|<adapter-key>}:<port-data>[,<port-data>]
Here <adapter-type> is one from the table below:
| Adapter type | Bus |
| iPC-i165/ISA iPC-i320/ISA iPC-i386/ISA |
ISA |
| CANdy CANdy-lite |
LPT |
| iPC-i165/PCI iPC-i320/PCI PC-i04/PCI |
PCI |
| tinCAN byteflightCAN |
PCMCIA |
| USB | USB |
The <adapter-number> is a positive number specifying the adapter number. Adapters of same type are enumerated from 1. Note that adapters of different types have independent numeration. If only one adapter of a given type is present, its number is always 1. An alternative way to specify an adapter is to use <adapter-key>, which is a number uniquely identifying it. The numbers are installation dependent.
The list of <port-data> describes the CAN ports of the adapter. An adapter depending on its type may support several CAN ports. To make it available for use by a VCI register, one should specify it in the list. The ports in the list are enumerated from 0. Each element of the list (i.e. <port-data>) has the following the syntax:
<baud>:<mode>:<send>:<receive>[:<max-delay>][:async]
| Parameter | Description |
| <baud> | The baud rate (kBaud). The only allowed values are: 1000, 500, 250, 125, 100, 50, 20, 10. It is a based unsigned integer. |
| <mode> | The operating mode is either 11 or 29. The number represents the number of arbitration bits used. |
| <send> | The size of the send buffer in CAN telegrams. It shall be greater than 20. It is a based unsigned integer. |
| <receive> | The size of the receive buffer in CAN telegrams. It shall be greater than 20. Note that the buffer should be big enough to buffer all incoming telegrams without data loss. It is a based unsigned integer. |
| <max-delay> | The maximal delay in ms, a received CAN telegram may stay in an internal buffer before it will be processed. Processing is initiated either by filling up the buffer or by expiring the time period specified by this parameter. Use smaller values for better response time and greater values when receiving a large amount of data. |
| async | Normally the time stamps of the output VCI registers are generated from the time stamps of the corresponding CAN messages. For this the onboard quartz generator is used. The option async, when specified, prohibits use of the onboard generator. The effect of this option is that the registers time stamps are generated from the CPU clock rather than from the onboard generator. Such time stamps might be more reliable but less accurate. |
Here is an example of a board description:
tinCAN:1:500:11:100:200
The DMX interface is provided by the LabDMX.dll. The interface supports DMX adapters. Only input registers are allowed. A DMX register could be defined as:
>DMX>[::]I:I:0:-100:514:295:5 [Board1.5]
Here the additional register properties specification is [Board1.5]. It has the format <board>.<channel>. Here <channel> is either
In the given example <board> is Board1, the channel number is 5. <board> indicates the name of an DMX adapter. For each board name there should be a string registry key named DMX.<board> containing a description of the board. In the given example there should be a registry key named DMX.Board1. A description of an DMX board has the syntax <type>[:<parameter>[:<parameter>].]. Here <type> is a specification of the hardware. <parameter> provides additional information to the way the hardware should operate.
| Type | Second parameter | Third parameter | Description | Example | Channels |
| USB | The minimal time (ms) period between two send operations. Lesser values improve reaction time but also require more CPU time, because each write operation causes 512 bytes to be sent. The default value is 50[ms]. | - | This board type supports the USBDMX1 and USBDMX2 adapters of the firm Soundlight. The dynamic-link library dashard.dll is required as well as the drivers provided by Soundlight. dashard.dll should be placed into the Windows system directory. Note that the adapter can plugged on the fly. The interface will periodically try to detect whether an adapter is present. Note that only one USB adapter at time is supported by dashard.dll. | USB:100 | 1..512 |
| USBDMX-One | The number of the USBDMX-One adapter. The adapters connected to the host are numbered from 1. | The minimal time (ms) period between two send operations. Lesser values improve reaction time but also require more CPU time, because each write operation causes 512 bytes to be sent. The default value is 50[ms]. | This board type supports the USBDMX-One adapters of the firm Soundlight. The dynmaic-link library susbdmx.dll should be available along the search path. Usually it is installed with the device driver. | USBDMX-ONE:1:10 | 1..512 |
| LPTn | - | - | n is the LPT number 1..4, the adapter attached to. The dynamic-link library lpt_dmx.dll should be placed into the Windows system directory. Note that only one LPT adapter is allowed at time is supported by lpt_dmx.dll. | LPT1 | 1..48 |
5.17. IAVCAN (IAV CAN interface, LabIAVCAN)
The IAVCAN interface is provided by the LabIAVCAN.dll. The interface supports the CAN cards produced by IAV. Several cards and multiple CAN ports can be used simultaneously. A IAVCAN register could be defined as:
>IAVCAN>[::]O:I:0:-100:514:295:5 [Board1.ID=5.length=7.p=0123456]
Here the additional register properties specification is [Board1.ID=5.length=7.buffer=5.p=0123456]. It has the format <board>.[<parameter> [<parameters>...]. Parameters can be separated by spaces, colons and points. Each parameter has the format <name>=<value>. In the given example <board> is Board1, the parameters are ID=5, length=7 and p=0123456. <board> indicates the name of a CAN port. An IAV adapter may have several ports each of them is addressed as a separate board. For each board name there should be a string registry key named IAVCAN.<board> containing a description of the board. In the given example there should be a registry key named IAVCAN.Board1. The description of the board specifies the adapter type, location, number of CAN ports, their baud rates, operating modes and memory used for buffered I/O. The following table provides the list of the valid IAVCAN register parameter names (case insensitive):
| Name | Abbreviations | Description | Default | ||||||||||
| and | a, andmask | See and-mask | all bits set | ||||||||||
| binary | b, bin | See binary | non-binary | ||||||||||
| double | See double | single | |||||||||||
| extendedid | extended, extID, extID, ext, e | The value is either 0 or 1. The value zero indicates that the arbitration ID has standard 11-bit size. The value one is used for extended 29-bit arbitration IDs. For an output register this parameter does not influence the register's ability to receive CAN messages with IDs of any length. | 0 | ||||||||||
| id | i | The value is the CAN arbitration ID. Different registers may share arbitration ID. It is a based unsigned integer or the wild-card *. When the CAN arbitration ID is specified as *, i.e. id=*, the register works in a special way depending on the I/O direction. | 0 | ||||||||||
| length | len, l | The length of the data field in bytes. CAN-bus messages may contain up to 8 bytes data. It is a based unsigned integer. | 8 | ||||||||||
| or | o, ormask | See or-mask | 0 | ||||||||||
| permutation | p, byteorder | See permutation | 87654321 | ||||||||||
| shift | <<, >> | See shift | 0 | ||||||||||
| signposition | sign, signat, signplace, signpos | See sign position | N/A | ||||||||||
| single | See single | ||||||||||||
| status | stat, state | CAN bus general status as responded by a CAN controller.
When specified no other parameters are allowed. Only output
integer registers are allowed. When requested the result is the status
of the CAN controller:
|
N/A |
The input IAVCAN registers are used for sending CAN data frames. The outgoing data are post-processed as follows:
The 'upon request' and 'on change' output registers accept unsolicited CAN data frames. For the 'on change' registers the data have an effect on the register value only if they comprise a value different from the actual register value. The 'upon request' registers accept any data. A call to LabMapRequest causes sending a CAN remote frame. The 'upon request' and 'on change' registers can be used when the communicated CAN device sends the data frames either in arbitrary manner or in response to a CAN remote frame. In contrary to this the 'each' registers accept the data periodically. They accept all data frames regardless to their content. One can use such registers the CAN device sends data frames periodically. The incoming data are pre-processed as follows:
A description of an CAN adapter card supported by the IAVCAN interface has the following syntax:
{<port-name>|<port-position>}:<baud>:<polling-period>[:async]
| Parameter | Description |
| <baud> | The baud rate (kBaud). It is a based unsigned integer. |
| <port-name> | The adapter-specific name of the port. It might look like 'IAV UCIF 0 - Channel 0'. |
| <port-position> | A positive number identifying the port. The first available port has the number 1. The numbers are installation dependent. |
| <polling-period> | The polling period in ms. It is the maximal period of time between two reading of the incoming messages queue. To achieve a better performance one should keep this parameter adequate to the desired reaction time on the incoming CAN telegrams. |
| async | Normally the time stamps of the output IAVCAN registers are generated from the time stamps of the corresponding CAN messages. For this the onboard quartz generator is used. The option async, when specified, prohibits use of the onboard generator. The effect of this option is that the registers time stamps are generated from the CPU clock rather than from the onboard generator. Such time stamps might be more reliable but less accurate. |
Here is an example of a board description:
IAV UCIF 0 - Channel 0:500:10
int LabIAVCANGetPortName
(
unsigned Index,
const char * Name,
int Size
);
This function stores the name of the CAN port associated with Index. Index is zero based. To enumerate all available ports one can call LabIAVCANGetPortName increasing Index until ResRRRNotHandled is returned. ResRRRSuspicious is returned when the name returned via the parameter Name is longer than the buffer size indicated by the parameter Size. In which case the returned name is truncated. The names returned by LabIAVCANGetPortName are ones specified as <port-name> in a board description.
5.18. VXL (Vector XL driver library interface, LabXVL)
The VXL interface is provided by the LabVXL.dll. The interface supports the CAN cards produced by Vector Informatik GmbH. Several cards and multiple CAN ports can be used simultaneously. A VXL register could be defined as:
>VXL>[::]O:I:0:-100:514:295:5 [Board1.ID=5.length=7.p=0123456]
Here the additional register properties specification is [Board1.ID=5.length=7.buffer=5.p=0123456]. It has the format <board>.[<parameter> [<parameters>...]. Parameters can be separated by spaces, colons and points. Each parameter has the format <name>=<value>. In the given example <board> is Board1, the parameters are ID=5, length=7 and p=0123456. <board> indicates the name of a CAN port. An Vector adapter may have several ports each of them is addressed as a separate board. For each board name there should be a string registry key named VXL.<board> containing a description of the board. In the given example there should be a registry key named VXL.Board1. The description of the board specifies the adapter type, location, number of CAN ports, their baud rates, operating modes and memory used for buffered I/O. The following table provides the list of the valid VXL register parameter names (case insensitive):
| Name | Abbreviations | Description | Default | ||||||||||
| and | a, andmask | See and-mask | all bits set | ||||||||||
| binary | b, bin | See binary | non-binary | ||||||||||
| double | See double | single | |||||||||||
| extendedid | extended, extID, extID, ext, e | The value is either 0 or 1. The value zero indicates that the arbitration ID has standard 11-bit size. The value one is used for extended 29-bit arbitration IDs. For an output register this parameter does not influence the register's ability to receive CAN messages with IDs of any length. | 0 | ||||||||||
| id | i | The value is the CAN arbitration ID. Different registers may share arbitration ID. It is a based unsigned integer or the wild-card *. When the CAN arbitration ID is specified as *, i.e. id=*, the register works in a special way depending on the I/O direction. | 0 | ||||||||||
| length | len, l | The length of the data field in bytes. CAN-bus messages may contain up to 8 bytes data. It is a based unsigned integer. | 8 | ||||||||||
| or | o, ormask | See or-mask | 0 | ||||||||||
| permutation | p, byteorder | See permutation | 87654321 | ||||||||||
| shift | <<, >> | See shift | 0 | ||||||||||
| signposition | sign, signat, signplace, signpos | See sign position | N/A | ||||||||||
| single | See single | single | |||||||||||
| status | stat, state | CAN bus general status as responded by a CAN controller.
When specified no other parameters are allowed. Only output
integer registers are allowed. When requested the result is the status
of the CAN controller:
|
N/A |
The input VXL registers are used for sending CAN data frames. The outgoing data are post-processed as follows:
The 'upon request' and 'on change' output registers accept unsolicited CAN data frames. For the 'on change' registers the data have an effect on the register value only if they comprise a value different from the actual register value. The 'upon request' registers accept any data. A call to LabMapRequest causes sending a CAN remote frame. The 'upon request' and 'on change' registers can be used when the communicated CAN device sends the data frames either in arbitrary manner or in response to a CAN remote frame. In contrary to this the 'each' registers accept the data periodically. They accept all data frames regardless to their content. One can use such registers the CAN device sends data frames periodically. The incoming data are pre-processed as follows:
A description of an CAN adapter card supported by the VXL interface has the following syntax:
{<port-name>|<port-position>}:<baud>:<buffer-size>[:async]
| Parameter | Description |
| <baud> | The baud rate (kBaud). It is a based unsigned integer. The range of supported rates is 5..1000 kBaud |
| <port-name> | The adapter-specific name of the port. It might look like 'CANcaseXL Channel 1 (s/n 4554)'. |
| <port-position> | A positive number identifying the port. The first available port has the number 1. The numbers are installation dependent. |
| <buffer-size> | The maximal number of messages in the receive buffer. Note that the receive buffer contains not only the telegrams received, but also various notification events. For example, ones of successful transmission. |
| async | Normally the time stamps of the output VXL registers are generated from the time stamps of the corresponding CAN messages. For this the onboard quartz generator is used. The option async, when specified, prohibits use of the onboard generator. The effect of this option is that the registers time stamps are generated from the CPU clock rather than from the onboard generator. Such time stamps might be more reliable but less accurate. |
Here is an example of a board description:
1:500:100
int LabVXLGetPortName
(
unsigned Index,
const char * Name,
int Size
);
This function stores the name of the CAN port associated with Index. Index is zero based. To enumerate all available ports one can call LabXVLGetPortName increasing Index until ResRRRNotHandled is returned. ResRRRSuspicious is returned when the name returned via the parameter Name is longer than the buffer size indicated by the parameter Size. In which case the returned name is truncated. The names returned by LabXVLGetPortName are ones specified as <port-name> in a board description.
5.19. PGMNet (Pragmatic Generic Multicast Network interface, LabPGMNet)
The PGMNet interface is provided by the LabPGMNet.dll. The interface supports the receiving of the data published by one or many multicast servers. A PGMNet register could be defined as:
>PGMNet>[::]O:I:0:-100:514:295:5 [Publisher1.5]
Here the additional register properties specification is [Publisher1.5]. It has the format <publisher> {<remote-register-number> | <special-register-name>}. Publisher name and the register number can be separated by spaces, colons and points. In the given example <publisher> is Publisher1, <remote-register-number> is 5, indicates the remote register number. The register number can be based. For each publisher name there should be a string registry key named PGMNet.<publisher> containing a description of the publisher. In the given example there should be a registry key named PGMNet.Publisher1. The description of the publisher specifies the multicast group, port and optionally the clock synchronization registers number. The following table provides the list of the valid names of PGMNet special register. The names are case insensitive:
| Name | Type | I/O direction | Description |
| handle | integer | output | This register can be used to enumerate the registers published by the server. When requested the current value + 1 is used as the starting point. When there is a remote register with the number greater than the current value, its number becomes the new value. Otherwise 0 is the result. When the result is not 0, then the registers name, period, status become the corresponding values as well. The register unit is changed only if the register found is real. |
| host | string | any | This register contains
description of the publisher:
|
| name | string | output | Here the name of the remote register is returned upon successful completion of a request to the handle register. |
| period | integer | output | Here QoS of the remote register is returned upon successful completion of a request to the handle register. Zero value indicates that each state change is published. A positive value indicates that consequent state changes within the period in ms indicated by the value, can be coalesced by the publisher. |
| status | integer | output | Here the status of the remote register is returned upon successful completion of a request to the handle register. The relevant bits of the status are HandleRRRStatus, HandleInput, HandleInteger, HandleReal, HandleRecord, HandleString, HandleUndefined. |
| unit | string | output | Here the dimension of the remote register is returned upon successful completion of a request to the handle register and when the corresponding remote register is real. |
Note that ordinal PGMNet registers cannot be either sent or requested. Their state always reflect one broadcasted by the publisher.
A remote publisher configuration string has the following syntax:
<publisher-configuration> ::= <group>:<port>[:<time-sync-registers>] <group> ::= <based-number>.<based-number>.<based-number>.<based-number> <port> ::= <based-number> <time-sync-register> ::= <based-number>
The fields can be separated by tabs and spaces. Fields are
An example of publisher configuration string: 233.0.0.1:0
5.20. ODBC (Open DataBase Connectivity interface, LabODBC)
The ODBC interface is provided by the LabODBC.dll. The interface supports querying ODBC-complaint databases. The architecture of ODBC is shown on the fig 5.1.
Figure 5.1. LabODBC architecture
Conceptually ODBC interface represents an ODBC
environment. Each device unit of ODBC interface is a connection to some DSN (Data Source Name). There can be an unlimited number
of device units handled by the ODBC interface and thus
any number of data sources simultaneously accessed by the user applications
through the interface. A data source can be shared between different
connections. This means, that a user application is allowed to perform multiple
data source transactions through different ODBC device
units.
The ODBC interface registers usually represent ODBC
statements. The statements are precompiled to achieve the best possible
performance. Technically it is implemented by using prepared ODBC statements. An
I/O operation invoked on a ODBC register corresponds to
an execution of the corresponding SQL query or to fetching the results of. The
query itself is stored in the register configuration. However it is also
possible to execute queries on the fly. The parameters and results of the query
are mapped to the independent registers. Customary they are User
variables, which represent the application domain specific view of the user
application on the data source. The mapping of an independent variable to some
parameter or result of a SQL query is accomplished via the parameter binding
mechanism. The parameter type coercion to the target database specific types and
back to the LabMap® registers types
is transparently performed by type conversion between C data types and SQL data
types.
An ODBC register configuration might look like:
>ODBC>[::10]!I:I:0:0:720:280::[Base1 set
INSERT INTO T1 (integer_val, text_val)
VALUES ($100:integer, $200:varchar(24))]
Here the additional register properties specification is [Base1 set...$200:varchar(24))]. It has the format <database> <form> [<query>]. All the fields can be separated by spaces, colons and points. In the given example <database> is Base1, <form> is set, <query> is INSERT...$200:varchar(24)).
5.20.1. Database description (LabODBC unit configuration)
The field <database> specifies a unit name. For each unit name there should be a string registry key named ODBC.<database> containing a description of the database. In the given example there should be a registry key named ODBC.Base1. The description of the database describes a database connection and has the following syntax:
<data-base-description> ::= <DSN>:<credentials>[:{ ro | rw }[:{ auto | manual }[:<trace-file>]]] <DSN> ::= Data source name <credentials> ::= Encrypted credential string to access the data source <trace-file> ::= Trace file name
The fields can be separated by tabs and spaces. Fields are
Figure 5.2. Configuration of ODBC DSN under Windows Server 2003®
An example of publisher configuration string: test base:0E00...No0:rw:auto
5.20.2. Forms of registers
The following table provides the list of the valid names of the forms of ODBC registers. The names are case insensitive:
| Name | Type | I/O direction | Description | ||||||||||
| row | integer | input | This register represents a row of results. The field <query>
specifies the SQL command and its parameters. The register is of integer
type, the value sent determines the action to undertake:
|
||||||||||
| transaction trans tran |
integer | input | The transaction control register. The value sent to the
register determines the action to undertake:
Note that transactions are started as necessary. This register can be also used in auto-commit mode, though it is not recommended to do. |
||||||||||
| set | any | any | This register represents a whole set of results. The field <query> specifies the SQL command and its parameters. The register can be of any type. When sent or requested (according to its I/O direction) the command is executed and its result set (if any) is traversed for each row to deliver the output parameters of the command. Note that when there are more than one row, the output parameters will be delivered for each of them starting with the first row. One can use the blackboard to monitor these. When a finer control over what has to be delivered is needed, the row form should be used instead. | ||||||||||
| statement stat |
string | input | This register is used to execute a dynamically assembled SQL command .The value sent into the register has the syntax of SQL command and its parameters. When sent it is compiled, executed and its result set is processed in exactly same way as for the set form. |
The SQL commands are specified in the <query> field and as values of the registers having the statement form. The syntax of a command is as follows:
<query> ::= [<output-parameter-list>] <statement> <output-parameter-list> ::= <output-parameter> [ ,<output-parameter>] <output-parameter> ::= {-> | #> | =>}{ <parameter> | *} <input-parameter> ::= {? | $ | @} <parameter> <parameter> ::= {value | <register-number>} : <data-type> [[<dimension>]] <statement> ::= An ODBC statement with bound parameters specified in the <input-parameter> format <data-type> ::= SQL data type specification
The syntax considers spaces, tabs, line-feeds and carriage return characters as blanks. The string literals when contain quotation marks (") and apostrophes (') double them in the body. Output parameters are used to deliver the cells of the result set into LabMap® registers. Analogously the input parameters are taken from LabMap® registers.
The following table specifies the valid SQL types, the names are case-insensitive:
| Name | Parameters of the type | SQL type as specified in ODBC | Compatible register types | ||
| Integer | Real | String | |||
| bigint | SQL_BIGINT | + | + | - | |
| binary | (<length>) | SQL_BINARY | - | - | + |
| bit | SQL_BIT | + | + | - | |
| char | (<length>) | SQL_CHAR | - | - | + |
| date[1] | SQL_TYPE_DATE | - | - | + | |
| decimal | (<precision>,<scale>) | SQL_DECIMAL | + | + | - |
| double precision | SQL_DOUBLE | + | + | - | |
| float | (<precision>) | SQL_FLOAT | + | + | - |
| guid | SQL_GUID | - | - | + | |
| integer | SQL_INTEGER | + | + | - | |
| interval day | (<precision>) | SQL_INTERVAL_DAY | + | + | - |
| interval hour | (<precision>) | SQL_INTERVAL_HOUR | + | + | - |
| interval minute | (<precision>) | SQL_INTERVAL_MINUTE | + | + | - |
| interval month | (<precision>) | SQL_INTERVAL_MONTH | + | + | - |
| interval year | (<precision>) | SQL_INTERVAL_YEAR | + | + | - |
| interval second | (<precision>,<precision>) | SQL_INTERVAL_SECOND | + | + | - |
| long varbinary | SQL_LONGVARBINARY | - | - | + | |
| long varchar | SQL_LONGVARCHAR | - | - | + | |
| numeric | (<precision>,<scale>) | SQL_NUMERIC | + | + | - |
| real | SQL_REAL | + | + | - | |
| rows | + | - | - | ||
| smallint | SQL_SMALLINT | + | + | - | |
| time[1] | (<precision>) | SQL_TYPE_TIME | - | - | + |
| timestamp[1] | (<precision>) | SQL_TYPE_TIMESTAMP | - | - | + |
| tinyint | SQL_TINYINT | + | + | - | |
| utctime[1] | (<precision>) | SQL_TYPE_TIME | - | - | + |
| varbinary | (<length>) | SQL_VARBINARY | - | - | + |
| varchar | (<length>) | SQL_VARCHAR | - | - | + |
| wchar | (<length>) | SQL_WCHAR | - | - | + |
| wlongvarchar | SQL_WLONGVARCHAR) | - | - | + | |
| wvarchar | (<length>) | SQL_WVARCHAR | - | - | + |
The names of the types and their parameters correspond to the syntax of SQL-92.
The type rows has special meaning. It is the number of rows affected by the command. This type can be used with only output parameters. Also unlikely to other output parameters its value is defined by the statement execution, rather than by a row of results. So fetching multiple or no rows would set register associated with the parameter only once. Note also that due to ODBC limitations rows is well defined for only the SQL statements INSERT, UPDATE and DELETE. For all other statements and their combinations the result is driver-dependent.
| [1] | The string format for dates is defined as follows:
|
Output parameters of a query. An output parameter specification starts with either '->' or '#>' or '=>' . This prefix defines the way the result will be set into the LabMap® register. The variant '->' sends the obtained value into it. The variant '#>' does it only when the new value differs from the current one. The variant '=>' only sets the value, without sending it. In all cases when the result is NULL, the corresponding register of the output parameter is set to StatusRRRNotReady. Instead of the register name the keyword 'value' can be used to indicate the ODBC register itself. Note that 'value' can only be used with '=>', i.e. as '=>value'. It should be used with care, because it is allowed to have value' specified for multiple input and output parameters. In this case the effect of execution will be such that the ODBC register will be set multiple times per a result row. When the operation on the register should have any effect on its value beyond one determined by usage of value, this effect is prevented. For example, when a row fetching register defines its value using a reference to value, then setting it to 0 or 1 in order to reflect the state of the result set will be abandoned.
The output parameters are specified as a comma-separated list. The order of the output parameters corresponds to the order of the columns of the result set. Columns can be skipped using '*' character placed where the register number is expected. can be used in place of the register name. is not allowed.
For a real register the dimension can be specified in square brackets. The values from the result set are assumed in the given dimension. When omitted SI units are used.
Here is the examples of input parameters specifications:
| ->100:numeric(10,3)[km/h] | A numeric value in km/h is send to the register 100 |
| =>8010:integer | An integer value will be set into the register 8010. |
| ->*, ->value:integer | Here the first column of the row is ignored |
Input parameters of a query. An input parameter specification starts with either '?', '$' or '@' character.
Instead of the register name the keyword value can be used to indicate the ODBC register itself. For a real register the dimension can be specified in square brackets. When omitted SI units are used.
Here is the examples of input parameters specifications:
| ?100:numeric(10,3)[km/h] | The value of the parameter is taken from the register 100, when undefined NULL is used instead. Otherwise the value is converted to km/h |
| $8010:integer | The value is taken from the register 8010. |
| $value | The value is one of the ODBC register. |
Diagnostics. All SQL errors in ODBC registers are reported with the status StatusRRRError. The extended error code as returned by LabMapGetError refers to the error message, which can be obtained using LabMapGetErrorText. Note that any extended error code is valid no longer another error is set into the register. For this reason the error texts should be extracted before issuing a new I/O operation on the same register.
For debugging purposes one can also use a trace file. The format of the trace file is implementation dependent.
Examples of queries.
INSERT statement
INSERT INTO T1 (x, y)
VALUES
( $100:integer,
$200:varchar(24)
)
Here the command has no output parameters and two input ones:
SELECT statement
->*,->100:integer,->200:long varchar
SELECT * FROM T1
The output parameters:
UPDATE statement
=>value:rows
UPDATE T1
SET integer_val=$100:integer,
text_val=$200:long varchar
WHERE
integer_val=$300:integer
The output parameters:
The input parameters:
5.17. Cast interface (LabCast)
The Cast interface is provided by the LabCast.dll. The interface is used to interact the operating system. Only input registers are allowed. A Cast register could be defined as:
>Cast>[::]!O:S:0:0:760:303::Computer name [NetBIOSName]
Here the additional register properties specification is [NetBIOSName]. It has the format <mode>[<parameters>].Parameters can be separated by spaces, colons and points. In the given example <mode> is NetBIOSName. The following table describes the available modes of registers (case-insensitive):
| Mode | Parameters |
I/O |
Type |
Description |
| Arguments Argument |
[<<directory>>] | input | string | This register is used to start an application with the
arguments.
Example:
Here the application notepad is called with the arguments specified by the register value. c:\temp will be used as the current directory for it. |
| <name> | ||||
| Close | - | input | integer | Sending an integer value to this register causes posing a WM_CLOSE message to the window, which handle is numerically the register value given. An eventual termination of the process associated with the window is not awaited. When posting message fails the status is StatusRRRNotAvailable and the extended error code is the Windows error code. |
| Command | [<<directory>>] | input | string | This register is used to start an application. The parameter in angle brackets <> is optional. It specifies a directory path. The directory will be used as the current directory for the application being executed. The full command line is specified as the register value. The standard system rules are applied to parsing the command line and searching for the application. The register remains in pending state as long as the application is running. Note that multiple sends will cause multiple instances of the application. The register state always reflects the latest one. When the application cannot be spawned the status StatusRRRNotAvailable is set (see LabMapGenStatus) and the extended error code is the Windows error code. When the application exists with the status different from 0, the register status is set to StatusRRRError, and the extended error code is the exit status of the application. |
| Kill | - | input | integer | When upon sending the value of this register denotes a
Cast register of one of the following modes:
then the effect of the operation will be posting a WM_CLOSE message to the main window of the application spawned by the corresponding register. An eventual termination of the application is not awaited. When the register value does not correspond to a register as specified above or when no application is running, the register status is StatusRRROffLine. When posting message fails the status is StatusRRRNotAvailable and the extended error code is the Windows error code. |
| NetBIOSname | - | output | string | This register has the value of NetBIOS name of the computer. |
| Status | [<<directory>>] | output | integer | This register is used to start an application with the
arguments.
Example:
Here the batch file d:\scripts\run.bat with the argument start is executed in the directory c:\temp. |
| <name> | ||||
| System Sys |
[automatic] | any | integer real string |
This register can be used to access system
registry. Input registers write the registry, Output registers read it.
The mode determines the root registry folder to access:
The optional parameter automatic abbreviated as auto, when specified allows creation of the registry folder and key if they are not already exist. Newly created output register keys are initialized with values according to the register type:
The parameter <name> determines the key path following HKEY_LOCAL_MACHINE when the mode is System or HKEY_CURRENT_USER when the mode is User. The path is specified in the format required by the operating system. Registry folders are separated by the back slash (\). The text following the last back slash is the registry key. The prefix is the key path. Example:
Here the full registry key path is HKEY_CURRENT_USER\SessionInformation\ProgramCount. The key name is ProgramCount. The key will be created as necessary, when does not exist. The order of the keywords automatic and system / user, can be changed. So that the example above can be also specified as:
Upon registry I/O errors the register receives the status StatusRRRNotAvailable and the extended error code is the Windows error code. |
| key | ||||
| <name> | ||||
| User | [automatic] | any | integer real string |
|
| key | ||||
| <name> |
6.1. LabView (LabMap API wrapper vi's)
LabMap provides a set of function block which can be used in LabView. The functions are splitted in four main function groups.
- Select the labmap.mnu file
6.2. LabView Event functions for LabMap Callbacks
The following functions exported by the lablabview.dll can be used to implement labmap callbacks into a labview event driven block diagram.int LabMapRegisterIntEventThis function registers a list of integer handles for a labview event driven block diagram.
( LVUserEventRef *msg,
unsigned int *HandleList,
int count,
BOOL bCatchAll
);
6.2.2. LabMapRegisterRealEvent
int LabMapRegisterRealEventThis function registers a list of real handles for a labview event driven block diagram.
(
LVUserEventRef *msg,
unsigned int *HandleList,
int count,
BOOL bCatchAll
);
6.2.3. LabMapRegisterStringEvent
int LabMapRegisterStringEventThis function registers a list of string handles for a labview event driven block diagram.
(
LVUserEventRef *msg,
unsigned int *HandleList,
int count,
BOOL bCatchAll
);
6.2.4. LabMapUnRegisterIntEvent
void LabMapUnRegisterIntEventThis function unregister the integer handle specified by the HandleNo from the labview user event.
(
unsigned int HandleNo
);
6.2.5. LabMapUnRegisterRealEvent
void LabMapUnRegisterRealEventThis function unregister the real handle specified by the HandleNo from the labview user event.
(
unsigned int HandleNo
);
6.2.6. LabMapUnRegisterStringEvent
void LabMapUnRegisterStringEventThis function unregister the string handle specified by the HandleNo from the labview user event.
(
unsigned int HandleNo
);
int LabMapRegisterEventThis function register the handle specified by the HandleNo for a labview event driven block diagram.
(
LVUserEventRef *msg,
unsigned int HandleNo,
BOOL bCatchAll
);
void LabMapUnRegisterEventThis function unregister the handle specified by the HandleNo from the labview user event.
(
unsigned int HandleNo
);