QEM q-move User manual

DAC internal device v. 2.6
DAC
motion controller
micro
Internal
Device

2DAC internal device v. 2.6
QEM srl
S.S. 11, Km 339
Località Signolo
36054 Montebello Vic.
Vicenza - Italy
Tel. 0444 440061 r.a.
Fax 0444 440229
e-mail: [email protected]
www.qem.it
DAC device user manual
Version 2.6 – September 2004
QEM®and QMOVE®are registered trademarks.
This manual is published by QEM srl without any kind of guarantee and we reserve the right to
make modifications of typographical errors, inaccuracies in content and improvements (also of
the products to which this manual makes reference). Any modifications will, in any case, be
inserted in the following editions of this manual.
No part of this manual can be reproduced, in any format or by any means, without the written
authorisation of QEM srl.
All rights reserved.

3DAC internal device v. 2.6
CONTENTS
INTRODUCTION .................................................................. 4
INSTALLATION.................................................................... 5
Device declaration in the configuration file (.CNF) ...................................5
Example......................................................................................5
FUNCTION ........................................................................ 6
Device configuration ....................................................................... 6
Exemple......................................................................................6
COMMAND E PARAMETER ...................................................... 7
Adopter symbols ............................................................................7
Command ....................................................................................7
R..............................................................................................7
D..............................................................................................7
Conditions ...................................................................................7
A..............................................................................................7
Parameters ..................................................................................8
Status ........................................................................................9
LIMITATIONS ...................................................................... 10
ESEMPIO APPLICATIVO.......................................................... 11
Configuration file ...........................................................................11
DAC management...........................................................................13

4DAC internal device v. 2.6
INTRODUCTION
The internal device DAC is a tool, resident in the CPU, that allows to manage an analog output
with +/- 15 bit of resolution.
The wirings and connections of the equipment described in the manual present, must respect
the European Norm En60204-1.
in outrev
A
A if B>=A
B C if B<=C
B if A<B<C
C
uplim
lowlim
DAC
Output
Address
(Ex.
2.AN01
)
out
offset
outdir

5DAC internal device v. 2.6
INSTALLATION
Device declaration in the configuration file (.CNF)
In the configuration file (.CNF), the BUS section must be declared so that the hardware resources
to implement the DAC device are available. At least one 16 bit resolution analog output must be
available.
In the INTDEVICE section of the .CNF file, the following definition must be added:
;---------------------------------
; Internal device declaration
;---------------------------------
INTDEVICE
..
<device_name> DAC IOutA
where: <device_name>Is the name of the device.
DAC Is the key word that identifies the device analog output.
IOutA Hardware address of the DAC component of the Slave analog
output.
Example
;---------------------------------
; Internal device declaration
;---------------------------------
INTDEVICE
OutAn DAC 2.AN01
The device DAC doesn’t
required any sampling time
declaration because its
output value is update only
writing on its in variable.
It is necessary than all the
shouting of definition are
restored on the same line
and in the same sequence.
The resources of the devi-
ce that are not used should
be marked from a X to the
place of their physical
address.

6DAC internal device v. 2.6
FUNCTION
Device configuration
The device DAC generates an analog output which is proportional to the value of in variable. The
value must be introduced in bit with complement to 2 binary format.
The values of the minimal and maximum analog output can be limit to you with the parameters
lowlim and uplim.
The offset parameter is a variable which to be added to the in variable in order to adjust the
analog output.
In = +32767 = + 10 V (maximum analog output value).
In = 0 = 0V (central value of analog output)
In = -32768 = - 10 V (minimum analog output value).
Exemple
OUTDIR OutAn ;Set the sign of the analog output
WAIT NOT OutAn:st_outrev ;Check the status of the device
OutAn:in = 3276 ;Set +1 V analog output
OUTREV OutAn ;Reverse the sign of analog output
WAIT OutAn:st_outrev ;Check the status of the device
In = input variable of the
device
Vout = signed analog output

7DAC internal device v. 2.6
COMMAND E PARAMETER
Adopter symbols
The name of parameter, state or control is mentioned on the left side of the table.
R
Indicates if the relevant parameter or state is retentive (at the moment of the device initialization
it keeps the previous defined state) or indicates the state when the device is initialized.
R = retentive
0 = At the moment of the device initialization, the value is forced to zero.
1 = At the moment of the device initialization, the value if forced to one.
D
Indicates the parameter dimension.
F = Flag
B = Byte
W = Word
L = Long
Conditions
All the necessary conditions are described for the parameter to be considered correct or for the
control to be accepted.
In some cases, limit values are specified for the parameter to be accepted: however, if values
external to set limits are introduced, the datum is accepted; therefore, appropriate internal
controls must be provided so as to assure correct operation.
For the execution of a control, all the relevant conditions must necessarily be satisfied; otherwise,
the control is not executed.
A
Indicates the access mode.
R = Read (reading)
W = Write (writing)
The control command available in order to manage the device are listed below.
The device performe the control commands in the same sequence that it received they.
Name Conditions Description
OUTREV st_init = 1 Output reverse
The output level sign is reversed.
OUTDIR st_init = 1 Output direct
The output level is restored to it's original sign.
Command

8DAC internal device v. 2.6
Parameters
Name DRACondition Description
in WRRW -Input DAC
It can be positive or negative.
Range: -32768 ÷ 32767 (Bit DAC).
offset WRRW -Output offset
It's the system's offset in bit. The value can be positive or
negative.
Range: -32768 ÷ 32767(Bit DAC).
uplim WRRW -Upper limit
Upper output level. If the output value is greater then the
setted level, the output reference will be setted to the Up
limit and the st_uplim status will be activated. The value can
be positive or negative.
Range : -32768 ÷ 32767(Bit DAC).
lowlim WRRW -Lower limit
Lower output level. If the output value is lower then the
setted level, the output reference will be setted to the Low
limit and the st_lowlim status will be activated. The value
can be positive or negative.
Range : -32768 ÷ 32767(Bit DAC).
out WR R -Output DAC
Simgned analog OOUTPUT of the DAC. The value is the sum
of the in and offset parameters. If the sum is greater then
the uplim or lower then the lowlim parameters, the analog
output will be limited.
Range : -32768 ÷ 32767(Bit DAC).
Status
Name DRACondition Description
st_lowlim FR R -DAC lower limit
Shows that the output value is lower then the minimum
setted level.
0 = Correct operation.
1 = Under range operation (500ms timed).
st_uplim FR R -DAC upper limit
Shows that the output value is greater then the maximum
setted level.
0 = Correct operation.
1 = Under range operation (500ms timed).
st_outrev FR R -Output reverse
Shows that the OUTREV command has been executed (the
output level sign is reversed).

9DAC internal device v. 2.6
LIMITATIONS
Not limitations.

10 DAC internal device v. 2.6
ESEMPIO APPLICATIVO
;*************************************************************************************
; Module name: Ex_Dac.CNF Project: Ex_DAC
; Writer: QEM srl Date : 01/05/99
; Sistem: QMove1 / QCL3 Library: 1LIB3B04
; Funzionalità: Esempio gestione DAC Release: 0
;--------------------------------------- Note ----------------------------------------
; [1] - Exemple of application for use device DAC
;*************************************************************************************
;-------------------------------------------------------------------------------------
; Costant definition
;-------------------------------------------------------------------------------------
CONST
;-------------------------------------------------------------------------------------
; SYSTEM variables
;-------------------------------------------------------------------------------------
SYSTEM
slOutAna L ;Variable for analog output
;-------------------------------------------------------------------------------------
; GLOBAL variables
;-------------------------------------------------------------------------------------
GLOBAL
gfCambio F ;Rising front derector of input if change out
;-------------------------------------------------------------------------------------
; TIMER variables
;-------------------------------------------------------------------------------------
TIMER
;-------------------------------------------------------------------------------------
; DATAGROUP definiction
;-------------------------------------------------------------------------------------
DATAGROUP
;-------------------------------------------------------------------------------------
; Bus configuration
;-------------------------------------------------------------------------------------
BUS 1 1CPUB 02
2 1MIXA 00
3 .
4 .
Configuration file

11DAC internal device v. 2.6
;------------------------------------------------------------------------
; INPUT variables
;-------------------------------------------------------------------------------------
INPUT
ifChangeOut F 2.INP01 ;Change the analog output
;-------------------------------------------------------------------------------------
; OUTPUT variables
;-------------------------------------------------------------------------------------
OUTPUT
;-------------------------------------------------------------------------------------
; Internal device declaration
;-------------------------------------------------------------------------------------
INTDEVICE
Nome Tipe OutAnal
Asse DAC 2.AN01
END

12 DAC internal device v. 2.6
;-------------------------------------------------------------------------------------
; Name File : TASK_00.MOD
; Project : EX_DAC
; Description : Gestione Posizionamento
;-------------------------------------------------------------------------------------
;-------------------------------------------------------------------------------------
; Device initialization
;-------------------------------------------------------------------------------------
Asse:offset = 0 ;Offset voltage
Asse:uplim = 32767 ;Max. value of analog output
;(+10V)
Asse:lowlim = -32768 ;Min. value of analog output
;(-10V)
OUTDIR Asse ;Set analog output sign
WAIT NOT Asse:st_outrev ;Check analog output sign
slOutAna = 0 ;Set analog output input variable to 0 Volt
;-------------------------------------------------------------------------------------
; Setting of the analog output
;------------------------ Used variables -------------------------------------
; slOutAna: percentage value of analog output (% of uplim)
; ifChangeOut: input used to reverse the sign of analog output
; gfCambio: flag for rising front detection of input ifChangeOu
;-------------------------------------------------------------------------------------
MAIN:
IF ifChangeOut
IF NOT gfCambio ;Wait for input activation
gfCambio = 1 ;Write the new analog output value
Asse:in = (slOutAna * Asse:uplim) /100 ;Set analog output sign
ENDIF
ELSE
gfCambio = 0 ;Write the new analog output value
ENDIF
;-------------------------------------------------------------------------------------
; Final operation
;-------------------------------------------------------------------------------------
WAIT 1
JUMP MAIN
END
DAC management
This manual suits for next models
1
Table of contents