u s i n g   S y s t e m ; 
 
 u s i n g   S y s t e m . C o l l e c t i o n s . G e n e r i c ; 
 
 u s i n g   S y s t e m . C o m p o n e n t M o d e l ; 
 
 u s i n g   S y s t e m . D a t a ; 
 
 u s i n g   S y s t e m . D r a w i n g ; 
 
 u s i n g   S y s t e m . T e x t ; 
 
 u s i n g   S y s t e m . W i n d o w s . F o r m s ; 
 
 u s i n g   C d i o C s ; 
 
 
 
 n a m e s p a c e   D i C o u n t e r 
 
 { 
 
         p u b l i c   p a r t i a l   c l a s s   D i C o u n t e r   :   F o r m 
 
         { 
 
                 / / /   < s u m m a r y > 
 
                 / / /   C r e a t e   i n s t a n c e   C d i o   c l a s s 
 
                 / / /   < / s u m m a r y > 
 
                 C d i o   d i o   =   n e w   C d i o ( ) ; 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   G l o b a l   v a r i a b l e 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p u b l i c                             s h o r t   d e v _ i d ;                         / /   D e v i c e   I D 
 
                 p u b l i c   s h o r t                 c o u n t _ c h _ n u m ;                         / /   N u m b e r   o f   c o u n t e r   c h a n n e l s   i n   t h e   d e v i c e 
 
                 p u b l i c   s t a t i c   s h o r t   M A X _ C O U N T _ C H   =   1 6 ;               / /   M a x   n u m b e r   o f   c h a n n e l s 
 
                 p u b l i c   s t a t i c   s h o r t   D I S P _ M A X _ C O U N T _ C H   =   8 ;       / /   M a x   n u m b e r   o f   c h a n n e l s 
 
 
 
                 p r i v a t e   S y s t e m . W i n d o w s . F o r m s . C o m b o B o x [ ]   m _ C o u n t E d g e                   =   n e w   S y s t e m . W i n d o w s . F o r m s . C o m b o B o x [ M A X _ C O U N T _ C H ] ;     / /   C o u n t   e d g e   c o n t r o l 
 
                 p r i v a t e   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ ]     m _ C o m p a r e C o u n t V a l u e   =   n e w   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ M A X _ C O U N T _ C H ] ;       / /   C o m p a r i s o n   c o u n t   v a l u e   c o n t r o l 
 
                 p r i v a t e   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ ]     m _ P r e s e t V a l u e               =   n e w   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ M A X _ C O U N T _ C H ] ;       / /   P r e s e t   v a l u e   c o n t r o l 
 
                 p r i v a t e   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ ]     m _ C o u n t V a l u e                 =   n e w   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ M A X _ C O U N T _ C H ] ;       / /   C o u n t   v a l u e   c o n t r o l 
 
                 p r i v a t e   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ ]     m _ C o u n t S t a t u s               =   n e w   S y s t e m . W i n d o w s . F o r m s . T e x t B o x [ M A X _ C O U N T _ C H ] ;       / /   C o u n t   s t a t u s   c o n t r o l 
 
 
 
                 
 
 
 
                 p u b l i c   D i C o u n t e r ( ) 
 
                 { 
 
                         I n i t i a l i z e C o m p o n e n t ( ) ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /     C o n t r o l   a r r a y   s e t t i n g s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   C o u n t   e d g e   c o n t r o l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         m _ C o u n t E d g e [ 0 ]   =   c o m b o B o x _ C o u n t E d g e 0 ; 
 
                         m _ C o u n t E d g e [ 1 ]   =   c o m b o B o x _ C o u n t E d g e 1 ; 
 
                         m _ C o u n t E d g e [ 2 ]   =   c o m b o B o x _ C o u n t E d g e 2 ; 
 
                         m _ C o u n t E d g e [ 3 ]   =   c o m b o B o x _ C o u n t E d g e 3 ; 
 
                         m _ C o u n t E d g e [ 4 ]   =   c o m b o B o x _ C o u n t E d g e 4 ; 
 
                         m _ C o u n t E d g e [ 5 ]   =   c o m b o B o x _ C o u n t E d g e 5 ; 
 
                         m _ C o u n t E d g e [ 6 ]   =   c o m b o B o x _ C o u n t E d g e 6 ; 
 
                         m _ C o u n t E d g e [ 7 ]   =   c o m b o B o x _ C o u n t E d g e 7 ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   C o m p a r i s o n   c o u n t   v a l u e   c o n t r o l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         m _ C o m p a r e C o u n t V a l u e [ 0 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 0 ; 
 
                         m _ C o m p a r e C o u n t V a l u e [ 1 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 1 ; 
 
                         m _ C o m p a r e C o u n t V a l u e [ 2 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 2 ; 
 
                         m _ C o m p a r e C o u n t V a l u e [ 3 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 3 ; 
 
                         m _ C o m p a r e C o u n t V a l u e [ 4 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 4 ; 
 
                         m _ C o m p a r e C o u n t V a l u e [ 5 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 5 ; 
 
                         m _ C o m p a r e C o u n t V a l u e [ 6 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 6 ; 
 
                         m _ C o m p a r e C o u n t V a l u e [ 7 ]   =   t e x t B o x _ C o m p a r e C o u n t V a l u e 7 ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   P r e s e t   v a l u e   c o n t r o l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         m _ P r e s e t V a l u e [ 0 ]   =   t e x t B o x _ P r e s e t V a l u e 0 ; 
 
                         m _ P r e s e t V a l u e [ 1 ]   =   t e x t B o x _ P r e s e t V a l u e 1 ; 
 
                         m _ P r e s e t V a l u e [ 2 ]   =   t e x t B o x _ P r e s e t V a l u e 2 ; 
 
                         m _ P r e s e t V a l u e [ 3 ]   =   t e x t B o x _ P r e s e t V a l u e 3 ; 
 
                         m _ P r e s e t V a l u e [ 4 ]   =   t e x t B o x _ P r e s e t V a l u e 4 ; 
 
                         m _ P r e s e t V a l u e [ 5 ]   =   t e x t B o x _ P r e s e t V a l u e 5 ; 
 
                         m _ P r e s e t V a l u e [ 6 ]   =   t e x t B o x _ P r e s e t V a l u e 6 ; 
 
                         m _ P r e s e t V a l u e [ 7 ]   =   t e x t B o x _ P r e s e t V a l u e 7 ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   C o u n t   v a l u e   c o n t r o l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         m _ C o u n t V a l u e [ 0 ]   =   t e x t B o x _ C o u n t V a l u e 0 ; 
 
                         m _ C o u n t V a l u e [ 1 ]   =   t e x t B o x _ C o u n t V a l u e 1 ; 
 
                         m _ C o u n t V a l u e [ 2 ]   =   t e x t B o x _ C o u n t V a l u e 2 ; 
 
                         m _ C o u n t V a l u e [ 3 ]   =   t e x t B o x _ C o u n t V a l u e 3 ; 
 
                         m _ C o u n t V a l u e [ 4 ]   =   t e x t B o x _ C o u n t V a l u e 4 ; 
 
                         m _ C o u n t V a l u e [ 5 ]   =   t e x t B o x _ C o u n t V a l u e 5 ; 
 
                         m _ C o u n t V a l u e [ 6 ]   =   t e x t B o x _ C o u n t V a l u e 6 ; 
 
                         m _ C o u n t V a l u e [ 7 ]   =   t e x t B o x _ C o u n t V a l u e 7 ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   C o u n t   s t a t u s   c o n t r o l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         m _ C o u n t S t a t u s [ 0 ]   =   t e x t B o x _ C o u n t S t a t u s 0 ; 
 
                         m _ C o u n t S t a t u s [ 1 ]   =   t e x t B o x _ C o u n t S t a t u s 1 ; 
 
                         m _ C o u n t S t a t u s [ 2 ]   =   t e x t B o x _ C o u n t S t a t u s 2 ; 
 
                         m _ C o u n t S t a t u s [ 3 ]   =   t e x t B o x _ C o u n t S t a t u s 3 ; 
 
                         m _ C o u n t S t a t u s [ 4 ]   =   t e x t B o x _ C o u n t S t a t u s 4 ; 
 
                         m _ C o u n t S t a t u s [ 5 ]   =   t e x t B o x _ C o u n t S t a t u s 5 ; 
 
                         m _ C o u n t S t a t u s [ 6 ]   =   t e x t B o x _ C o u n t S t a t u s 6 ; 
 
                         m _ C o u n t S t a t u s [ 7 ]   =   t e x t B o x _ C o u n t S t a t u s 7 ; 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i a g l o g   i n i t i a l i z a t i o n 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   D i C o u n t e r _ L o a d ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /     S c r e e n   d i s p l a y   i n i t i a l i z a t i o n 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         s h o r t       c h _ n o ; 
 
                         s t r i n g     c s t r ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   D e v i c e   n a m e 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         t e x t B o x _ D e v i c e N a m e . T e x t   =   " D I O 0 0 0 " ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   D I S P _ M A X _ C O U N T _ C H ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o u n t   e d g e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ C o u n t E d g e [ c h _ n o ] . I t e m s . A d d ( " R i s i n g " ) ; 
 
                                 m _ C o u n t E d g e [ c h _ n o ] . I t e m s . A d d ( " F a l l i n g " ) ; 
 
                                 m _ C o u n t E d g e [ c h _ n o ] . I t e m s . A d d ( " B o t h " ) ; 
 
                                 m _ C o u n t E d g e [ c h _ n o ] . S e l e c t e d I n d e x   =   0 ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o m p a r i s o n   c o u n t   v a l u e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c s t r   =   s t r i n g . F o r m a t ( " { 0 : d } " ,   ( ( c h _ n o   +   1 )   *   1 0 0 ) ) ; 
 
                                 m _ C o m p a r e C o u n t V a l u e [ c h _ n o ] . T e x t   =   c s t r ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   P r e s e t   v a l u e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c s t r   =   s t r i n g . F o r m a t ( " { 0 : d } " ,   ( c h _ n o   *   1 0 0 ) ) ; 
 
                                 m _ P r e s e t V a l u e [ c h _ n o ] . T e x t   =   c s t r ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o u n t   v a l u e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ C o u n t V a l u e [ c h _ n o ] . T e x t   =   " - " ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o u n t   s t a t u s   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ C o u n t S t a t u s [ c h _ n o ] . T e x t   =   " - " ; 
 
                         } 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o I n i t ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o I n i t _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     d e v i c e _ n a m e ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   G e t   d e v i c e   n a m e 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d e v i c e _ n a m e   =   t e x t B o x _ D e v i c e N a m e . T e x t ;   
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   I n i t i a l i z a t i o n   p r o c e s s ,   g e t   d e v i c e   I D 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . I n i t ( d e v i c e _ n a m e ,   o u t   d e v _ i d ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                         i f   ( r e t   ! =   ( i n t ) C d i o C o n s t . D I O _ E R R _ S U C C E S S ) 
 
                         { 
 
                                 r e t u r n ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   G e t   n u m b e r   o f   c h a n n e l s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . G e t M a x C o u n t C h a n n e l s ( d e v _ i d ,   o u t   c o u n t _ c h _ n u m ) ; 
 
                         i f   ( r e t   ! =   ( i n t ) C d i o C o n s t . D I O _ E R R _ S U C C E S S ) 
 
                         { 
 
                                 d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                                 r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                                 t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                                 r e t u r n ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   D i s a b l e   c o n t r o l s   f o r   c h a n n e l s   n o t   p r e s e n t   i n   d e v i c e 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r   ( c h _ n o   =   c o u n t _ c h _ n u m ;   c h _ n o   <   D I S P _ M A X _ C O U N T _ C H ;   c h _ n o + + ) 
 
                         { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o u n t   e d g e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ C o u n t E d g e [ c h _ n o ] . E n a b l e d   =   f a l s e ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o m p a r i s o n   c o u n t   v a l u e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ C o m p a r e C o u n t V a l u e [ c h _ n o ] . E n a b l e d   =   f a l s e ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   P r e s e t   v a l u e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ P r e s e t V a l u e [ c h _ n o ] . E n a b l e d   =   f a l s e ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o u n t   v a l u e   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ C o u n t V a l u e [ c h _ n o ] . E n a b l e d   =   f a l s e ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   C o u n t   s t a t u s   c o n t r o l 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 m _ C o u n t S t a t u s [ c h _ n o ] . E n a b l e d   =   f a l s e ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   C o r r e c t   t h e   n u m b e r   o f   c o u n t   c h a n n e l s   t o   t h e   m a x i m u m   n u m b e r   o f   c h a n n e l s   t h a t   c a n   b e   d i s p l a y e d 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         i f   ( D I S P _ M A X _ C O U N T _ C H   <   c o u n t _ c h _ n u m ) 
 
                         { 
 
                                 c o u n t _ c h _ n u m   =   D I S P _ M A X _ C O U N T _ C H ; 
 
                         } 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o S e t C o u n t E d g e ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o S e t C o u n t E d g e _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
                         s h o r t [ ]   c h _ n o _ a r r a y   =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
                         s h o r t [ ]   c o u n t _ e d g e     =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ;                       
 
                         s t r i n g     c s t r ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c h a n n e l   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c h _ n o _ a r r a y [ c h _ n o ]   =   c h _ n o ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   G e t   t h e   s p e c i f i e d   c o u n t   e d g e   v a l u e 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c s t r   =   m _ C o u n t E d g e [ c h _ n o ] . T e x t ; 
 
                                 i f ( s t r i n g . C o m p a r e ( c s t r ,   " R i s i n g " )   = =   0 ) { 
 
                                         c o u n t _ e d g e [ c h _ n o ]       =   ( i n t ) C d i o C o n s t . D I O _ C O U N T _ E D G E _ U P ; 
 
                                 } e l s e   i f ( s t r i n g . C o m p a r e ( c s t r ,   " F a l l i n g " )   = =   0 ) { 
 
                                         c o u n t _ e d g e [ c h _ n o ]       =   ( i n t ) C d i o C o n s t . D I O _ C O U N T _ E D G E _ D O W N ; 
 
                                 } e l s e { 
 
                                         c o u n t _ e d g e [ c h _ n o ]       =   ( i n t ) C d i o C o n s t . D I O _ C O U N T _ E D G E _ U P   |   ( i n t ) C d i o C o n s t . D I O _ C O U N T _ E D G E _ D O W N ; 
 
                                 } 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   S e t   c o u n t   e d g e 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . S e t C o u n t E d g e ( d e v _ i d ,   c h _ n o _ a r r a y ,   c o u n t _ c h _ n u m ,   c o u n t _ e d g e ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o S e t C o u n t M a t c h V a l u e 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o S e t C o u n t M a t c h V a l u e _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
                         s h o r t [ ]   c h _ n o _ a r r a y                           =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
                         s h o r t [ ]   c o u n t _ m a t c h _ r e g i s t e r _ n o   =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
                         u i n t [ ]     c o u n t _ m a t c h _ v a l u e               =   n e w   u i n t   [ M A X _ C O U N T _ C H ] ; 
 
                         s t r i n g     c s t r ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c h a n n e l   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c h _ n o _ a r r a y [ c h _ n o ]   =   c h _ n o ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c o m p a r i s o n   r e g i s t e r   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c o u n t _ m a t c h _ r e g i s t e r _ n o [ c h _ n o ]   =   0 ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   G e t   t h e   s p e c i f i e d   c o m p a r i s o n   c o u n t   v a l u e 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c s t r   =   m _ C o m p a r e C o u n t V a l u e [ c h _ n o ] . T e x t ; 
 
                                 c o u n t _ m a t c h _ v a l u e [ c h _ n o ]                 =   S y s t e m . C o n v e r t . T o U I n t 3 2 ( c s t r ,   1 0 ) ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   S e t   c o m p a r i s o n   r e g i s t e r 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . S e t C o u n t M a t c h V a l u e ( d e v _ i d ,   c h _ n o _ a r r a y ,   c o u n t _ c h _ n u m ,   c o u n t _ m a t c h _ r e g i s t e r _ n o ,   c o u n t _ m a t c h _ v a l u e ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o S t a r t C o u n t ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o S t a r t C o u n t _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
                         s h o r t [ ]   c h _ n o _ a r r a y     =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c h a n n e l   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c h _ n o _ a r r a y [ c h _ n o ]   =   c h _ n o ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   S t a r t   c o u n t 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . S t a r t C o u n t ( d e v _ i d ,   c h _ n o _ a r r a y ,   c o u n t _ c h _ n u m ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o R e a d C o u n t ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o R e a d C o u n t _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
                         s h o r t [ ]   c h _ n o _ a r r a y   =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
                         u i n t [ ]     c o u n t               =   n e w   u i n t   [ M A X _ C O U N T _ C H ] ; 
 
                         s t r i n g     c s t r ; 
 
                         
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c h a n n e l   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c h _ n o _ a r r a y [ c h _ n o ]   =   c h _ n o ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   R e a d   c o u n t   v a l u e 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . R e a d C o u n t ( d e v _ i d ,   c h _ n o _ a r r a y ,   c o u n t _ c h _ n u m ,   c o u n t ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                         i f   ( r e t   ! =   ( i n t ) C d i o C o n s t . D I O _ E R R _ S U C C E S S ) 
 
                         { 
 
                                 r e t u r n ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   U p d a t e   t h e   d i s p l a y   o f   c o u n t   v a l u e 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c s t r   =   S y s t e m . C o n v e r t . T o S t r i n g ( c o u n t [ c h _ n o ] ,   1 0 ) ; 
 
                                 m _ C o u n t V a l u e [ c h _ n o ] . T e x t   =   c s t r ; 
 
                         } 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o G e t C o u n t S t a t u s ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o G e t C o u n t S t a t u s _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
                         s h o r t [ ]   c h _ n o _ a r r a y     =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
                         u i n t [ ]     c o u n t _ s t a t u s   =   n e w   u i n t   [ M A X _ C O U N T _ C H ] ; 
 
                         s t r i n g     c s t r ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c h a n n e l   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c h _ n o _ a r r a y [ c h _ n o ]   =   c h _ n o ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   R e a d   c o u n t   s t a t u s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . G e t C o u n t S t a t u s ( d e v _ i d ,   c h _ n o _ a r r a y ,   c o u n t _ c h _ n u m ,   c o u n t _ s t a t u s ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                         i f   ( r e t   ! =   ( i n t ) C d i o C o n s t . D I O _ E R R _ S U C C E S S ) 
 
                         { 
 
                                 r e t u r n ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   U p d a t e   t h e   d i s p l a y   o f   c o u n t   s t a t u s 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c s t r   =   S y s t e m . C o n v e r t . T o S t r i n g ( c o u n t _ s t a t u s [ c h _ n o ] ,   1 6 ) ; 
 
                                 m _ C o u n t S t a t u s [ c h _ n o ] . T e x t   =   c s t r ; 
 
                         } 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o C o u n t P r e s e t ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o C o u n t P r e s e t _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
                         s h o r t [ ]   c h _ n o _ a r r a y     =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
                         u i n t [ ]     p r e s e t _ c o u n t   =   n e w   u i n t   [ M A X _ C O U N T _ C H ] ; 
 
                         s t r i n g     c s t r ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c h a n n e l   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c h _ n o _ a r r a y [ c h _ n o ]   =   c h _ n o ; 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   G e t   t h e   s p e c i f i e d   p r e s e t   c o u n t   v a l u e 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c s t r   =   m _ P r e s e t V a l u e [ c h _ n o ] . T e x t ;   
 
                                 p r e s e t _ c o u n t [ c h _ n o ]           =   S y s t e m . C o n v e r t . T o U I n t 3 2 ( c s t r ,   1 0 ) ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   P r e s e t   c o u n t   v a l u e 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . C o u n t P r e s e t ( d e v _ i d ,   c h _ n o _ a r r a y ,   c o u n t _ c h _ n u m ,   p r e s e t _ c o u n t ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o S t o p C o u n t ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o S t o p C o u n t _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
                         s h o r t       c h _ n o ; 
 
                         s h o r t [ ]   c h _ n o _ a r r a y   =   n e w   s h o r t [ M A X _ C O U N T _ C H ] ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   F o r   e a c h   c h a n n e l 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         f o r ( c h _ n o   =   0 ;   c h _ n o   <   c o u n t _ c h _ n u m ;   c h _ n o + + ) { 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 / /   S a v e   c h a n n e l   n u m b e r 
 
                                 / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                                 c h _ n o _ a r r a y [ c h _ n o ]   =   c h _ n o ; 
 
                         } 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   S t o p   c o u n t 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . S t o p C o u n t ( d e v _ i d ,   c h _ n o _ a r r a y ,   c o u n t _ c h _ n u m ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   D i o E x i t ( ) 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ D i o E x i t _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         i n t           r e t ; 
 
                         s t r i n g     e r r o r _ s t r i n g ; 
 
                         s t r i n g     r e t u r n _ s t r i n g ; 
 
 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E x i t   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         r e t   =   d i o . E x i t ( d e v _ i d ) ; 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   E r r o r   p r o c e s s 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         d i o . G e t E r r o r S t r i n g ( r e t ,   o u t   e r r o r _ s t r i n g ) ; 
 
                         r e t u r n _ s t r i n g   =   s t r i n g . F o r m a t ( " R e t   =   { 0 : d }   :   { 1 : s } " ,   r e t ,   e r r o r _ s t r i n g ) ; 
 
                         t e x t B o x _ R e t u r n C o d e . T e x t   =   r e t u r n _ s t r i n g ; 
 
                 } 
 
 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 / /   A p p l i c a t i o n   e n d 
 
                 / / = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 
 
                 p r i v a t e   v o i d   b u t t o n _ E x i t _ C l i c k ( o b j e c t   s e n d e r ,   E v e n t A r g s   e ) 
 
                 { 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         / /   C l o s e   t h e   d i a l o g 
 
                         / / - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
 
                         t h i s . C l o s e ( ) ; 
 
                 } 
 
         } 
 
 } 