Herunterladen Inhalt Inhalt Diese Seite drucken

JÄGER ADwin-Pro II Systembeschreibung Seite 471

Programmierung in adbasic
Vorschau ausblenden Andere Handbücher für ADwin-Pro II:
Inhaltsverzeichnis

Werbung

ADwin
#Include
ADwinPro_All.inc
#Define
module
1
#Define
d1
Data_1
#Define
mem_idx
Par_1
#Define
max_val
20000
#Define
seg1
max_val/8
#Define
seg2
max_val/4
#Define
seg3
max_val/8*3
#Define
blk
max_val/4
Dim
d1[max_val]
As Long
Dim
pattern
As Long
Dim
segment
As Long
Init:
Rem 1 channel continuous, mem for max_val values, 25 MHz
P2_Burst_Init(module,1,0,max_val,2,010b)
pattern
=
Shift_Left(1,module-1)'address this module only
P2_Burst_Start(pattern)
segment
=
1
Processdelay
=
20000
Event:
mem_idx
= P2_Burst_Read_Index(module)
If
(segment
= 1)
Then
If
((mem_idx
> seg1)
Rem memory index is in segments 2 or 3: read segment 1
P2_Burst_Read_Unpacked1(module,blk,0,Data_1,1,3)
segment
=
2
EndIf
EndIf
If
(segment
= 2)
Then
If
(mem_idx
> seg2)
Rem memory index is in segments 3 or 4: read segment 2
P2_Burst_Read_Unpacked1(module,blk,seg1,Data_1,blk+1,3)
segment
=
3
EndIf
EndIf
If
(segment
= 3)
Then
If
((mem_idx
> seg3)
Rem memory index is in segments 4 or 1: read segment 3
P2_Burst_Read_Unpacked1(module,blk,seg2,Data_1,blk*2+1,3)
segment
=
4
EndIf
EndIf
If
(segment
= 4)
Then
If
(mem_idx
< seg2)
Rem memory index is in segments 1 or 2: read segment 4
P2_Burst_Read_Unpacked1(module,blk,seg3,Data_1,blk*3+1,3)
segment
=
1
EndIf
EndIf
ADwin-Pro II Software, Handbuch Apr. 2021
'module no.
'holds values of channel 1
'mem position of last written value
'no. of values
'end of segment 1
'end of segment 2
'end of segment 3
'read block size
'destination array
'bit pattern to address one module
'segment that is currently written
'start with memory segment 1
'cycle time 66.6 µs -> 15 kHz
'get current mem index
'read 1. segment
And
(mem_idx
< seg3))
'read 2. segment
Then
'read 3. segment
Or
(mem_idx
< seg1))
'read 4. segment
Then
Kontinuierliche Messwertwandlung (Pro II)
Then
Then
467

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis