| Entrambe le parti precedenti la revisione Revisione precedente Prossima revisione | Revisione precedente |
| test_schmitt_nio [21/05/2019 16:35] – admin | test_schmitt_nio [04/02/2020 11:15] (versione attuale) – admin |
|---|
| ====== Funzione PLC: test_schmitt_nio ====== | ====== Funzione PLC: test_schmitt_nio ====== |
| Setta l'uscita a 1 quando il numero di ingressi a 1 è superiore al limente massimo impostato e 0 quando il numero di ingressi a 1 è inferiore al valore minimo impostato, altrimenti l'uscita resta inalterata | |
| | L'uscita va a 1 quando il numero di ingressi a 1 è superiore al limite massimo impostato e 0 quando il numero di ingressi a 1 è inferiore al valore minimo impostato, altrimenti l'uscita resta inalterata. |
| | |
| | Nell'esempio di seguito riportato dove il limite inferiore è uguale 1 e quello superiore uguale a 2, l'uscita va a 1 quando ci sono 3 ingressi a 1 e va a 0 quando tutti gli ingressi sono a 0 |
| |
| <code> | <code> |
| "OUT1": { | "IO2": { |
| "io_logic": 1, | "enable": 1, |
| "direction": "output", | "logic_io": 12, |
| "io_type": "digital", | "device_type": "DIGITAL_IN_PULLUP", |
| "default_startup_value": 0, | "filter": 200, |
| "inverted": 1, | |
| "filter": 127, | |
| "time_refresh": 3000, | "time_refresh": 3000, |
| "n_refresh_on": 1, | "name": "IO2", |
| "n_refresh_off": 1, | "description": "Ingresso IO2" |
| | }, |
| | "IO3": { |
| "enable": 1, | "enable": 1, |
| "plc_function": "test_schmitt_nio", // vedi descrizione | "logic_io": 13, |
| "plc_params": 33, // 0x21 0b00100001 b7:b4=numero superiore, b3:b0=numero inferiore | "device_type": "DIGITAL_IN_PULLUP", |
| "plc_linked_board_id_io_logic": [ | "filter": 200, |
| "4-11", | "time_refresh": 3000, |
| "4-12", | "name": "IO3", |
| "4-13", | "description": "Ingresso IO3" |
| "4-14" | }, |
| ], // ingressi che comandano l'uscita | "IO4": { |
| | "enable": 1, |
| | "logic_io": 14, |
| | "device_type": "DIGITAL_IN_PULLUP", |
| | "filter": 200, |
| | "time_refresh": 3000, |
| | "name": "IO4", |
| | "description": "Ingresso IO4" |
| | }, |
| | "OUT1": { |
| | "enable": 1, |
| | "logic_io": 4, |
| | "device_type": "DIGITAL_OUT", |
| | "filter": 200, |
| | "time_refresh": 3000, |
| | "default_startup_value": 1, |
| | "inverted": 0, |
| | "plc_function": "test_schmitt_nio", // setta uscita a 1 se il numero degli ingressi maggiore del max, mette zero se minore del min, altrimenti resta uguale |
| | "plc_params": [ |
| | 1, |
| | 2 |
| | ], // lista [estremo inferiore,estremo superiore] |
| | "plc_linked_board_id_logic_io": [ |
| | "*-12", |
| | "*-13", |
| | "*-14" |
| | ], |
| "name": "OUT1", | "name": "OUT1", |
| "description": "Lampadine", | "description": "Uscita 1" |
| "dtype": "Switch" | } |
| | </code> |
| | |
| | Nell'esempio di seguito riportato dove il limite inferiore è uguale a quello superiore (numero 2), l'uscita va a 1 quando ci sono 3 ingressi a 1 e va a 0 quando gli ingressi a 1 sono inferiori a 2. L'uscita resta inalterata quando ci sono 2 ingressi a 1. |
| | |
| | <code> |
| | "IO2": { |
| | "enable": 1, |
| | "logic_io": 12, |
| | "device_type": "DIGITAL_IN_PULLUP", |
| | "filter": 200, |
| | "time_refresh": 3000, |
| | "name": "IO2", |
| | "description": "Ingresso IO2" |
| }, | }, |
| | "IO3": { |
| | "enable": 1, |
| | "logic_io": 13, |
| | "device_type": "DIGITAL_IN_PULLUP", |
| | "filter": 200, |
| | "time_refresh": 3000, |
| | "name": "IO3", |
| | "description": "Ingresso IO3" |
| | }, |
| | "IO4": { |
| | "enable": 1, |
| | "logic_io": 14, |
| | "device_type": "DIGITAL_IN_PULLUP", |
| | "filter": 200, |
| | "time_refresh": 3000, |
| | "name": "IO4", |
| | "description": "Ingresso IO4" |
| | }, |
| | "OUT1": { |
| | "enable": 1, |
| | "logic_io": 4, |
| | "device_type": "DIGITAL_OUT", |
| | "filter": 200, |
| | "time_refresh": 3000, |
| | "default_startup_value": 1, |
| | "inverted": 0, |
| | "plc_function": "test_schmitt_nio", // setta uscita a 1 se il numero degli ingressi maggiore del max, mette zero se minore del min, altrimenti resta uguale |
| | "plc_params": [ |
| | 2, |
| | 2 |
| | ], // lista [estremo inferiore,estremo superiore] |
| | "plc_linked_board_id_logic_io": [ |
| | "*-12", |
| | "*-13", |
| | "*-14" |
| | ], |
| | "name": "OUT1", |
| | "description": "Uscita 1" |
| | } |
| </code> | </code> |
| | |
| | ---- |
| | |
| | {{counter}} person(s) visited this page until now. |
| | |
| | ~~DISCUSSION~~ |
| | |