Jump to content
PLC Forum


Primi passi con SCL


Recommended Posts

Posted

Buongiorno a tutti, sto studiando  il linguaggio SCL e sono incappato subito subito in un problema.

Vorrei copiare il valore di un array di bool ( array da 0 a 15) in una variabile. Ho provato ad usare la funzione POKE_BOOL ma riesco a copiare solo i primi 8 valore dell'array.

La DB NON ha accesso ottimizzato

 

    array    Array[0..15] of Bool    0.0        
    indice    Int    2.0        
    valore_array_intero    DInt    4.0  

   

 

e queste sono le righe del codice

FOR "Blocco_dati_1".indice := 0 TO 15 BY 1 DO
    
    POKE_BOOL(area := 16#84,
              dbNumber := 1,
              byteOffset :=4 ,
              bitOffset := "Blocco_dati_1".indice,
              value := "Blocco_dati_1".array["Blocco_dati_1".indice]);
    
    
    
END_FOR;

IF "Blocco_dati_1".indice >= 15 THEN
    "Blocco_dati_1".indice := 0;
END_IF
;

Potete aiutarmi a capire il problema??

Grazie a tutti 


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...