title: How to link Beckhoff TwinCAT 3 to a Visual Studio HMI created in C#?
body: <p>I am quite new in TwinCAT 3 and .NET framework. I am trying just to create an HMI with a button and link it to a variable in TwinCAT 3. I am controlling by TwinCAT 3 a Beckhoff output card (EL2014) so I have created the following variable named "Out_1" and linked it to one card output:</p>
  
  <p><a href="https://i.stack.imgur.com/fIQt5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fIQt5.png" alt="Variable configuration"></a></p>
  
  <p>Variable properties:</p>
  
  <p><a href="https://i.stack.imgur.com/6eTEY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6eTEY.png" alt="enter image description here"></a></p>
  
  <p>The code of the button is:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
  {
      TwinCAT.Ads.TcAdsClient tcAds = new TwinCAT.Ads.TcAdsClient();
      tcAds.Connect(301);
  
      tcAds.WriteSymbol("TIRT.Task 2.Outputs.Out1", true, 
          reloadSymbolInfo: true);
  }
  </code></pre>
  
  <p>The following message is appearing:</p>
  
  <p><strong>Additional information: Ads-Error 0x710 : Symbol could not be found.</strong></p>
  
  <p>The symbol name used to access de variable is not correct and I don't really know how may I write it.</p>
  
  <p>Does anyone know how can I access this variable?</p>
  
  <p>Thank you very much.</p>