Array Alternative

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul Cheetham

    #1

    Array Alternative

    Hi,

    I am writing an application that reads data from a PLC in a
    manufacturing plant.
    I use a control to communicate with the PLC, that returns an array of
    Short values.

    I do not always know the length of the data block that will be returned,
    and so cannot declare a suitable array. (As well as that, I believe
    re-dimensioning an array in VB.Net is very inefficient)

    Can anyone suggest a way of storing this data so it can then be manipulated?


    I am using .Net 1.1 and VS 2003


    Thankyou.

    Paul Cheetham
  • Chris

    #2
    Re: Array Alternative

    Paul Cheetham wrote:[color=blue]
    > Hi,
    >
    > I am writing an application that reads data from a PLC in a
    > manufacturing plant.
    > I use a control to communicate with the PLC, that returns an array of
    > Short values.
    >
    > I do not always know the length of the data block that will be returned,
    > and so cannot declare a suitable array. (As well as that, I believe
    > re-dimensioning an array in VB.Net is very inefficient)
    >
    > Can anyone suggest a way of storing this data so it can then be
    > manipulated?
    >
    >
    > I am using .Net 1.1 and VS 2003
    >
    >
    > Thankyou.
    >
    > Paul Cheetham[/color]


    sounds like an arraylist is exactly what you need.
    take a look at it. Also some of the collection classes may help.
    Chris

    Comment

    • m.posseth

      #3
      Re: Array Alternative



      declaring the array with the result should work in my opinion

      pseudo code :::

      Dim shorts() As Short = Returningdata

      regards

      Michel Posseth [MCP]



      "Paul Cheetham" <PAC.News@dsl.p ipex.com> schreef in bericht
      news:OK1rkVlLGH A.3496@TK2MSFTN GP14.phx.gbl...[color=blue]
      > Hi,
      >
      > I am writing an application that reads data from a PLC in a manufacturing
      > plant.
      > I use a control to communicate with the PLC, that returns an array of
      > Short values.
      >
      > I do not always know the length of the data block that will be returned,
      > and so cannot declare a suitable array. (As well as that, I believe
      > re-dimensioning an array in VB.Net is very inefficient)
      >
      > Can anyone suggest a way of storing this data so it can then be
      > manipulated?
      >
      >
      > I am using .Net 1.1 and VS 2003
      >
      >
      > Thankyou.
      >
      > Paul Cheetham[/color]


      Comment

      Working...