*** Wartungsfenster jeden ersten Mittwoch vormittag im Monat ***

Skip to content
Snippets Groups Projects
Commit 5ad76cce authored by Schabbauer, Johannes's avatar Schabbauer, Johannes
Browse files

Improve setting AOUT values at start and end of run (do not set to zero at end).

parent a6abea96
No related branches found
No related tags found
No related merge requests found
...@@ -158,12 +158,18 @@ init: ...@@ -158,12 +158,18 @@ init:
NEXT i NEXT i
'=========================== INITIALIZE AOUTS ========================== '=========================== INITIALIZE AOUTS ==========================
'Initialize set values of all output channels ' Initialize set values of all output channels
FOR i=1 TO AOUTNO FOR i=1 TO AOUTNO
set_target[i]=DATA_3[i] 'The initial output values are always given for all channels set_target[i]=ZERO
set_pid[i]=0 'At beginning all PIDs off set_pid[i]=0 'At beginning all PIDs off
NEXT i NEXT i
' Set outputs to values at t=0, if given
FOR i=1 TO AOUTNO
IF (DATA_1[i]=0) THEN
set_target[DATA_2[i]] = DATA_3[i]
ENDIF
NEXT i
'Write analog out values 'Write analog out values
P2_Write_DAC8(AOUT1,set_target,1) P2_Write_DAC8(AOUT1,set_target,1)
P2_Write_DAC8(AOUT2,set_target,9) P2_Write_DAC8(AOUT2,set_target,9)
...@@ -317,11 +323,11 @@ EVENT: ...@@ -317,11 +323,11 @@ EVENT:
IF(nextPidTime <= processIdx) Then IF(nextPidTime <= processIdx) Then
DO DO
inc pidIdx inc pidIdx
i = DATA_5[pidIdx] i = DATA_5[pidIdx] ' output channel index
set_pid[i] = DATA_6[pidIdx] set_pid[i] = DATA_6[pidIdx]
pid_sum[i] = 0 'act_values[DATA_6[pidIdx]]-N pid_sum[i] = 0 'act_values[DATA_6[pidIdx]]-N
pid_prev_dError[i] = 0 pid_prev_dError[i] = 0
i = DATA_6[pidIdx] i = DATA_6[pidIdx] ' input/PID channel index
pid_P[i] = DATA_25[pidIdx] pid_P[i] = DATA_25[pidIdx]
pid_I[i] = DATA_26[pidIdx] pid_I[i] = DATA_26[pidIdx]
pid_D[i] = DATA_27[pidIdx] pid_D[i] = DATA_27[pidIdx]
...@@ -361,9 +367,9 @@ FINISH: ...@@ -361,9 +367,9 @@ FINISH:
P2_TiCo_Stop_Process(PTR_TICO2,1) P2_TiCo_Stop_Process(PTR_TICO2,1)
'Set values of all output channels to 0V 'Set values of all output channels to 0V
for i=1 to AOUTNO 'for i=1 to AOUTNO
set_output[i]=ZERO ' set_output[i]=ZERO
next i 'next i
'Write analog out values 'Write analog out values
P2_Write_DAC8(AOUT1,set_output,1) P2_Write_DAC8(AOUT1,set_output,1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment