NIDa Ottimizzazione dei Sistemi di - Pragma Eng

26

Transcript of NIDa Ottimizzazione dei Sistemi di - Pragma Eng

Multithreading in NI TestStand - 2NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Ottimizzazione dei Sistemi di Test Automatico:

Multithreading in NI TestStand

Ing. Luigi MagniResponsabile Sviluppo ATS

Pragma Engineering Srl(Perugia – Italy)

Multithreading in NI TestStand - 3NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Sommario

• Profilo aziendale• TestStand

– Architettura– Caratteristiche

• Multithreading– Concetti generali– in TestStand

• Casi applicativi

Multithreading in NI TestStand - 4NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Profilo Aziendale

Fondata nel 1994 Pragma Engineeringnasce dall’unione di competenze nella progettazione hardware e software mirate a fornire servizi e sistemi integrati sia in campo industriale che in R&S.

Multithreading in NI TestStand - 5NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Profilo Aziendale

Nel 1999 Pragma diventa AM - NI

Nel 2002 due sedi operative distinte:– Divisione Sistemi Industriali (Perugia)– Divisione Tecnologie per la Riabilitazione (Trevi)

Nel 2004 diventa WEPNel 2005 diventa Certified AP - NINel 2007 ottiene la Certificazione

di Qualità UNI EN ISO 9001:2000

Multithreading in NI TestStand - 7NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Profilo Aziendale - ATS

Progettazione e realizzazione di sistemi di test automatico per apparati elettronici ed elettrotecnici in ambito industriale ed aerospazio e difesa.Principali ambiti realizzativi:– Sistemi di telecomunicazione via cavo o RF (1MHz ÷ 50GHz)– Sistemi digitali analogici e mixed signal (test funzionale)– Sistemi di Burn-in con DUT in parallelo– Sistemi ad alta potenza (settore energia e distribuzione)– Sistemi per la caratterizzazione di dispositivi (passivi ed attivi)– Sistemi di diagnosi e ricerca dei guasti (pattern digitali)

Multithreading in NI TestStand - 8NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Profilo Aziendale - ATSL’intero ciclo di sviluppo dei sistemi èeffettuato internamente all’azienda.Adozione ed implementazione diarchitetture di test di tipoPersonale certificato:– 1 Certified LabVIEW Developer

(20 CLD in Italy and 921 World Wide)– 1 Certified TestStand Architect &

Certified Professional Instructor(1 CTA in Italy and 23 World Wide)

Source: NI Service – Certified Professionals Report (Dec 2009)

Multithreading in NI TestStand - 10NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Hardware

Instrument Specific DriversHardwareLayers

SoftwareLayers

IVI

SwitchExecutive

NI TestStand

Operator Interface

NxGen ATS Architettura

CodeModules

DLL ActiveX...

LabWindowsCVI

LabVIEWVI

Multithreading in NI TestStand - 11NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

TestStand - Caratteristiche

Ambiente integrato per la gestione dei test (sequence engine).

• Engine multithreaded ad alte prestazioni• ActiveX server & client con “Code adapter” multipli (LabVIEW,LabWindows/CVI, Visual C/C++ .NET C#, ActiveX, DLL e HTBasic)

• Gestione integrata delle sequenze di test e dei modelli diprocesso

• Gestione dei report (HTML, XML, ATML)• Gestione del log su database

Multithreading in NI TestStand - 13NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

TestStandFlusso di esecuzione:

Multithreading in NI TestStand - 16NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading

Cos’è: la scomposizione di un processo in piùthread (flussi di esecuzione).

Finalità: eseguire un programma alla massima velocità massimizzando lo sfruttamento delle risorse di calcolo (CPU).

Nota: necessari processori e S.O. multithreaded per supportare il parallelismo e lo scheduling dei thread

Multithreading in NI TestStand - 17NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading

Time

Thread1

Thread2

Thread3

Thread1

Pro

cess

Multitask via SWNo HW support

Multithreading in NI TestStand - 18NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading

Multitask via HWCPU multithreaded e/o

MultiCore

Multithreading in NI TestStand - 19NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

MultithreadingVantaggi- Incremento delle prestazioni- Separazione dei flussi- Confinamento dei dati/operazioni- Migliore gestione del ciclo di vita del sw Svantaggi- Complessità architettura sw (pensare in parallelo)

- Impegno nello sviluppo del codice- Gestione della sincronizzazione

Multithreading in NI TestStand - 20NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreadingin TestStand

L’engine (multithreaded nativo) si prende carico di buona parte della complessità dovuta al MT.

Modalità di implementazione del MT in TS:- Sequence coding (sync settings/steps)

- Process model (batch, parallel)

(e combinazione di entrambi)

Multithreading in NI TestStand - 21NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Coding:- step ‘syncronization properties’- sequence call ‘execution options’ (creare un nuovo

Thread/Execution)

- Syncronisation step types (gestione ecomunicazione tra thread)

Multithreadingin TestStand

Multithreading in NI TestStand - 22NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreadingin TestStand

Process model:- Sequenziale- Parallelo- Batch

Multithreading in NI TestStand - 23NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSCasi applicativi

#1 - Test funzionale e di burn-in per apparato avionico (sistema di controllo per la frenatura dei propulsori).

#2 - Burn-in esteso multi DUT per apparati di difesa (dispositivi per la sicurezza delle informazioni).

Multithreading in NI TestStand - 24NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSCaso #1

Requisiti:• Test sequenziale (singolo DUT)• Prove a T ambiente o in ciclo termico• Ampia varietà dei test• Elevata complessità di alcuni test:

– stim. analogica: generazione del segnale di velocità;– acq. analogica: lettura resolver;– controllo del dispositivo: CAN bus;– acquisizione delle correnti assorbite/generate;

Concorrentie

Sincronizzati

Multithreading in NI TestStand - 25NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSCaso #1

Hardware:• PXI

− 8461 (CAN)− 6115 (sDAQ)− 2569 (switch)

• PSU• Scope• DMM• Climatic Chamber

Multithreading in NI TestStand - 26NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSCaso #1

Flusso

Setu

p

Mai

n

Cle

anupBrake test

sequence

Setu

p

Mai

n

Cle

anupAcq Analog

sequence

Setu

p

Mai

n

Cle

anupGen Analog

sequence

Setu

p

Mai

n

Cle

anupCAN bus

sequence

Thre

ads

Start Sync Data queues StopSyncBegin End

Multithreading in NI TestStand - 28NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSCaso #2

Requisiti:• Test parallelo #25 DUT (modalità Batch)• Prove in ciclo termico di lunga durata• Possibilità di operare su singoli DUT• Routing & switching• Test sul DUT:

– Controllo continuo del dispositivo: via bus proprietario;– Analisi della comunicazione: misura della BER; Concorrenti

Multithreading in NI TestStand - 29NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSCaso #2

Hardware:• PXI

− 2576 (Mux)− 2576 (Mux)− 2569 (switch)

• PSU• DCA• Climatic Chamber

Multithreading in NI TestStand - 30NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSCaso #2

Batch model:• 1 thread (exec) per ogni DUT (fino a 25)• 1 thread per la camera climatica• 1 thread per la UI• 1 thread per il test di traffico DUT

Th#1DUTTh#2

UIThread

DUTTh#N

ChamberThread

Data queues

Notify

Data queue

Multithreading in NI TestStand - 31NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Multithreading in TSBenefici:• Massimizzazione dell’utilizzo delle risorse Hw• Scomposizione del codice (modularità

funzionale)• Ridotto impegno di codifica (senza TS)

• Elevata efficienza (engine x multicore CPU)• Tracciabilità e manutenibilità del codiceRisorse:

www.ni.com/multicore/www.ni.com/teststand/

Multithreading in NI TestStand - 32NIDays 2010

E n g i n e e r i n gE n g i n e e r i n gP r a g m aP r a g m a

www.pragmaeng.it

Divisione Sistemi Industrialivia della Pallotta, 5

06129 PerugiaTel. 075-30418Fax 075-33202

E-mail: [email protected] site: www.pragmaeng.it

Ing. Luigi Magni

PragmaEngineering S.r.l.

Stand 12