@@ -20,11 +20,13 @@ static void Main(string[] args)
2020 List < ItemAddress > readlist = new List < ItemAddress > ( ) ;
2121 Console . WriteLine ( "Main - START" ) ;
2222 // Als Parameter lässt sich die IP-Adresse übergeben, sonst Default-Wert von oben
23- if ( args . Length >= 1 ) {
23+ if ( args . Length >= 1 )
24+ {
2425 HostIp = args [ 0 ] ;
2526 }
2627 // Als Parameter lässt sich das Passwort übergeben, sonst Default-Wert von oben (kein Passwort)
27- if ( args . Length >= 2 ) {
28+ if ( args . Length >= 2 )
29+ {
2830 Password = args [ 1 ] ;
2931 }
3032 Console . WriteLine ( "Main - Versuche Verbindungsaufbau zu: " + HostIp ) ;
@@ -48,17 +50,17 @@ static void Main(string[] args)
4850 Console . WriteLine ( "Main - Lese Werte aller Variablen aus" ) ;
4951
5052 List < PlcTag > taglist = new List < PlcTag > ( ) ;
51- PlcTags tags = new PlcTags ( ) ;
53+ var tags = new List < PlcTag > ( ) ;
5254
5355 foreach ( var v in vars )
5456 {
5557 taglist . Add ( PlcTags . TagFactory ( v . Name , new ItemAddress ( v . AccessSequence ) , v . Softdatatype ) ) ;
5658 }
5759 foreach ( var t in taglist )
5860 {
59- tags . AddTag ( t ) ;
61+ tags . Add ( t ) ;
6062 }
61- res = tags . ReadTags ( conn ) ;
63+ res = conn . ReadTags ( tags ) ;
6264 if ( res == 0 )
6365 {
6466 Console . WriteLine ( "====================== VARIABLENHAUSHALT ======================" ) ;
@@ -68,7 +70,7 @@ static void Main(string[] args)
6870 for ( int i = 0 ; i < vars . Count ; i ++ )
6971 {
7072 string s ;
71-
73+
7274 s = String . Format ( formatstring , taglist [ i ] . Name , taglist [ i ] . Address . GetAccessString ( ) , Softdatatype . Types [ taglist [ i ] . Datatype ] , taglist [ i ] . ToString ( ) ) ;
7375 Console . WriteLine ( s ) ;
7476 }
0 commit comments