This is an old revision of the document!
DEVICE RECDATA
0.1 Introduction
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.
0.2 Installation
0.2.1 Device declaration in the configuration file (.CNF)
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:
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. |
RECDATA | Keyword that identifies the devices. |
TCamp | Tempo di campionamento device (1÷255 ms). |
QCTL1 | Address bi-directional meter 1 (to prevent the device uses this resource to put the X.X character). |
QCTL2 | Address bi-directional meter 2 (to prevent the device uses this resource to put the X.X character). |
IOutA1 | Hardware address of the DAC component of analog output 1. (to prevent the device uses this resource to put the X.X character). |
IOutA2 | Hardware address of the DAC component of analog output 2. (to prevent the device uses this resource to put the X.X character). |
IntL1 | Number 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. |
IntL2 | Number of the interrupt line 2 (to prevent the device uses this resource to put the X character). |
Ing1 | Generic input 1 |
Ing2 | Generic input 2 |
Out1 | Generic output 1 |
Out2 | Generic 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
0.3 Operation
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
)
0.3.1 Available steps for storing
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.
0.4 Device error management
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
Code | Priority | Description |
---|---|---|
1 | 1 | Modified 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.
0.5 Warning device management
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.
Code | Priority | Description |
---|---|---|
1 | 0 | Command not executed |
To clear the st_warning state must be send the RSWRN command.
0.6 Commands and parameters table
0.6.1 Simbologia adottata
Il nome del parametro, stato o comando viene riportato alla sinistra della tabella.
R
Indica se il relativo parametro o stato è ritentivo (al momento dellinizializzazione del device
mantiene lo stato precedentemente definito), oppure lo stato che assume al momento
dellinizializzazione del device.
Se il device non necessita di inizializzazione il campo R indica il valore che il parametro o
stato assume allaccensione della scheda.
R = Ritentivo
0 = Al momento dellinizializzazione del device il valore viene forzato a zero.
1 = Al momento dellinizializzazione del device il valore viene forzato a uno.
- = Al momento dellinizializzazione 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 laccettazione del parametro: se vengono
introdotti dei valori esterni ai limiti impostati, il dato viene comunque accettato; pertanto
devono essere previsti opportuni controlli dellapplicativo tali da garantire il corretto funzionamento.
Per lesecuzione 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.
0.6.2 Comandi
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.
Nome | Condizioni | Descrizione |
---|---|---|
STARTR | st_rec = 0 st_error = 0 | Start recording Comanda l'inizio dell'acquisizione dei dati. Attiva lo stato st_reck. |
STOPR | st_rec = 1 | Stop recording Ferma la procedura di registrazione dati. Azzera lo stato st_rec. |
READSTEP | stepnum>stepin>1 | Read 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). |
INTENBL | capture>0 | Interrupt 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. |
INTDSBL | Nessuna | Interrupt disable Disabilita la cattura dell'interrupt. Azzera lo stato st_intenbl. |
RSCAPTURE | Nessuna | Reset capture Disattiva lo stato di st_capture. |
RSERR | Nessuna | Reset error Azzera lo stato st_error. |
RSWRN | Nessuna | Reset warning Azzera lo stato st_warning. |
0.6.3 Parametri
Nome | D | R | A | Condizioni | Descrizione |
---|---|---|---|---|---|
stepnum | L | 0 | R | Nessuna | Step 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 |
stepin | L | 0 | R-W | Nessuna | Step input Indica il numero di step che l'utente intende leggere con il comando di READSTEP. Range valido: 1 ÷ stepnum |
stepout | L | 0 | R | Nessuna | Step output Indica il numero di step disponibile alla lettura nei parametri data1, data2, data3 e data4. Range valido: -999999 ÷ 999999 |
data1 | L | 0 | R | Nessuna | Data number 1 Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione. Vedi capitolo dediato. |
data2 | L | 0 | R | Nessuna | Data number 2 Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione. Vedi capitolo dedicato. |
data3 | L | 0 | R | Nessuna | Data number 3 Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione. Vedi capitolo dedicato. |
data4 | L | 0 | R | Nessuna | Data number 4 Variabile d'uso. Al suo interno di trovano i valori catturati durante la registrazione. Vedi capitolo dedicato. |
capture | B | R | R-W | Nessuna | Capture 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. |
mode | B | R | R-W | st_rec = 0 | Recording 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 |
tbase | W | R | R | Nessuna | Time base Visualizza il tempo di campionamento programmato nel file di configurazione. |
errcode | B | 0 | R | Nessuna | Error code Indica il tipo di errore intervenuto nel sistema. Il codice è valido solo se st_error = 1 (Vedi capitolo dedicato) Range valido: 0 ÷ 100. |
errvalue | B | 0 | R | Nessuna | Error value Indica la causa dell'errore intervenuto nel sistema. Il codice è valido solo se st_error = 1 (Vedi capitolo dedicato) Range valido: 0 ÷ 100. |
wrncode | B | 0 | R | Nessuna | Warning code Indica il tipo di warning intervenuto nel sistema. Il codice è valido solo se st_warning = 1 (Vedi capitolo dedicato) Range valido: 0 ÷ 100. |
wrnvalue | B | 0 | R | Nessuna | Warning value Indica la causa del warning intervenuto nel sistema. Il codice è valido solo se st_warning = 1 (Vedi capitolo dedicato) Range valido: 0 ÷ 100. |
0.6.4 Stati
Nome | D | R | A | Condizioni | Descrizione |
---|---|---|---|---|---|
st_intenbl | F | 0 | R | Nessuna | Interrupt 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_capture | F | 0 | R | Nessuna | Interrupt 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_int1 | F | 0 | R | Nessuna | Status 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_int2 | F | 0 | R | Nessuna | Status 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_error | F | 0 | R | Nessuna | Status 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_warning | F | 0 | R | Nessuna | Status 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. |
0.7 Limitazioni
Nessuna limitazione