Risposte nei forum create
-
AutorePost
-
Sergio Bertana
Amministratore del forumTo help you to understand better all the considerations reported before, I’ve developped an example project, that counts clocks from 4 digital inputs. As you see in the project print there are two ST programs (Source code download).
FastClockCounter: executed on Fast task acquires the 2 digital inputs of CPU module and manages two counters on them.
SlowClockCounter: executed on Slow task acquires the 8 digital inputs of estension module (Address 0) and manages two counters on them.
Considering that the program executed on Fast task it’s very short and to acquire the inputs form CPU module requires few uS, it’s possible to execute the fast task faster than every 1 mS. This allows to acquire fast clock signals, the minimum time can be set for the Fast task execution is 100 uS.
In the example project I’ve created the StartUp program, it’s executed in the Boot task and sets the Fast task execution time to 800 uS instead of the default value of 1 mS.
Sergio Bertana
Amministratore del forumThe range of frequency can be read surely in a Fast task program but you have to make some considerations.
First consideration, the program at every 1 mS acquires the clock signal status, so other than the frequency it’s important to consider the signal duty cycle. It’s important to know how much time the signal remain active and not active, these times must be longer than the execution time of the program (1 mS).
Second consideration, in the Fast task program you cannot use the logic inputs mapped in the memory (I.e. %IX0.0) because these inputs are not acquired immediately but they represent the process image. To acquire the logic inputs immediately you have to use the SysGetPhrDI, get peripheral digital input FB.
Third consideration, the inputs on CPU module can be read fast they are directly attached to the CPU. The peripheral modules are connected by using a I2C bus and to read a module it’s required about 200 uS. For these reasons it’s better to use the inputs on CPU module for the signals with higher frequency and other inputs for the lower frequency. Moreover a single read acquires all the 16 inputs on the module so if you have many clock signals it’s better to connect them to the same module.
Sergio Bertana
Amministratore del forumThe SysGetCounter FB manages the physical hardware counter that is available on the DI00 of CPU module and on some I/O extension modules (please refer to its documentation). The Relay I/O card hasn’t the counter it has only the quadrature encoder counter and for this the FB returns an error.
Now the question is how faster is the clock signal you have to count, because by reading the logic input module on Fast task you can sample frequencies up to 400 Hz.
Gennaio 29, 2014 alle 1:44 pm in risposta a: Allocazione in memoria delle variabili strutturate #38039Sergio Bertana
Amministratore del forumLa spiegazione segue quanto già detto nel post precedente riguardo all’allineamento ad indirizzi divisibili per 4 delle variabili a 4 bytes. Il compilatore considera il tipo struttura come un tipo di dati da allineare ad indirizzo divisibile per 4, essendo la lunghezza della struttura 25 bytes, l’indirizzo di allocazione della seconda struttura nell’array divisibile per 4 lo si ottiene lasciando 3 bytes liberi.
Proprio per evitare al compilatore l’onere di lasciare spazi vuoti nell’allineamento (Caratteristica che compilando per altri targets diversi da ARM potrebbe modificarsi) consiglio sempre di prestare attenzione all’allineamento dei dati nella definizioni delle strutture inserendo dei bytes dummy. La tua struttura potrebbe diventare:
ChannelSettingType : STRUCT Settings : USINT; Descrizione : USINT[ 24 ]; Dummy : USINT[ 3 ]; END_STRUCT;
Sergio Bertana
Amministratore del forumI programmi EasyBuilder ed EasyBuilderPro permettono la completa simulazione del funzionamento del programma sviluppato direttamente sul PC. Viene visualizzato un terminale virtuale che opera esattamente come il terminale reale, vi sono due tipi di simulazione.
Off-Line: Il terminale opera con tutte le sue funzioni (Macro comprese) ma non si connette al PLC.
On-Line: Il terminale opera esattamente come il terminale reale connettendosi al PLC.Nel caso del protocollo PPI per la connessione con il PLC devi utilizzare un convertitore Seriale/RS485 se il tuo PC ha una porta RS232, oppure un convertitore USB/RS485. Naturalmente devi definire nel progetto come porta di comunicazione PPI la porta seriale a cui hai connesso il PLC. Oltre a definire correttamente tutti i parametri di comunicazione.
Gennaio 29, 2014 alle 7:24 am in risposta a: Scelta tra PD-Trigger e HWg-Trigger per invio eMails #38036Sergio Bertana
Amministratore del forumOra è chiaro il motivo della tua richiesta, per quanto riguarda l’invio di eMail verso servizi pubblici che richiedono la crittografia TLS come ad esempio GMail ricordo che nella versione 2 dei dispositivi Poseidon questa è stata implementata, quindi ora possono collegarsi anche a server SMTP con crittografia TLS.
Concordo con le tue considerazioni per quanta riguarda il discorso SMS, in effetti esisteva il PD-Trigger che permetteva gratuitamente almeno 3 regole. Ora il nuovo HWg-Trigger non ha più questa possibilità, esiste una unica licenza per il prodotto che permette di definire fino a 90 regole, abbiamo inserito il prezzo della licenza nella pagina dei prodotti HWgroup.
Gennaio 28, 2014 alle 3:34 pm in risposta a: Scelta tra PD-Trigger e HWg-Trigger per invio eMails #38034Sergio Bertana
Amministratore del forumAggiungo che tramite il protocollo HWg-Push i Poseidon2 possono connettersi al portate gratuito SensDesk e tramite il portale è possibile gestire sia l’inoltro di eMails che l’inoltro di SMS collegandosi a servizi di Email2SMS (Screenshot).
Gennaio 28, 2014 alle 2:43 pm in risposta a: Scelta tra PD-Trigger e HWg-Trigger per invio eMails #38033Sergio Bertana
Amministratore del forumNon capisco la necessità di configurare più di un server SMTP, solitamente il server SMTP di inoltro è lo stesso per tutti i servizi. I servizi di Email2SMS gestiscono l’inoltro di un SMS su ricezione di una eMail, al limite per sicurezza controllano l’indirizzo del mittente (Vedi utilizzo di Skebby). I dispositivi Poseidon permetono di inviare contemporaneamente eMails fino a 5 caselle nel caso del Poseidon2 3468.
In merito alla possibilità di utilizzare i programmi PD-Trigger o HWg-Trigger per poter gestire un secondo server SMTP ricordo che il PD-Trigger è un prodotto obsoleto, non è più disponibile. Ora viene utilizzato HWg-Trigger che prevede un periodo di trial di 90 giorni e poi deve essere registrato. Non è più previsto il funzionamento gratuito fino 3 regole come era disponibile per il PD-Trigger.
Gennaio 28, 2014 alle 7:22 am in risposta a: Nuovo simulatore PLC, simulare programma PLC su PC #38032Sergio Bertana
Amministratore del forumProbabilmente non stai utilizzando l’ultima versione di LogicLab PCK033H200 Pacchetto installazione suite IEC61131-3 Vers. 2.2.0 scaricabile dal nostro sito, verifica con il menù Help->About (Screenshot).
A partire da questa versione come indicato nel post precedente è stato eliminato il target PLC Emulator 1.0, ora la simulazione è possibile senza modificare il sistema target. Tutti i progetti basati su XTarget 11.0 possono essere simulati direttamente. Il programma Marcia/Arresto infatti è basato su SlimLine MPS046B XTarget 11.0.
Sergio Bertana
Amministratore del forumCerto la procedura di Pass-Through è attiva anche sui terminali serie eMT. Per la programmazione di questi terminali si utilizza il nuovo EasyBuilderPro dal cui pannello Utility Manager è possibile attivare la procedura esattamente come veniva fatto con la vecchia serie di pannelli (Screenshot).
Gennaio 24, 2014 alle 1:46 pm in risposta a: Allocazione in memoria delle variabili strutturate #38028Sergio Bertana
Amministratore del forumPer rispondere alla tua domanda occorre fare riferimento alla architettura del sistema, in un sistema ARM come lo SlimLine le variabili a 2 bytes sono allineate ad indirizzi divisibili per 2, mentre le variabili a 4 bytes sono allineate ad indirizzi divisibili per 4. Ora la tua struttura si compone di un USINT, un UINT ed una stringa, ed è allocata all’indirizzo 2056 quindi avremo:
ADR(ChannelSettings[0].Settings) (* 2056 *)
ADR(ChannelSettings[0].ExtraSettings) (* 2058 *)
ADR(ChannelSettings[0].Descrizione) (* 2060, il campo descrizione occupa 24 bytes più 1 di terminazione *)ADR(ChannelSettings[1].Settings) (* 2085 *)
ADR(ChannelSettings[1].ExtraSettings) (* 2086 *)
ADR(ChannelSettings[1].Descrizione) (* 2088 *)… Ecc…
Il mio consiglio è di tenere sempre le strutture con il giusto allineamento quindi se puoi ridurre di un byte la descrizione trasformerei la tua nel modo:
ChannelSettingType : STRUCT
Settings : USINT;
Dummy: USINT;
ExtraSettings : UINT;
Descrizione : STRING[ 23 ];
END_STRUCT;Gennaio 23, 2014 alle 1:19 pm in risposta a: Interfacing a Gateway RS232 DLMS-MODBUS in Modbus #38027Sergio Bertana
Amministratore del forumIt could be that someone has disabled the Modbus access to the device or he has changed the TCP port from the default 502 to another. Just to know if the TCP port 502 is still on waiting connection you can refer to the messages that appear in the Toolly status window when the connection starts (Refer to screenshot).
If an Error open message appears this means that the Modbus could be disabled (In this case only Marcom can help you). If the problem is a different TCP port you have to refer to the web page (See screenshot).
I’ve tested with the Radzio program on a SlimLine CPU module and it works correctly, I have read 10 Holding registers starting from address 40000 (See screenshot).
Gennaio 23, 2014 alle 9:32 am in risposta a: Program error su compilazione programma per Slimline #38025Sergio Bertana
Amministratore del forumTanto per creare una traccia di come effettuare la lettura dei registri dal misuratore Femto D4 della Electrex ho realizzato un semplice programma Ladder che effettua la lettura da modbus di tutti 55 registri del dispositivo. Come si vede dalla stampa del programma un unico programma Ladder gestisce la lettura Modbus di tutti i registri.
Per chiarezza di programma ho definito una struttura dati di tipo FEMTOD4VARIABLES con la definizione di tutti i registri del dispositivo, la FB ModbusMaster provvederà a valorizzarli tutti ad ogni lettura (Nel mio programma viene eseguita una lettura ogni secondo). Come se vede dal datasheet del dispositivo i registri sono mappati a partire dall’indirizzo 200, ma il protocollo Modbus ha offset 1, e l’FB sottrae 1 dal valore di indirizzo definito perché i dispositivi Modbus dovrebbero aggiungere di default l’offset di 1. Alcuni dispositivi non fanno questa operazione percui potrebbe essere necessario definire indirizzo 201, allego programma sorgente.
Gennaio 22, 2014 alle 5:41 pm in risposta a: Interfacing a Gateway RS232 DLMS-MODBUS in Modbus #38024Sergio Bertana
Amministratore del forumIn the manual abstract are reported some Modbus frames, to use them, and so to try if the modbus communication works properly you can use our Toolly program. Using Toolly as a terminal emulation it’s possible to send data to a serial connection even to a TCP/IP connection. So assuming that the SlimLine is connected to the PC by Ethernet you can try Modbus communication (See screenshot).
Gennaio 22, 2014 alle 5:15 pm in risposta a: Interfacing a Gateway RS232 DLMS-MODBUS in Modbus #38023Sergio Bertana
Amministratore del forumJust to clarify, the Gateway RS232 DLMS-MODBUS is a product developped by Marcom (See the WebSite). It is based on our SlimLine ARM7 IEC61131-3 CPU module our code MPS046B100.
The software is completely developped by Marcom and we do not have any information on it, anyway the modbus TCP support is native in the SlimLine product, so I can inform how the protocol itself works, but I haven’t any informations about the Modbus registers. The Modbus protocol supports codes 0x01, 0x02, 0x03, 0x04, 0x05 0x06 and 0x10 and address starting at 40000, there is also an address’s alias at 20000 (See IEC 61131-3 Programming manual abstract).
I don’t know what program do you use to read the modbus data, I suppose that the Data address error message is returned by the program you use. In that case it could be the register address 40000 that is not managed by some SCADA programs, so I suggest to use its alias 20000.
-
AutorePost