Showing results 1 to 3 of 3

Thread: Read and write value of Variable -VB.Net (VSTA)

  1. #1
    Join Date

    Default Read and write value of Variable -VB.Net (VSTA)

    I need write and read value of variable in the VSTA, when I use VB.Net language. Can somebody write code in VB.Net. Thanks

  2. #2

    Default Re: Read and write value of Variable -VB.Net (VSTA)

    Hi ozi,

    There are several examples here in this forum, mostly in C#, that can be adopted for use in VB.NET.

    Use the search function for "get_value". One example with an online container can be found here:

    online container VB.NET

  3. #3

    Default Re: Read and write value of Variable -VB.Net (VSTA)

    This VB.NET macro will read the value of the variable with the name "return_numeric" and write it to the output window.

       Public Sub Macro_ReadValue()
            Dim obVar As zenOn.IVariable
            Dim vValue As Integer
            obVar = Me.Variables.Item("return_numeric_1")
            If Not obVar Is Nothing Then
                If obVar.IsOnline() Then
                    'safe to read, variable exists and has a valid value
                    vValue = obVar.get_Value(0)
                Else : System.Diagnostics.Debug.Print("variable has no valid value")
                End If
            Else : System.Diagnostics.Debug.Print("variable does not exist")
            End If
        End Sub

Similar Threads

  1. VSTA read variable value's another project!
    By dvangenderen in forum VSTA
    Replies: 5
    Last Post: 1st December 2011, 10:04
  2. Replies: 12
    Last Post: 25th November 2010, 10:54
  3. Replies: 4
    Last Post: 21st June 2010, 07:12
  4. Read Real variables in VBA
    By joulz in forum VBA
    Replies: 4
    Last Post: 5th February 2009, 13:29
  5. Read dBase does not work
    By bjoerndavid in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 3
    Last Post: 26th November 2007, 13:15

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts