|
What sort of help are you looking for? Have you studied the documentation of the PLC device (whatever that is) to see whether you are accessing it correctly? Have you written any VB.NET code yet, and if so where is the problem?
|
|
|
|
|
Hmmm... where to start?
A PLC is a Programmable Logic Controller - basically an industrial computer.
So, how does the PLC make the data available - a direct connection or a networked connection?
Does the manufacturer have any code samples of how to connect to their device and get data from it?
We are generally willing to help, but your question is very wide open...
|
|
|
|
|
It's been a long time since VB6 has mystified me in its behaviour!
I have a function that solves Kakuro puzzles. It uses a 2D and a 3D array (both Integer) as its main data structures and employs a conventional DFS approach.
Naturally I compile to EXE with all run-time checks disabled for maximum grunt.
Recently I accidentally turned off these optimizations (I was in the wrong project window). But when I restored them and rebuilt the EXE I found to my horror that my solver has lost its mojo.
Every benchmark test I have reports exactly the same results (including, importantly, the number of DFS recursions) BUT all of them run 3 times slower than before. Nothing else has changed that I can think of.
I'm at a loss to explain this. Any ideas?
Mathimagics
|
|
|
|
|
You are hoping someone can give you advice on the performance of an unknown function in a dead language, compiled by an IDE that is more than a decade out of date, on an unknown OS.
I can only suggest the obvious - rebuild your function into a current language.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Ouch!
Dead language? See this article!
Unknown OS? The VB6 IDE only runs on Win32 platforms, so my OS being Windows 7 should come as no surprise.
Unknown function? Guilty!
As it happens, I had already ported the function concerned to both C and F90, and was in the middle of benchmark testing the 3 languages (using GCC 5.3 for both C and F9).
The function is a Kakuro puzzle solver, a simple DFS model, making heavy use of a 2D array (grid) and a 3D array (cell domains).
For computationally-intensive functions like this, my experience is that optimised VB6 times should be comparable to unoptimised GCC, and hitherto I was getting times consistent with this.
When compiled with -O3, however, the GCC versions run 3 times faster.
So all hail the guys at Gnu. Even without the mysterious "mojo loss syndrome", C/F90 still romps home by a factor of 3.
Mathimagics
|
|
|
|
|
Dr Memory wrote: Dead language? See this article!
Yeah, it's DEAD, for about 15 years now. Pointing at some crybabies demanding MS update it or open source it doesn't make it any more live. That just proves the point even more.
Yes, I used to use VB6 way back in the day but that changed the moment I got my hands on pre-release .NET 1.0 and had to use Notepad to write code and the command line compilers to build it. Even in that primitive environment I saw what was coming and it was a lot better than VB6. I abandoned VB6 completely the day I got my hands on Visual Studio .NET.
The VS6 IDE is barely supported on Win7 and isn't supported at all on Vista and above, so the "only runs on Win32 platforms" doesn't exactly tell anyone what they need to know. Yes, people have gotten it to work on every version of Windows XP and higher, but only buy jumping through flaming hoops to do it.
|
|
|
|
|
As Dave said the article you referenced does not indicate anything but that the demise of VB6 is permanent.
As it has been almost 15 years since I was using it I would have no idea that it could run on W7. I consider leaving VB6 for VB.net and then c# one of my better tool decisions, Silverlight still pisses me off though
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hmmm, I seem to have wandered into the wrong bar!
I will go quietly into the night ...
Mathimagics
|
|
|
|
|
It is the right bar, you're just a few years too late.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Public Class Form6
Public Property ServerName() As String
Public Property DatabaseName() As String
Public Property Login() As String
Public Property Password() As String
Private Function SqlConn(Optional ByVal timeout As Integer = 0) As String
Dim sqlBuilder As New SqlClient.SqlConnectionStringBuilder()
' Set the properties for the data source.
sqlBuilder.DataSource = "Softlinks-PC"
sqlBuilder.InitialCatalog = "RMS"
sqlBuilder.IntegratedSecurity = False
sqlBuilder.MultipleActiveResultSets = True
sqlBuilder.UserID = "Softlinks-PC\Softlinks"
sqlBuilder.Password = ""
If timeout > 0 Then
sqlBuilder.ConnectTimeout = timeout
End If
Return sqlBuilder.ToString
End Function
Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Call SqlConn()
Dim sql As String
Dim ds = New DataSet
Dim tables = ds.Tables
Dim da = New SqlClient.SqlDataAdapter
Sql = "SELECT * FROM Productitem"
da.Fill(ds, "Productitem")
'Dim view As New DataView(tables(0))
Dim view As New DataView(ds.Tables(0))
DataGridView1.DataSource = view
End Sub
End Class
|
|
|
|
|
Hi all, I have e little problem that I hope someone can help me to solve it.
I have a Form in which there is a panel where I draw a graphical diagram using instruction paint, drawline.
The graphical is correctly drawn, but if I Minimize the Form and after I re-Maximize the Form, all contents of Form is maintened but the graphical in the Panel is lost.
What can/must I do to avoid this problem?
I am developing in VB of VS 2008.
Thanks
|
|
|
|
|
Repaint whenever the OnPaint event fires.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Thanks, I will try (I am not expert).
Refresh is the same of Repaint?
|
|
|
|
|
No, he means put all of your painting code in a method that is called by the OnPaint event of the Panel. When Windows tells your app to repaint itself, your painting code should do everything it needs to draw everything on the Panel. You'd be surprised how often your painting code is going to be called.
|
|
|
|
|
Thanks all for help.
Regards
|
|
|
|
|
Is it actually possible for me to make an Windows Explorer but with more features just like Revolutions Pack?
Or will VB6 make this impossible?
Any tips are welcome.
|
|
|
|
|
DutchComputerKid wrote: possible for me
How would you suppose that we can answer that? How could complete strangers on the internet know if something is possible for you to do or not? Sure, if you apply yourself, learn programming, and study, study, study you can probably do just about anything. But for us to tell you that you can sit down and bang this out in the next month? No, we can't tell you any such thing because we don't know you, your skill set or why on earth you would want to use an outdated ancient dead programming language like VB6 to begin with.
|
|
|
|
|
I believe OP is simply asking if it can be done using VB6.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
RyanDev wrote: I believe OP is simply asking
He asked if it were possible for him to do. We have no idea if he can do it or not.
|
|
|
|
|
Yes, you're taking it way too literal.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Dunno what the revolutions pack is supposed to be, but yes, you could write your own Windows Explorer-like application.
DutchComputerKid wrote: Or will VB6 make this impossible? VB6 is dead and buried. Download VB.NET, it is free.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
But will that run on Windows XP x64? I have chosen VB6 to make my software compatible with Windows 98 and 95 but I'll need to leave that behind huh?
VB.NET runs on the .NET framework I assume :P
That requires Windows 2000 right?
|
|
|
|
|
You mean it doesn't run on CP/M? I'm heartbroken and disappointed!
=========================================================
I'm an optoholic - my glass is always half full of vodka.
=========================================================
|
|
|
|
|
I did make a LOT of MS-DOS software, ask if you're interested.
|
|
|
|
|
At some point you are going to have to dig yourself and your clients out of the 20th century. You are going to be hard pressed to get any support for VB6 and it not supported on current equipment.
Never underestimate the power of human stupidity
RAH
|
|
|
|