|
faysie wrote: iam new in C#
Why are you expecting the control of a robot to be an appropriate first project ? If you have experience in another language, you should use that, and if you don't, then you probably don't have much hope.
faysie wrote: also i need help wht design pattern i should use.
I doubt there's a pattern which is going to provide a panacea to your task. It's not typical for a pattern ( unless it's MVC, which is not a GoF pattern ), to define the nature of an entire project.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hey thnx for the reply but new ..means with hardware.. iam in website development already more doesnt mean i dont knw .. ..well its more like this but have to code in C# http://www.mavrinac.com/projects/robot/[^] regards therz always hope
|
|
|
|
|
Oh, OK. Well, you need to work out how to communicate with your hardware. If the robot uses the serial port. C# 2005 has classes to communicate with that port, so once you work out what you need to send, it shouldn't be too hard.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
yes it does work on a serial port ok ....iam getting it but its all kinda mixed up i mean wht will be to exact proecdure to follow to program microcontroller in c# or to program servo motors ..? iam usin rs232 which i serial..can u help me with the exact steps..
|
|
|
|
|
I doubt you can program the microcontroller in C#. I'd imagine that would be C or C++.
C# would likely be useful only for writing code on the PC end.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok now i get it .......so i will be using c++ or c for serial progromming for communicating with the hardware ......u mean microcontroller .with tht servo motors .......is there any ..open source or link which can help
|
|
|
|
|
I mean, if you need to program the device, it will probably be C. For a Windows program that controls the robot from the PC, C# will work fine.
No, I've never done this. What about the article you linked to ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ok tht article i was asking about any article on serial programming is it avaliabe ...anywhere which can be help full tutorial i mean ...cuz tht previous website i mailed the process was exactly like tht ..progammable robotic arm site..
|
|
|
|
|
i did some work using an OOPIC controller which connected to my PC via rs232.
Essentially the code was built in 2 parts. there was a stack of code written in OOPIC language and deployed on the controller board. This took care of things like making sure the servos didn't turn too far and the rates at which they moved when commanded. It also had a list of actions that it should carry out and some messages it could send back to the PC.
A winforms app sat on the desktop and sent messages down the wire to the controller.
The user might select straight on from a list of options in a combobox and select 50% on a slider to determine the speed.
The app then sent a message of 1 128 down the serial cable.
The program on the controller knew that 1 meant left and right motors equal and used the next number to be the speed in this case 128/255 of full power.
I guess that's a pattern of a sort. Keep the hardware logic on the controller at the hardware end and the more abstract concepts(go forward, turn slowly, spin on spot) on the computer.
I think serial things have improved in 2k5, i remember 2003 was a bit of a pain for serial coms.
Russell
|
|
|
|
|
can u tell me more about the deployment of code which was burn to the controller tht part i need really help ...how to do?
|
|
|
|
|
the controller came with a small but effective IDE for writing code to run on the controller board. I would assume that the manufacturers of your controller will provide either an IDE or a set of libraries for you to use to develop the code that runs on it.
Russell
|
|
|
|
|
Hi all
I read about interesting feature in MyNamepsace coming from Microsoft.VisualBasic.dll
I added a reference to Microsoft.VisualBasic.dll in my C# project, but I cannot see any classes of MyNamespaces.
Do I have to make further settings?
regards
ManuStone
|
|
|
|
|
No, the 'My' namespace is just a little bit of hand holding for the VBers, it adds literally nothing to the language, it's just a shortcut to a bunch of commonly used stuff through the framework.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
It's more like training wheels for your car in case you miss the ones on your first bicycle too much.
|
|
|
|
|
Or perhaps it's more like steering wheel, pedal and seat covers, so that your new BMW 330 feels just like your old Renault 5...
---
single minded; short sighted; long gone;
|
|
|
|
|
Hey! I enjoyed my Renault 5, two cars before my first BMW, but I know exactly what you mean.
|
|
|
|
|
The following is a support file we use in Instant C#. Some of the 'My' namespace is reproduced there and other parts are converted in-line by Instant C#:
//----------------------------------------------------------------------------------------
// Copyright © 2005 - 2007 Tangible Software Solutions Inc.
//
// This file provides classes to reproduce most of the My.Computer and My.User
// functionality in VB. Calls to My.Computer.Clipboard, My.Computer.FileSystem,
// and My.Computer.Registry have been converted where they were referenced.
//
// Note: My.Settings is converted elsewhere to the standard C# Properties.Settings.
// Note: My.Resources is converted elsewhere to the standard C# Properties.Resources.
// Note: My.Application calls are redirected to the converted My.MyApplication.
//----------------------------------------------------------------------------------------
using Microsoft.VisualBasic.ApplicationServices;
using Microsoft.VisualBasic.Devices;
using System.Security.Principal;
using System.Windows.Forms;
namespace My
{
internal static class Computer
{
//Instant C# Notes:
//Calls to My.Computer.Clipboard have been redirected to System.Windows.Forms.Clipboard
//Calls to My.Computer.FileSystem have been redirected to Microsoft.VisualBasic.FileIO.FileSystem
//Calls to My.Computer.Registry have been redirected to Microsoft.Win32.Registry
internal readonly static Audio Audio;
internal readonly static Clock Clock;
internal readonly static ComputerInfo Info;
internal readonly static Keyboard Keyboard;
internal readonly static Mouse Mouse;
internal readonly static string Name;
internal readonly static Network Network;
internal readonly static Ports Ports;
internal readonly static Screen Screen;
static Computer()
{
Audio = new Audio();
Clock = new Clock();
Info = new ComputerInfo();
Keyboard = new Keyboard();
Mouse = new Mouse();
Network = new Network();
Ports = new Ports();
Screen = Screen.PrimaryScreen;
ServerComputer ThisServerComputer = new ServerComputer();
Name = ThisServerComputer.Name;
}
}
internal static class User
{
private static Microsoft.VisualBasic.ApplicationServices.User ThisUser = new Microsoft.VisualBasic.ApplicationServices.User();
internal static IPrincipal CurrentPrincipal
{
get
{
return ThisUser.CurrentPrincipal;
}
}
internal static bool IsAuthenticated
{
get
{
return ThisUser.IsAuthenticated;
}
}
internal static string Name
{
get
{
return ThisUser.Name;
}
}
internal static void InitializeWithWindowsUser()
{
ThisUser.InitializeWithWindowsUser();
}
internal static bool IsInRole(BuiltInRole ThisRole)
{
return ThisUser.IsInRole(ThisRole);
}
internal static bool IsInRole(string ThisRole)
{
return ThisUser.IsInRole(ThisRole);
}
}
}
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: C# to Python converter, VB to Python converter
|
|
|
|
|
i m making an application in c#.net2005, window application.
How can i connect datagridview to database(sqlserver2000) at runtime? - not from design, only by coding.
i have written this code, but no data is listed in grid :
SqlConnection conn = new SqlConnection("Data Source=......");
private void Form1_Load(object sender, EventArgs e)
{
conn.Open();
SqlDataAdapter da = new SqlDataAdapter("select * from tblsummary", conn);
DataSet ds = new DataSet();
da.Fill(ds, "tblsummary");
//dataGridView1.Columns.Add(sitehit);
dataGridView1.DataSource = ds;
conn.Close();
}
Does i miss something else for connection?
Hope to get a reply..
thank you in adv.
nekshan.
|
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
{
' Create Instance of Connection and Command Object
Dim myConnection As SqlConnection = New SqlConnection(System.Configuration.ConfigurationManager.AppSettings("ConnectionString"))
Dim myCommand As SqlCommand = New SqlCommand("select statement", myConnection)
' Execute the command
myConnection.Open()
Dim result As SqlDataReader = myCommand.ExecuteReader(CommandBehavior.CloseConnection)
DataSet ds = new DataSet();
da.Fill(ds);
dataGridView1.DataSource = ds.tables(0);
}
convert this in c# some code is paste from vb.net that's y.
open www.meebo.com to chat with me this site give facility to chat by using yahoo login ok.
|
|
|
|
|
Dim myConnection As SqlConnection = New SqlConnection(write u'r connecting string over here)
in prev code.
|
|
|
|
|
da.Fill(ds);
what is 'da' in your code? no definition for it.
nekshan.
|
|
|
|
|
thanx its working.
www.meebo.com is not allowed
i'll try again.
how r u?
wen r u coming??
c u soon!!
nekshan.
|
|
|
|
|
use this & check.
http://wwwl.meebo.com/index-en-GB.html
fine.i m coming on 1st may.after 1 week.
|
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
{
Dim connectionString As String = "server='(local)'; trusted_connection=true; database='webstore'"
Dim dbConnection As System.Data.IDbConnection = New System.Data.SqlClient.SqlConnection("Data Source=write connecting string over here")
Dim queryString As String = "SELECT [Categories].[CategoryID], [Categories].[CategoryText] FROM [Categories]"
Dim dbCommand As System.Data.IDbCommand = New System.Data.SqlClient.SqlCommand
dbCommand.CommandText = queryString
dbCommand.Connection = dbConnection
Dim dataAdapter As System.Data.IDbDataAdapter = New System.Data.SqlClient.SqlDataAdapter
dataAdapter.SelectCommand = dbCommand
Dim dataSet As System.Data.DataSet = New System.Data.DataSet
dataAdapter.Fill(dataSet)
dataGridView1.DataSource = ds.tables(0);
conn.Close();
}
|
|
|
|
|
just an alternate method by using the data reader
SqlConnection conn = new SqlConnection("Data Source=" + Environment.MachineName + "\\WINCC;Integrated Security=SSPI;Initial Catalog=Logger; Packet Size = 32766;");
SqlCommand cmd = new SqlCommand("SELECT * FROM RDPLogViewer WHERE SubSystem = '" + SubSystemComboBox.Text + "'", conn);
SqlDataReader rdr = cmd.ExecuteReader();
while (rdr.Read())
{
LoggerDatagrid.Rows.Add(rdr["TypeLevel"].ToString(), rdr["TimeStamp"].ToString(), rdr["SubSystem"].ToString(), rdr["ClassName"].ToString(), rdr["FunctionUsed"].ToString(), rdr["Memory"].ToString(), rdr["Statement"].ToString());
}
Assuming that the variables are existing in the respective tables/database
Keshav Kamat
India
|
|
|
|