Herunterladen Inhalt Inhalt Diese Seite drucken

JÄGER ADwin-Pro II Systembeschreibung Seite 350

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

Werbung

Pro II: Profibus/Profinet-Schnittstelle
P2_Init_ProfinetIO
346
Beispiel
#Include
ADwinPro_All.inc
#Define
out_arr
Data_2
#Define
in_arr
Data_3
module
#Define
3
Dim
out_arr[1000]
As Long
Dim
in_arr[1000]
As Long
Dim
conf_arr[AB_WORK_ARR_LEN]
Dim
i
As Long
Dim
state
As Long
LowInit:
Processdelay
=
3000000
Rem init Profinet interface: input data area = 128 DWords
Rem and output data area = 256 DWords
Par_10
= P2_Init_ProfinetIO(module, 128, 256, conf_arr)
Event:
Rem set data in out_arr[] to be transferred
For
i
=
1
To
256
out_arr[i] = (out_arr[i] + i)
Next
i
Rem send and read data, flowrate slow
state
= P2_Run_ProfinetIO(module, out_arr, in_arr, 128, 256,
conf_arr, 1)
Par_2
=
state
Rem now process received data stored in in_arr[1..128];
Rem in_arr[129..1000] remains unused here.
ADwin
As Long
'set to 100 Hz
ADwin-Pro II Software, Handbuch Apr. 2021

Werbung

Inhaltsverzeichnis
loading

Inhaltsverzeichnis