Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

controlling a signal generators thru RS232

Status
Not open for further replies.

snooze

New Member
Hi,

i would like to control a HP Signal generators by a computer using RS232 to control arbitrary waveform like square-wave.

may i know how should I start-up?

what program / IDE should I use?

how to initialize the program?

Tks
 
What signal generator? The HP/Agilent website has hundreds of code samples to do what you want to do. You don't mention a model number or programming language you wish to use.

Ron
 
ok. i thought before i go into that, i need some basic idea for the setup first. what program to use eg C langauge / IDE / compiler? should I use C language to write the code? how to write the code?
 
This is an example of what I am getting at. Note the variety of drivers and code samples just for the meter I used as an example.

ok. i thought before i go into that, i need some basic idea for the setup first. what program to use eg C langauge / IDE / compiler? should I use C language to write the code? how to write the code?

While I don't develop in C and am not a programmer type I do stumble along in a few VB variations. As can be seen by the link the possibilities are quite a few. I used the DMM only as an example. How you go about establishing communication is your call based on what language(s) you are familiar with and proficient with.

Ron
 
sorry, that is a broken link.. couldn't see variety of drivers and code samples

basically, i have no idea how to kick-start? what program to use , etc? i more proficient with Borland C language (those basic C language)
 
Agilent 33120A / HP 33120A Function Arbitrary Waveform Generator

(look like this, but model need to confirm again)

**broken link removed**
 
Last edited:
Reloadron, Thanks for the useful link

i need a platform to do the programming. need utility to do some practical coding. need some help to create that initial step.. can somebody guide me.. Appreciate your kind assistance
 
To get started Microsoft does offer a Visual Studio Express package consisting of:

Visual Basic 2010 Express
Visual C# 2010 Express
Visual C++ 2010 Express
Visual Web Developer 2010 Express
All - Offline Install ISO image file
Windows Phone Developer Tools
Microsoft Captions Language Interface Pack

There are plenty of HP/Agilent code samples done in Visual Studio.NET so worth a look. They can be found here. There are plenty of online tutorials for it. I suggest downloading all in an ISO file if you are familiar with ISO files and how to extract and install them.

If you have absolutely no programming experience this will take time and effort on your part. Best of luck.

Ron
 
LabView is the defacto standard for instrument control.

I agree but the base version of NI Lab View is about a $1,200 bundle and it goes up from there. They do offer a free 30 day trial of the Pro Version. That can be found here. My company uses it and it is great stuff. Not exactly inexpensive but really nice. :)

Ron
 
I learned it with version 2.2.1 Macintosh only version at the time. The language was in rapid flux - constantly changing.

FWIW: The language is DATA FLOW based. The equivelent of a subroutine has a "front panel" of variables and thus it's called a VI or Virtual Instrument. The next vi executes when the input data becomes available. Thus it it very easy to write routines that execute in parrallel and it's possible to generate unwanted "race conditions" writing the software. Each vi is a graphical object. There is a vast library of vi's or device drivers available for variuos instruments. Drawback, upgrades always seem to be necessary since a manuafacturer will write in the current version of LV and newer vi's will not open in older versions. A student version is available. I forget the limitations.
 
Sending command over RS232

Hi,

I m new to serial port communication.I m trying to communicate with a DMM (Sanwa Digital Multimeter PC 5000) through Advance Serial Port Communicator.The following information is given in their help file.


Data request command format for PC5000

DLE STX Command arg1 arg2 arg3 DLE ETX
10h 02h 00h 00h 00h 00h 10h 03h

What is the data or string to be send over RS232 to communicate with device?
 
STX is the Start of Text message or a Control B. The data is given to you in Hex form which is a common way to represent data. In Excel, CODE(String) and CHAR(Integer) are he complementary functions. You could build a string with A$=Chr$(16)+CHR$(2)+chr$(c)+chr$(arg1)+.... or whatever the funchon is to convert a number to a character.

10h = 1*16+0 or 16 decimal. 02h = 0*16 +2 etc.

You need to be sure your interface is set in the proper mode. e.g. 8 data, no parity which is a likely mode. Serial communication consists of a start bit, 7 or 8 data bits, an optional parity bit for 7 bit data, and 1, 1.5 or 2 stop bits. The 1.5 stop bits was used for the baud rate 134.5. The lower bit rates had more stop bits because the device was mechanical and the motor needed more time to stop.
 
i need some help to test the serial communication RS232 between the PC and the signal generator.

can anybody give me some advice? can anybody gives some starter?

have tried using TeraTerm to send a file to the Signal generator but ain't working.
 
If you are looking for options:
33250=80mhz
33220=20mhz
33522 and 33521=30mhz
The new units talk GPIB, USB and LAN.
We often use excel with visual basic to talk USB or LAN.
 
any sample program to guide me to writing the interface software between the PC and signal genarator?

if I can take care of the Serial communication, how should write the program?
 
Last edited:
Try loopback first. Connect TD to RD, CTS to RTS, DTR to DSR. You may only need the first one. Check for echo or a double echo so at least you know your port is working. Hyperterminal was removed from win 7, but if you place the dll and the application in the same directory it should work under win 7.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top