106 lines
3.2 KiB
Markdown
106 lines
3.2 KiB
Markdown
|
|
|||
|
## 19/04/2024
|
|||
|
***
|
|||
|
#### SIPA 9.3136 Polonia:
|
|||
|
***
|
|||
|
- PLC: 10.137.48.131
|
|||
|
- HMI: 10.137.48.132
|
|||
|
- Divider: 10.137.48.133
|
|||
|
|
|||
|
#### Abilitato PUT/GET:
|
|||
|
***
|
|||
|
![[Pasted image 20240419134025.png|525]]
|
|||
|
|
|||
|
Modificato tipo di DB a non ottimizzate: DB5000 a DB5013:
|
|||
|
***
|
|||
|
![[Pasted image 20240419134429.png]]
|
|||
|
|
|||
|
Manuale Zenon:
|
|||
|
***
|
|||
|
![[Pasted image 20240419134509.png]]
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#### Modificata FC5500 - FC Any To Dint on Alarm - in vece di OUT -> InOut
|
|||
|
|
|||
|
* Creata una logica piu aggiornata a S7-1500:
|
|||
|
```pascal
|
|||
|
#t_Address := #InVar; // Open the ANY pointer so we can work
|
|||
|
IF #t_Any_UDT.Source_DataType = 16#01 THEN // Work only with bools
|
|||
|
#t_Byte := DWORD_TO_INT(SHR(IN := #t_Any_UDT.Source_Byte_Pointer, N := 3)); // Get the byte
|
|||
|
#t_Bit := DWORD_TO_BYTE(#t_Any_UDT.Source_Byte_Pointer) AND 15; // Get the bit
|
|||
|
#Alarm := PEEK_BOOL(area := #cDB, dbNumber := #t_Any_UDT.Source_DB_Number, byteOffset := #t_Byte, bitOffset := #t_Bit); // Ask the state of the bit
|
|||
|
|
|||
|
IF #Alarm THEN
|
|||
|
// First we calculate the max magnitude we need, the number of 0 to use to pack all numbers so DB[XXX] + Byte[BBB] + Bits[b] => XXXBBb
|
|||
|
IF #t_Byte = 0 THEN
|
|||
|
#t_Magnitude_Byte := 1; // In case Byte is 0 LN(0) is undefined so we use 1 to get the space for the byte
|
|||
|
ELSE
|
|||
|
#t_Magnitude_Byte := #t_Byte;
|
|||
|
END_IF;
|
|||
|
#t_Magnitude := REAL_TO_DINT(EXP(LN(10) * TRUNC(LN(WORD_TO_INT(#t_Any_UDT.Source_DB_Number)) / LN(10)) + TRUNC(LN(WORD_TO_INT(#t_Magnitude_Byte)) / LN(10))));
|
|||
|
#Value := WORD_TO_DINT(#t_Any_UDT.Source_DB_Number) * #t_Magnitude + #t_Byte * 10 + #t_Bit;
|
|||
|
END_IF;
|
|||
|
END_IF;
|
|||
|
```
|
|||
|
|
|||
|
Esempio di chiamata:
|
|||
|
```pascal
|
|||
|
CALL "FC Any To Dint on Alarm"
|
|||
|
Address :="DB Pack Alarm".A471_39_4
|
|||
|
Num_Alarm :=#T_Warning_Zone
|
|||
|
```
|
|||
|
|
|||
|
Se questo bit `"DB Pack Alarm".A471_39_4` e true ritorna 471394 su `#T_Warning_Zone`
|
|||
|
|
|||
|
|
|||
|
Prima della modifica:
|
|||
|
![[Pasted image 20240426094854.png]]
|
|||
|
|
|||
|
Dopo la modifica della FC5500
|
|||
|
![[Pasted image 20240426100225.png]]
|
|||
|
|
|||
|
|
|||
|
###### Modifica ed attiva la sezione 1 come indicato nei pdf di Alex:
|
|||
|
***
|
|||
|
SECT1 : M31 - M45
|
|||
|
SECT2: M46 - M53
|
|||
|
SECT3: M71 - M81 ( rimasto uguale )
|
|||
|
|
|||
|
|
|||
|
|
|||
|
## 21/06/2024
|
|||
|
***
|
|||
|
|
|||
|
Aggiornato il software per gestire gli V1, V3 , V13, V19, V18 e V24, V17, V23:
|
|||
|
* Section 1: il conteggio V1 farlo sulla fotocellula: FA-SA1
|
|||
|
* V3 : Lo scarto sulla fotocellula: SPO-SA1
|
|||
|
* Section 2: il conteggio V1 farlo sulla fotocellula: B1-DI1
|
|||
|
* Section 3: il conteggio V1 farlo sulla fotocellula: B1-M73 - (non tutti i pack saranno contati perché è un accumulo)
|
|||
|
|
|||
|
Usata FB1001 da Jamaica e creata nuova FB1000 per il conteggio delle ore e minutti.
|
|||
|
|
|||
|
#### FC5002 - N40:
|
|||
|
Create queste chiamate per ogni time da calcolare.
|
|||
|
```pascal
|
|||
|
L #T_StopsAlarm_Zone
|
|||
|
L DINT#0
|
|||
|
<>D
|
|||
|
= #Start
|
|||
|
|
|||
|
CALL "FB TimeElapsed SIPA SV", "DB TimerCounter Alarm S1"
|
|||
|
Enable :=#Start
|
|||
|
Seconds :=
|
|||
|
Minutes :=#Data.N7.V19
|
|||
|
Hour :=#Data.N7.V13
|
|||
|
```
|
|||
|
|
|||
|
Create queste chiamate per ogni Vx
|
|||
|
```pascal
|
|||
|
"DB Section N7.V1 S1"("Count Sensor":="FA-SA1",
|
|||
|
"Section Running Auto":="DB TT Run".TT_Run.HMI_IN_SW_ManAuto,
|
|||
|
"Reset Counter":=FALSE,
|
|||
|
di_pcs_tot=>#Data.N7.V1);
|
|||
|
```
|
|||
|
|