15,904,655 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 4417892 (Top 12 by date)
Member 4417892
11-Nov-11 7:07am
View
Just did :)
Member 4417892
11-Nov-11 6:02am
View
The code is as follows:
using System.Text;
using System.Windows.Forms;
using DotNetSiemensPLCToolBoxLibrary;
using DotNetSiemensPLCToolBoxLibrary.Communication;
using DotNetSiemensPLCToolBoxLibrary.Communication.Library;
using DotNetSiemensPLCToolBoxLibrary.Communication.Library.Interfaces;
using DotNetSiemensPLCToolBoxLibrary.Communication.Library.Pdus;
using DotNetSiemensPLCToolBoxLibrary.DataTypes.Blocks.Step7V5;
using DotNetSiemensPLCToolBoxLibrary.PLCs.S7_xxx;
public bool Connect(string ip, int port, int rack, int slot)
{
try
{
// Thread.Sleep(2000); //Sleeps otherwise it wont connect sometimes
PLCConnectionConfiguration conf = new PLCConnectionConfiguration(); ;
conf.ConfigurationType = LibNodaveConnectionConfigurationType.RegistrySavedConfiguration;
myConn = new PLCConnection("FHA");
myConn.Connect();
return true;
}
catch (Exception e)
{
Error = e.Message;
return false;
}
}
The error comes when I am calling the Connect method in myConn.
As you see I aint touching much of XML, but I am pretty sure the error happens within the .dll where it probably uses some sort of XML for something I dont know.
Member 4417892
11-Nov-11 5:46am
View
This is where I get the error:
PLCConnection myConn = new PLCConnection("Con");
myConn.Connect();
Member 4417892
11-Nov-11 5:41am
View
I am not even reading or writing any XML, the library dll seems to cause the error when I call it functions.
I have read the whole forum thread, and also tried to see if I could implement it in my code, and I am pretty sure I can't handle it that way.
Member 4417892
2-Nov-11 4:26am
View
Stupid me!
Thanks, making it static ofcourse solved it all :)
Member 4417892
1-Nov-11 13:33pm
View
It's a windows form. Sorry not for meantion that.
I have no experience or knowledge about UI library - actually I dont even know what it is. But I will try read about it and see if that can help me.
Member 4417892
1-Nov-11 13:31pm
View
I guess I will have pretty many threads running in the end, which I think will be heavy stuff for the program as well.
But I will try read some of the links you gave me and look into the control array.
Thanks :)
Member 4417892
1-Nov-11 13:29pm
View
I got a timer right now in the control, but everytime I create the control it also creates a new timer.
If I add your code to my control I believe it still would be the same, that I have an timer everytime for each control I create?
Or will you add this timer class seperately, and then call it from the usercontrol ?
Member 4417892
8-Oct-10 6:17am
View
Additional information, the max length of the html that is 7984
Member 4417892
8-Oct-10 5:37am
View
I had it there before, but that doesnt work neither.
Im out of ideas, I tried almost everything, but it just wont load the whole html source.
Member 4417892
31-Aug-10 16:54pm
View
And I use functions like this to call my TextBoxes, ComboBoxes and so on from the application,
private TextBox textbox(TextBox name)
{
TextBox ret = null;
name.Invoke((ThreadStart)delegate()
{
ret = name;
});
return ret;
}
Im doing it that way because its a cross thread. I maybe think it is in that function there is something wrong since it almost get all it variables through these functions.
Member 4417892
31-Aug-10 16:49pm
View
Oh, didn't see this comment button at all. Well I dont think you would get much information if I posted the whole code, but I can do a little snippet of where I call my backgroundworker.
void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
{
initScript();
}
And then my button function from where it is called.
private void button1_Click(object sender, EventArgs e)
{
backgroundWorker1.RunWorkerAsync();
}
From initScript(), it calls other functions, and it keeps so on..
Is it even possibly to make a backgroundworker work that way ?
Show More