tags:

views:

488

answers:

3

Hi,

Does anyone have any C# example code to communicate with a device thru an RS-232 serial port using VISA ?

I just want to issuse some simple commands and queries to the device as well as open and close it, of course.

Any help or advice would be most appreciated.

Regards, George.

A: 

Here is a link

adatapost
Thanks for that, but this does not use VISA, and thats what I am having the problem with.
George
A: 

There is sample code here:

C# and Visual Basic .NET Instrument Control Tutorial

It uses National Instrument software:

"The VISA .NET API is an object-oriented interface made up of a set of .NET classes to communicate with instruments with VISA. You can use .NET compliant languages such as C# and Visual Basic .NET."

Peter Mortensen
Sorry, I should have mentioned that its an Agilent scope I am using and this seems to be a bit different to the NI one.I have asked Agilent several times for help with this and as you can see I am still looking. I find it hard to believe nobody has already tried to do this relatively simple thing with their scopes alrewady, after all, what are the RS-232 communication modules for anyway ? Mumble mutter.
George
Perhaps you should update your question with this information.
Peter Mortensen
What country are you in ? We use HPLC systems from Agilent and I am under the impression that their service is OK.
Peter Mortensen
A: 

I finally got the answer I was looking for.

It appears all you need to do to access an RS-232 serial port instead of a USB port in VISA is change the USB id string to the RS-232 string (ASRL1::INSTR).

I knew it was going to be simple, just not that simple.

Thanks for all the other ideas.

George