Title: PC Based Automation
1PC Based Automation
2 3Devicenet PCI Card
- 5136-DN/5136-DNP
- DeviceNet Scanner Module / 32-Bit DLL API
4DeviceNet Scanner
- The DeviceNet Scanner Module(PCI Card) is a node
on the DeviceNet network. It administers the
exchange of I/O data between the host system and
devices on the DeviceNet network. - It manages all network communication without
intervention by the host system and Provides a
high-speed memory-mapped interface for I/O data
exchange
5Scanner Capabilities
- General capabilities
- UCMM capable (supports dynamic explicit
messaging) - Application objects in the host may be accessed
from the network via explicit messaging - Master (Group 2 Client) capabilities
- Supports Strobe and/or Poll I/O messaging
- Supports explicit messaging (I/O connection not
required) - Supports Group 2 Only Slaves UCMM capable
devices - Automatic verification of device identity
- Automatic reconnection of timed-out or faulted
Slaves - Slave (Group 2 Server) capabilities
- Supports Strobe and/or Poll I/O messaging
- Supports explicit messaging
6Scanner DLL
- DNSCAN32.DLL provides a common interface that
abstracts the physical hardware to allow one
application or DLL to interface with the DNSCAN
module on different hardware platforms without
changes. DNSCAN32.DLL is a 32-bit DLL for use
with Windows 95 and Windows NT.
7DNSCAN32.DLL provides the following services
- DLL revision information
- Hardware driver management
- Card management (multiple cards, multiple
clients) - Card abstraction using handles to eliminate the
need for the application to be aware of memory or
I/O addresses - Event notification
- I/O data access with interlock handling
- Explicit message interface with interlock
handling
8Application Stack
9(No Transcript)
10(No Transcript)
11DNS_OpenCard
- Open a card connection. The card handle returned
by this function is used by the DLL client to
identify the card to all other services. - BOOL WINAPI DNS_OpenCard( DWORD CardHandle,
TCHAR CardName, void Module, DWORD Flags )
12Arguments
- CardHandle Upon successful completion of
DNS_OpenCard CardHandle is used for subsequent
API calls - CardName The name assigned to the interface card
during hardware installation (stored in registry) - Module Embedded binary application module
pointer(Load module from disk if NULL) - Flags See Flags table below
13Return
- TRUE Success
- FALSE Error, use GetLastError to retrieve error
code
14Error Codes
- 2000 0003hex Driver not loaded
- 2000 0007hex Null pointer
- 2000 0102hex Invalid CardHandle
- 2000 0110hex Invalid Size
- 2000 011ahex Card Access Timeout
- 2000 0210hex Invalid data area
- 2000 0211hex Device not configured
- 2000 0214hex Invalid data buffer size
- 2000 021fhex Invalid DeviceId
- 2000 0222hex Connection not configured
- 2000 0224hex I/O Interlock timeout
15DNS_ReadDeviceIo
- DNS_ReadDeviceIo
- Read I/O data from a device being scanned by the
master function of the scanner. - Prototype
- BOOL WINAPI DNS_ReadDeviceIo( DWORD CardHandle,
WORD DeviceId, BYTE IoArea, void Buffer,WORD
Size)
16Arguments
- CardHandle The handle returned by DNS_OpenCard
- DeviceId Identifies the device to be read
- IoArea I/O area to be read (see IoArea table
below) - Buffer Buffer for data read
- Size Must contain the exact size, in bytes, of
the I/O area to be read
17IOAREA
- 0 DNS_INPUT1 I/O input area 1
- 1 DNS_OUTPUT1 I/O output area 1
- 2 DNS_INPUT2 I/O input area 2
- 3 DNS_OUTPUT2 I/O output area 2
18Error Codes
- 2000 0003hex Driver not loaded
- 2000 0007hex Null pointer
- 2000 0102hex Invalid CardHandle
- 2000 0110hex Invalid Size
- 2000 011ahex Card Access Timeout
- 2000 0210hex Invalid data area
- 2000 0211hex Device not configured
- 2000 0214hex Invalid data buffer size
- 2000 021fhex Invalid DeviceId
- 2000 0222hex Connection not configured
- 2000 0224hex I/O Interlock timeout
19- TRUE Success
- FALSE Error, use GetLastError to retrieve error
code
20(No Transcript)
21Routers CIP Messages
22DeviceNet ScannerSummary
- PCI Based Industrial Network Cards
- Scanner Related Definitions
- Features
- Scanner DLL
- Use DeviceNet APIs
- Gateways Routers
23DeviceNet ScannerSummary
- PCI Based Industrial Network Cards
- Scanner Related Definitions
- Features
- Scanner DLL
- Use DeviceNet APIs
- Gateways Routers
24(No Transcript)
25MessageBox(NULL, ErrorString, MB_OK,
MB_ICONEXCLAMATION ) CleanUp( CardHandle,
LibInst, ErrInst ) return out6
// loop until the keyboard is hit
while(out!6) // clean up after your done!
26PCI Based Cards-Applicom
- PC-based control/soft logic applications,
- Ethernet/IP
- Modbus on Ethernet
- Profibus-DP
27SCADA and custom developments which require
communication with remote I/Os. applicomIO
Boards for the CANopen,DeviceNet, InterBus-S,
Profibus-DP, Modbus on Ethernet and EtherNet/IP
fieldbuses. Boards are designed to allow
combination of different fieldbuses in the same
computer, for protocol management and processing
without calling upon the CPU resources. In this
way, you can optimize the performance for your
applications. applicomIO software tools for
industrial projects driver for operating
system, Console FOR Automatic detection
of devices present on the network Define
access items to the I/O data Configuration
manager to define and use several user
configurations Initialize and store the
configuration permanently in the flash memory of
the board(s) Network and devices diagnostic
tools
28 Development tools 1) a DLL library for
programming languages such as Visual C, Borland
C/C, Delphi, LabVIEW, LabWindows/CVI etc. 2)
a communication ActiveX control for developing
with tools such as Visual Basic, Delphi, etc..
This ActiveX Control has to be installed
separately, on the top of the applicomIO product
3) an RTSS library for developing or interfacing
your soft logic applications running in the
VenturCom real time environment. This library can
be downloaded on our web site. Data servers
1. an OPC server, the industry world standard for
data exchange with your SCADA applications. 2.
a DDE/SuiteLink server for data exchange with the
Wonderware FactorySuite environment (Intouch,).
3. A DAServer is also available to interface
with the new Wonderware Archestra platform. This
DAServer is provided on the Wonderware Device
Integration Products CD-ROM. 4. Drivers, ready
to use, with soft logic applications
29The applicomIO Data Access library is provided
for Windows environments as a DLL appio.dll
IT IS USED FOR 1. development of a specific
control/command application. 2. development of
an interface layer between an off the shelf
process control package and the applicomIO
boards.
30The applicomIO library offers a set of functions
which can be split into five groups The
initialization and termination functions These
functions are used to initialize and stop IO
mode. They must be called for each board
configured before calling any other library
function, as regards initialization AND at the
end of the program the termination function.
The read functions These functions are used to
retrieve the inputs of devices present on the
network. To optimize the access times to the
PROFIBUS DP Master (DPM) memory, the following
principle has been chosen Real access to the
physical memory (DPM), to read all input data is
carried out by a single call to the function
IO_RefreshInput. This function retrieves all the
data (with consistency) and stores it in local
buffers. The other read functions and the
diagnostics functions then access the
local buffers. The write functions These
functions are used to set the outputs of devices
present on the network. To optimize the access
times to the DPM memory, the following principle
has been chosen Real access to the physical
memory (DPM), to set all output data is carried
out by a single call to the function
IO_RefreshOutput. This function uses a local
write buffer.The other write functions must have
been called beforehand to form this local buffer
The configuration and diagnostics functions
these functions are used to find the network
configuration and the device operating statuses.
The miscellaneous functions these functions
are used in particular to activate the WatchDog
monitoring time, the fallback values, or read the
value of the discrete contact.
31The various functions in the applicomIO product
library return a "status" variable. This variable
provides you with information concerning the
execution of the function. Depending on the
case, this status indicates either that an
error occurred while executing the function
(e.g. bad parameters passed in the call). or
the communication status of the targeted device
(when using functions of type IO_ReadXXX). the
meaning of the various values returned in the
status Variable ARE GIVEN IN the manual dealing
with each protocol.
32The applicomIO library was designed to optimize
the data access times. It is therefore important
to understand the scheduling that the USER must
respect to acquire and write data For a read
request 1. Data acquisition (function
IO_RefreshInput) Physical retrieval of all
inputs deposited in the DPM. (ensuring data
consistency and immediate access to the memory)
and storage in a local buffer 2. Use of input
data by the application layer (from the local
buffer). For a write request 1. Composition
of the local write buffer by the application
layer. 2. Output data transfer
(IO_RefreshOutput function) All device outputs
are physically deposited in the DPM then sent on
the network
33Initialization and termination functions Initiali
zing the applicomIO product gt IO_Init End of
program gt IO_Exit Read and write functions
Input acquisition from applicomIO interfaces
gt IO_RefreshInput Read input bits gt
IO_ReadIBit Read input bytes gt IO_ReadIByte Read
input words gt IO_ReadIWord Read double input
words gt IO_ReadIDWord Write in the DPM output
area gt IO_RefreshOutput Write output bits gt
IO_WriteQBit Write output bytes gt
IO_WriteQByte Write output words gt
IO_WriteQWord Write double output words gt
IO_WriteQDWord
34 Read input bytes gt IO_ReadIByte This function
is used to read the input bytes of a device from
the local buffer. N.B. The local buffer must be
refreshed beforehand by the function
IO_RefreshInput. Prototype in C BOOL WINAPI
IO_ReadIByte ( WORD wCard, WORD wEquip, WORD
Offset, WORD Nb, BYTE TabByte, short pStatus
) Prototype in Visual Basic Public Declare
Function IO_ReadIByte Lib "appio" (ByVal wCard As
Integer, ByVal Equipment As Integer, ByVal
OffsetBit As Integer, ByVal Nb As Integer,
TabByte As Byte, status As Integer)
As Boolean Syntax C IO_ReadIByte(wCard,wEquip,
Offset,Nb, TabByte, Status ) BASIC Call
IO_ReadIByte(wCard,wEquip,Offset,Nb, TabByte(0),
Status ) Parameter Type Wcard 16 bit integer,
board number. Wequip 16 bit integer, device
number (0-255) configured. Offset 16 bit integer,
address of the first byte to be read in the
device. Nb 16 bit integer, number of bytes to be
read (1-MAX). TabByte Bytes array, receiving the
data read. Status 16 bit integer, exchange
status. Value returned TRUE if OK. If this
function returns FALSE, the status variable
contains one of the following error values.
35Status returned Status 0 Indicates that the
function was executed correctly. Status 32
Indicates that the parameters passed into the
function are not correct (E.g. Number of
variables too large). Status 36 Indicates that
the device number is not configured. Status 47
Indicates that either the board number passed
into the function is not valid, or the IO_Init
function has not been called with success for
this card. Status 93 Driver is
inaccessible. Status 255 Indicates that the
local buffer was not refreshed beforehand by the
function IO_RefreshInput. The other statuses
correspond to communication statuses of the
targeted device. The meaning of the various
values returned in the variable "STATUS" is given
in the manual relating to each protocol in the
chapter "Function returned statuses".
36example in Microsoft language C Reading input
Bytes 0 to 33 of device number 6, from board
number 1 of the applicomIO interface. include
"Appio.h" / Prototype declaration file / short
wCard 1 / Board number / short neq 6 /
Device number / short nb 34 / Number of
variables / short status / Status / long adr
0 / Address of first variable / unsigned
char tablbyte34 / Table containing the values
/ / initialize the dialog with the applicomIO
product by "IO_Init" / do IO_RefreshInput(
wCard , status) if ( !status ) IO_ReadIByte(wC
ard, neq, adr,nb, tablbyte, Status ) if (
!status ) /valid data/ else /error
display/ else /error display/ while(s
tatus 0) / execute the function "IO_Exit"
before exiting /
37The messaging mode library of the applicomIO
product is supplied as a DLL applicomio.dll Thi
s library is an appendix that can be used in
special cases requiring the messaging services
offered by the target protocol. The functionality
offered by this library is not available via
software interfaces of the highest level (data
servers). Caution the communication mechanisms
used by this library are completely different
from those used by the input/output access
library. As a result, use of this library can
have a negative impact on the performance of a
'soft logic'-type application.
38applicomIO 2.3 Messaging mode library
functions Initialization of Messaging Mode gt
AulnitBus_io This function is used to
initialize the IO mode on an applicomIO
interface. It is essential to call up this
function for each configured board before any
other function in the library. Termination of
Messaging Mode gt AuExitBus_io This function
must be called at the end of the program using
the applicomIO messaging mode (even if
AuInitBus_io returned a bad status). Transmission
of a Messaging Command gt AuWriteReadMsg_io
This function is used to send a messaging
command to a device of the fieldbus. The
messaging commands, parameters and status are
specific for each targeted fieldbus. When this
function is called up, the user has to use the
wNbRx parameter in order to indicate the maximum
size of the table of bytes to be fed back by the
function. For more information, refer to the
knowledge base article concerning your fieldbus
391 RJ45 connector for connection to the Ethernet
network (support for Ethernet Remote configuration
). 2 Ethernet transmission indicator lamps 3
Female Dsub 9-pin connector for Profibus
network. Maximum current on the 5V 150mA 4
Profibus transmission indicator lamps 5
Connector providing access to a discrete input
and output through the applicomIO
functions IO_SetWatchDog and IO_GetDigitalInput. 6
Board number configuration jumpers (1 to
8). Default configuration board 1. 7 PCI
configuration jumper (reserved for applicom
international use). Default position for the
applicomIO boards 8 socket for required
MPFB053 module for Profibus
40The applicomIO Profibus DP master
- functionality
- Class 1 DP master for optimized exchange of
input/output data with the slaves
(Data_Exchange). - Class 2 DP master for slave configuration,
initialization and diagnostics. - Class 1 and Class 2 DPV1 Master for accessing
asynchronous data from slave devices. - Multi-master to use several Profibus DP masters
on the same network. - Profibus DP master and slave simultaneously, to
exchange data with another master on the
network. - With the applicomIO Profibus DP master, you
can - Exchange up to 2 kBytes of input/output.
- Connect up to 126 slaves.
- Manage up to 244 data bytes per slave.
41(No Transcript)
42Multimaster
Local Profibus Slave
43Multimaster System
- The "Local Profibus DP slave" functionality
offers data exchange with another master on the
network. The size of the input and output data is
user-definable, and all exchange combinations are
possible (from 0 to 244 bytes). The slave can
ensure data consistency up to 122 bytes. - By allocating a device number during
configuration, access to data of local and remote
slaves is identical. - The passive Profibus DP slave does not manage the
Profibus token. - Caution
- The data transmitted by the remote master (output
variables ) refreshes the input variables in the
applicomIO interface - The data received by the remote master (input
variables) corresponds to the output variables of
the applicomIO interface.
44Device status management functions Device status
gt IO_GetEquipmentStatus Global network status gt
IO_GetGlobalStatus Device diagnostic
functions Device diagnostic gt IO_ReadDiag Global
network diagnostic gt IO_GetGlobalDiag Miscellane
ous functions List of device present on the
network gt IO_GetEquipmentList Size of device
inputs outputs gt IO_GetEquipmentInfo Get the
discrete contact gt IO_GetDigitalInput Defining
the WatchDog activation time gt
IO_SetWatchDog Retrieving the WatchDog activation
state gt IO_GetStateWatchDog Defining the
fallback value time gt IO_SetReply Retrieving
the activation state of the fallback values gt
IO_GetStateReply
45Important notes When several cards will be
used in the same PC, card number must be set
correctly on the hardware (jumper) before to
install it in your computer. For PC104 cards,
address of each card on the ISA bus must to be
set properly before to install them in your
computer. To improve the PlugPlay mechanisms,
it is highly recommended that the
applicomIO software is installed first before
installing the board(s) in the computer.
46The applicomIO and appIO DLLs are common to all
MS-Windows 32-bit platforms (WindowsNT, Windows
2000, Windows XP,). The applications developed
can therefore run on any Windows 32-bit operating
system. Caution the applicom and appIO DLLs
are installed in the applicomIO directory and
must be unique on the machine hard disk. Use of
the "APPLICOMIO.DLL" or "APPIO.DLL" DLL is
immediate. An application uses the input points
defined like any applicomIO or appIO function
making sure to respect the number of parameters
and their types. The "Pascal" call condition, in
fact, allows no errors. All functionalities and
the description of procedures in the dynamic
libraries "APPLICOMIO.DLL and "APPIO.DLL are
described in this Reference manual.
47applicom international supplies a library
compatible with this environment
"applicomio.llb". This applicomIO library
contains a series of sub-VI, each sub-VI is used
to access an applicomIOI function. In LabVIEW,
a sub-VI is inserted in a diagram with the
"functions" palette, "select a VI". Once
inserted in your diagram, the wiring of the
sub-VI is simplified by displaying the connector
pins with the "show", "terminals" menu. By
selecting the coil in the "Tools" palette, a
balloon giving the meaning of each pin is
displayed. These files are stored in the
directory LabVIEW. Help for each applicomIO
function is available in the "Help" window. More
complete online help is available if the
installation directory is the default
directory. Two examples using applicomIO with
LabVIEW are given in the directory explget.vi
uses the functions IO_Init, IO_RefreshInput,
IO_ReadIWord and IO_Exit. explset.vi uses the
functions IO_Init, IO_WriteQWord,
IO_RefreshOutput and IO_Exit.
48The procedure declarations are in the file
APPLICOMIO.VB for the messaging mode library
applicomIO.dll the file APPIO.VB for the data
access library appIO.dll. These files are stored
in the sub-directory Visual Studio\VB\VB .Net.
Insert the one you need in your project with the
"Add an existing file" option.
49Profibus/Modbus Gateway
- The Profibus DP / Modbus gateway enables a
Profibus DP controller to control, monitor and
configure up to 15 Modbus RTU devices on each
gateway. The gateway acts as a combined Profibus
DP slave and a Modbus RTU master.
50 Profibus/Modbus Gateway
PLC with Profibus Card or Profibus PCI
51Profibus/Modbus Gateway
- The gateway exchanges (writes and reads) data
cyclically with the Modbus devices this operation
is called "Modbus scanner". Each Modbus data
correspond to a cyclic data of Profibus DP. - The link between these data has to be set up at
configuration time by the user. - Once the gateway is setup the refreshment works
automatically, no special application program is
required in the PLC or PCI card for
communication.
52Profibus Master Input/Output
- The first eight bytes of the input and output
areas are reserved for the PKW (Parameter access
function) which is described in the manual - The input area also has a LAS (List of Active
Slaves) which is further described. - Remaining bytes are used for cyclic data where
the amount of available bytes is determined by
the configured PPO type. - Data that is to be written to the Modbus RTU
slaves is placed in the output area. - Data that is to be read from the Modbus RTU
slaves is placed in the input area. The input
area is read only.
53(No Transcript)
54Profibus/AS-I Gateway
55Exchanging Information via PROFIBUSDP Telegram
- In the DP telegram, logical states are exchanged
between the AS-i gateway and the digital sensors
and actuators. - In the PLC or PC based control system, sensors
and actuators are mapped in the memory as shown
in the next slide
56(No Transcript)
57- The data of AS-i slave 0 cannot be accessed
because this address is reserved for
configuration mode. - Error in the manual( and the last slide) slave
0 should be ---- and slave 1 should be
D3,D2,D1,D0 - D can be input or output
58(No Transcript)
59(No Transcript)