Zedgraph
Hello,
First post so I hope I'm in the correct thread. I am using VB2008 Express edition along with ZedGraphControl (version5.1.528844). I am using a Allen bradley 1400 PLC to communicate its integer data to the ZedGraph. I can get this to work using a trend graph but I am looking more towards the bar function.
Code ex:
Dim N7() As String
N7 = EthernetIPforSLCMicro1.ReadAny("N7:0", 16)
Dim X(89), Y(89) As Double
For i As Integer = 0 To 15
X(i) = i
Y(i) = CDbl(N7(i))
Next
zg1.GraphPane.AddBar("Bar", Y, X, Color.Aqua)
zg1.GraphPane.Title.Text = "Lane Values"
zg1.GraphPane.XAxis.Title.Text = "Lane1 Lane2 Lane3 Lane4 Lane5 Lane6 Lane7 Lane8"
zg1.AxisChange()
zg1.Invalidate()
The N7 represents my data from the PLC by ethernet. I am wanting to take all integers (16 total) and use each one to represent a bar and its value.Example is Bar 1(Lane 1)=N7:2,Bar 2Lane2)=N7:4,Bar 3(Lane3)=N7:6, thru Bar 8(lane8)=N7:16. Can anyone provide me with assistance on how to take this string N7() 0-15 and break it down to correspond to the bars on the graph? Thanks you in advance.
|