15,917,709 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 Burak Demirsoy (Top 4 by date)
Burak Demirsoy
12-Jul-14 16:21pm
View
I tried and nothing changed actually. But I found a way to operate this. So I looked at ns times for receiving and sending times and by observing, I'm now able to open close valve and receive data. However, this seems stupid cus I flush open close function several times as well as for receiving. Theory does not comply with life indeed :) Thanks for help.
Burak Demirsoy
12-Jul-14 6:35am
View
So the open valve function is the following ;
private void OpenValve(string DeviceNo,bool ValvePosition)
{
string giden = "";
SendData[0] = 0xfa;
SendData[1] = Conversions.ToByte(Strings.Mid(DeviceNo, 1, 2));
SendData[2] = Conversions.ToByte(Strings.Mid(DeviceNo, 3, 2));
SendData[3] = Conversions.ToByte(Strings.Mid(DeviceNo, 5, 2));
SendData[4] = Conversions.ToByte(Strings.Mid(DeviceNo, 7, 2));
if (ValvePosition)
SendData[5] = 50;
else
{
SendData[5] = 51;
}
SendData[6] = CheckSum_Temass(5);
SendData[7] = 0xfb;
sp.Write(SendData, 0, SendData.Length);
I manage open/close valve but it takes time. I'm continuously calling OpenValve() function. It should be like when I call OpenValve() function, it should operate at first time. But it does not and cant figure out why ?
Burak Demirsoy
12-Jul-14 6:31am
View
You are totally right. Before you told me I did that way and right now I solved receiving data. However there still exists problems.
I solved the problem which was relasted to parity. In default it is none but in my system it was supposed to be even. So I can receive data right now but the problem is now speed of data.
In Vb. I'm using valveopen function forthtimes to open valve.Therefore I code like ;
valveopen();
valveopen();
valveopen();
valveopen();
However in C# it is like god knows how many times it will operate :). Arbitrarily I'm able to open valve right now. All stuff are the same and no problem. I think data transfer speed of MSComn and Serial Port are different.
Burak Demirsoy
12-Jul-14 1:52am
View
As you can see from Strings.Mid which Mic.VisualBasic.CompilerServices class's function.Therefore, It does not start with 0 in C#. DriverNo = "20021267" all are defined in code.
I compared sent data with C# and Vb.Net, both show the same output in text file (I wrote in a text the output). So from this point, what I've understood is the problem should be related with the output function [sp.Output(VB.Net MSComm) sp.Write(C# Serial Com))