473,395 Members | 1,383 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Interfacing an Instrument thru RS232 using C#

Hi
I am from science background and learnt little bit of programming in C,Matlab,C#.
My task in hand is to interface an instrument through RS 232. I am using the serialport class but not able to communicate with the instrument . So kindly help me. Its completely educational purpose (no profit making) so reply soon.....
awaitng expert reply.....................
Apr 11 '07 #1
5 8637
tifoso
41
What have u tried already?? It may be the external black box u r interfacing with
does not use the CTS/DTS handshaking?? Are u pairing the baud rate for both ends?? Do u have your serial cable tested??? GIve out more info and some hints will come your way

Ciao

Becker
Apr 11 '07 #2
nmsreddi
366 256MB
Hello

As you said you are using serialport class ,i think you are using c# as your language,what methods you are using for interfacing ,how can you say the device is not interfacing with your application,have you tested the device by interfacing it with some other softwares,

more over can you give some specifications about your device which you are going to interface ,

if possible try to post some sample code so that we can under stand your actual point and can give the solution


Regards
N.Msreddy
Apr 12 '07 #3
Plater
7,872 Expert 4TB
Try communicating with your instrument through HyperTerminal first. Then when creating your serialport class be sure to use the same baudrate and stop bits and other settings.
The SerialPort class in .NET2.0 is pretty unstable and rather tricky. You need to use the events that fire when data is recieved (Note: Do not actually try to read the data inside the eventhandler)

I am unsure how far you got with it but start with this?
SerialPorts are addressed by name (ie "COM1") if you need a list:
System.IO.Ports.SerialPort.GetPortNames();

I don't want to link to other helpsites but if you google "using SerialPort class in C#" you will get a number of examples better then I can explain
Apr 12 '07 #4
thnx a lot for replying and sorry for a very late reply from my side .......... I was busy with something else ......... surely i'll come back soon with some more details whatever you need .............
Apr 20 '07 #5
yes i'm doing the programming in C# language ......... and am using the srial port object and its methods to write and read data .......... basically i have to get the data sent from the instrument to the computer so that the analysis can be done easily using excel or any other application ........ and the data that the instrument sends is the wavelength and corresponding absorbance values ( in ascii ) ........... now let me tell you some details about the instrument's serial communication .......... its thru RS232C .......... and I have prepared the cable by following the pin configuration given in the instrument manual .............. what i feel that i'm doing mistake somewhere in the hand shaking part of the communication while reading the data .......... coz I have no problem at all when I send any data from my application ........... and the handshaking is thru RTS/CTS ............. so tell me now what should i do ............. i didnt find anything regarding asynchronous mode of reading data ........... so please guide me
Apr 21 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dan | last post by:
I wnat to see in browser an status from an device connected on rs232 port The java class for read from serial port is: //Serial.java import java.io.*; import java.util.*; import...
8
by: Terry Olsen | last post by:
I'm trying to use the RS232 class that was in the Platform SDK (i think). Has anyone else used this with events successfully? Here's what i've got: ====================== Public WithEvents...
13
by: jay.dow | last post by:
I want to write to the pins of an RS232 without using the serial protocol. The use would be every pin could act to complete a circuit in customized hardware. I could use python to communicate...
4
by: Dave Harry | last post by:
I found the RS232 class from MS's 101 VB samples. Writing to the port works fine. (I've got hyperterminal on the other comm port and a crossover cable between COM1 and COM2) The port is opened...
3
by: lotus | last post by:
Hi all. I want to control two different instrtument but have simliar functionality. Acually the fisrt one is controlled by using serial communication, and the other is controlled by LAN...
0
by: Kean | last post by:
Hi gurus, I am facing a problem to send a 3 characters from my VB.net to LCD modules. I only able to get 1 character display on the LCD module. Dim sTx As String ...
1
by: khizerbasith | last post by:
i need to interface vba in excel to interface it to rs232.need to send the message from the vba throught the rs232 port
0
by: shehzadmajeed | last post by:
I am a Point of Sale Terminal Programmer/Developer and currently assigned to develop a VTI Simulator (Virtual Terminal Interface) than can exchange messages as per Specification through RS232-COM...
0
by: Terry Reedy | last post by:
Devarajulu, Baskar (D.) wrote: asap3lib.py is not part of the stdlib, and the error message is not very informative. Look at line 320 and see what might trigger the error.
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.