en:software:devices:recdata

This translation is older than the original page and might be outdated. See what has changed.

This is an old revision of the document!


DEVICE RECDATA

The internal RECDATA device is the tool that resides in CPU that allows you to manage data logging type:

  • Encoder counters
  • Axis virtual counters (is the theoretical position that must take the axis)
  • Analog outputs
  • Following error axes
  • Inputs state
  • Outputs state

To record this data is exploited the RAM of the CPU, for this reason, to use this device, the percentage utilization of data memory (USER Data memory) total shall not exceed 50%. The device occupies the 50% of the RAM.

In the configuration file (.CNF), the BUS section must be declared so that you have the hardware resources required for the implementation of the RECDATA device.
In the INTDEVICE section of the .CNF file must be add the following definition:

:info:It is necessary that each definition are present on the same line. In case you do not want to assign a resource, for example IntL, You must enter in the appropriate field the X string.
;---------------------------------
; Internal device declaration
;---------------------------------
INTDEVICE
..
<DEVICE_NAME> RECDATA TCAMP QCTL1 QCTL2 IOUTA1 IOUTA2 INTL1 INTL2 ING1 ING2 OUT1 OUT2

where:

<device name> The name assigned to the device.
RECDATAKeyword that identifies the devices.
TCampTempo di campionamento device (1÷255 ms).
QCTL1Address bi-directional meter 1 (to prevent the device uses this resource to put the X.X character).
QCTL2Address bi-directional meter 2 (to prevent the device uses this resource to put the X.X character).
IOutA1Hardware address of the DAC component of analog output 1. (to prevent the device uses this resource to put the X.X character).
IOutA2Hardware address of the DAC component of analog output 2. (to prevent the device uses this resource to put the X.X character).
IntL1Number of the interrupt line 1 (to prevent the device uses this resource to put the X character). This interrupt line can give the start to registration.
IntL2Number of the interrupt line 2 (to prevent the device uses this resource to put the X character).
Ing1Generic input 1
Ing2Generic input 2
Out1Generic output 1
Out2Generic output 2
;---------------------------------
; Internal device declaration
;---------------------------------
INTDEVICE
Rec  RECDATA  2  2.CNT01  2.CNT02  2.AN01  2.AN02  1  2  2.INP01  2.INP02  2.OUT01  2.OUT02

Below is a diagram of the operation of the RECDATA device The RECDATA device works only with the maximum resolution of the transducer (bit encoder * 4). In the case that the analog output declared in the configuration file is used by a device to analog positioning (CAMMING or EANPOS type), the monitor offers the display of the theoretical position of the axis in addition to the practical. The difference between the two counts is the following error of axis. The reference device for this information is the one that currently using the analog output hardware resource.
You can start recording via the interrupt input (IntL1)

The device uses 50% of CPU RAM memory, which is split into banks of 16 Bytes. The number of steps available for registration is indicated by stepnum parameter, which is read only, and is calculated with the formula:
stepnum = RAM available : 16
The 16 Bytes of the Bank (named step) are divided into 4 Long, named data1, data2, data3 and data4. Formatting data in memory depends on how you set the mode parameter according to the following order:
State I/O
Encoder 1
Encoder 2
Analog output 1
Analog output 2
Following error 1
Following error 2
Virtual encoder 1
Virtual encoder 2
For the user it will be difficult to interpret the data obtained without going through the QVIEW (the development software has a dedicated tool). For this reason is not delved into the topic if not upon the customer's request.

An error in the device is signaled by the st_error state.
When st_error is equal to 1, are present on the errcode variable the type of error occurred (see table) and in the errvalue variable an indication on the cause of the error

CodePriorityDescription
11Modified mode parameter during registration

If the device goes wrong, in order to start working you have to clear the st_error status through the RSERR command.

The presence of a warning in the system camming is signaled by the st_warning state.
Being caused by a minor event and being guaranteed in this situation the management of device, the tool continues his work.
When st_warning is equal to 1, are present on the wrncode variable the type of warning intervened (see table) and in the wrnvalue variable an indication as to the cause of the warning.

CodePriorityDescription
10Command not executed

To clear the st_warning state must be send the RSWRN command.

Il nome del parametro, stato o comando viene riportato alla sinistra della tabella.

R
Indica se il relativo parametro o stato è ritentivo (al momento dell’inizializzazione del device mantiene lo stato precedentemente definito), oppure lo stato che assume al momento dell’inizializzazione del device.
Se il device non necessita di inizializzazione il campo “R” indica il valore che il parametro o stato assume all’accensione della scheda.
R = Ritentivo
0 = Al momento dell’inizializzazione del device il valore viene forzato a zero.
1 = Al momento dell’inizializzazione del device il valore viene forzato a uno.
- = Al momento dell’inizializzazione del device viene presentato il valore significativo.

D
Indica la dimensione del parametro.
F = Flag
B = Byte
W = Word
L = Long
S = Single Float

0.6.1.1 Condizioni

Vengono descritte tutte le condizioni necessarie affinché il parametro sia considerato corretto o perché il comando venga accettato.
In alcuni casi vengono specificati dei valori limite per l’accettazione del parametro: se vengono introdotti dei valori esterni ai limiti impostati, il dato viene comunque accettato; pertanto devono essere previsti opportuni controlli dell’applicativo tali da garantire il corretto funzionamento.
Per l’esecuzione di un comando, tutte le relative condizioni devono necessariamente essere soddisfatte; in caso contrario il comando non viene inviato.

A
Indica la modalità di accesso.
R = Read (lettura).
W = Write (scrittura).
RW = Read / Write.

I comandi sono stati ordinati con priorità decrescente. Ad esempio, in caso di contemporaneità dei comandi INIT ed EMRG, viene acquisito per primo il comando INIT.

NomeCondizioniDescrizione
STARTRst_rec = 0
st_error = 0
Start recording
Comanda l'inizio dell'acquisizione dei dati.
Attiva lo stato st_reck.
STOPRst_rec = 1Stop recording
Ferma la procedura di registrazione dati.
Azzera lo stato st_rec.
READSTEPstepnum>stepin>1Read step
Consente di leggere lo step specificato in stepin. il dato è disponibile quando stepin=stepout. E' consigliato leggere quando non è in corso una registrazione (st_rec = 0).
INTENBLcapture>0Interrupt enable
Abilita cattura dell'interrupt indicato in IntL1 nel file di configurazione. All'arrivo dell'interrupt il devices inizierà la registrazione che verrà memorizzato in delta.
Attiva lo stato st_intenbl.
INTDSBLNessunaInterrupt disable
Disabilita la cattura dell'interrupt.
Azzera lo stato st_intenbl.
RSCAPTURENessunaReset capture
Disattiva lo stato di st_capture.
RSERRNessunaReset error
Azzera lo stato st_error.
RSWRNNessunaReset warning
Azzera lo stato st_warning.
NomeDRACondizioniDescrizione
stepnumL0RNessunaStep number
Indica il massimo numero di step possibili da registrare. Il valore viene fissato automaticamente all'accensione del sistema e non può essere variato.
Range valido: 1 ÷ 999999
stepinL0R-WNessunaStep input
Indica il numero di step che l'utente intende leggere con il comando di READSTEP.
Range valido: 1 ÷ stepnum
stepoutL0RNessunaStep output
Indica il numero di step disponibile alla lettura nei parametri data1, data2, data3 e data4.
Range valido: -999999 ÷ 999999
data1L0RNessunaData number 1
Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione.
Vedi capitolo dediato.
data2L0RNessunaData number 2
Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione.
Vedi capitolo dedicato.
data3L0RNessunaData number 3
Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione.
Vedi capitolo dedicato.
data4L0RNessunaData number 4
Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione.
Vedi capitolo dedicato.
captureBRR-WNessunaCapture mode
Definisce il modo di cattura dell'interrupt sull'impulso di zero.
0=Disabilitato.
1=One-shot su fronte di salita. Viene catturato il primo fronte di salita dell`impulso di zero dopo l`attivazione di st_intenbl.
2=One-shot su fronte di discesa. Viene catturato il primo fronte di discesa dell`impulso di zero dopo l`attivazione di st_intenbl.
Range valido: 0 ÷ 2.
modeBRR-Wst_rec = 0Recording mode
Il modo di registrazione viene definito da un Byte i cui singoli bit, se impostati a 1, abilitano l'acquisizione.
20 = Encoder 1
21 = Encoder 2
22 = Uscita analogica 1
23 = Uscita analogica 2
24 = Errore di inseguimento 1
25 = Errore di inseguimento 2
26 = Encoder virtuale 1
27 = Encoder virtuale 2
Ad esempio, se si vogliono registrare i valori di Encoder 1 e Encoder 2, si imposterà mode = 3
tbaseWRRNessunaTime base
Visualizza il tempo di campionamento programmato nel file di configurazione.
errcodeB0RNessunaError code
Indica il tipo di errore intervenuto nel sistema. Il codice è valido solo se st_error = 1 (Vedi capitolo dedicato)
Range valido: 0 ÷ 100.
errvalueB0RNessunaError value
Indica la causa dell'errore intervenuto nel sistema. Il codice è valido solo se st_error = 1 (Vedi capitolo dedicato)
Range valido: 0 ÷ 100.
wrncodeB0RNessunaWarning code
Indica il tipo di warning intervenuto nel sistema. Il codice è valido solo se st_warning = 1 (Vedi capitolo dedicato)
Range valido: 0 ÷ 100.
wrnvalueB0RNessunaWarning value
Indica la causa del warning intervenuto nel sistema. Il codice è valido solo se st_warning = 1 (Vedi capitolo dedicato)
Range valido: 0 ÷ 100.
NomeDRACondizioniDescrizione
st_intenblF0RNessunaInterrupt enabled
Segnala l'abilitazione alla cattura dello lo start alla registrazione da linea di interrupt. Viene attivato dal comando INTENBL e disattivato dal comando INTDSBL o sul fronte di salita di st_capture.
0 = Interrupt disabilitato
1 = Interrupt abilitato.
All'accensione per default viene posto a zero.
st_captureF0RNessunaInterrupt captured
Segnalazione di interrupt catturato; viene resettato con il comando RSCAPTURE.
0 = Interrupt non catturato
1 = Interrupt catturato
All'accensione per default viene posto a zero.
st_int1F0RNessunaStatus of interrupt line 1
Indica lo stato della linea di interrupt IntL1.
0 = Ingresso in interrupt disattivo.
1 = Ingresso in interrupt attivo.
All'accensione per default viene posto a zero.
st_int2F0RNessunaStatus of interrupt line 2
Indica lo stato della linea di interrupt IntL2.
0 = Ingresso in interrupt disattivo.
1 = Ingresso in interrupt attivo.
All'accensione per default viene posto a zero.
st_errorF0RNessunaStatus of device error
Indica lo stato di errore nel device.
Per la decodifica dell'errore si deve fare riferimento alla variabile errcode ed errvalue.
0 = Errore non presente.
1 = Errore presente.
All'accensione per default viene posto a zero.
st_warningF0RNessunaStatus of device warning
Indica lo stato di warning nel device.
Per la decodifica del warning si deve fare riferimento alla variabile wrncode e wrnvalue.
0 = Warning non presente.
1 = Warning presente
All'accensione per default viene posto a zero.

Nessuna limitazione

  • Last modified: 2019/08/29 17:18