Wrox Programmer Forums
|
Visual Studio 2008 For discussing Visual Studio 2008. Please post code questions about a specific language (C#, VB, ASP.NET, etc) in the correct language forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Studio 2008 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 13th, 2011, 12:51 PM
Registered User
 
Join Date: Feb 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
 
Old February 15th, 2011, 11:44 AM
Registered User
 
Join Date: Feb 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Disregard I figured it out.









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.