PDA

View Full Version : Serial communications



c131frdave
09-18-2008, 05:11 AM
I have a new project that seems like it should be pretty simple, but is over my head.

I have a digital multi meter that is connected to an AC·generator.· The DMM has a built in occilliscope, and reports the following information on it's display screen:

Volts
Amps
Watts
Vars
VoltAmps

This meter has a serial output if you want to use it for external monitoring or reference.· The serial output sends the above information out·the port.


My project is to use a BS2 to control Vars.· The voltage regulator has two 24VDC inputs, one raises excitation, the other lowers excitation.· I would like the BS2 to read Vars from the DMM, and then use one of two relays to pulse the excitation control to move the Var output/input to a desired value.

The ultimate goal is to have a small control panel with an on/off switch, and a selector dial.· Just above the selector dial will be a digital read out that goes from -7 to positive 7, and the operator would simply turn the dial to the desired Var output/input.· The PS2 would see the selected value, use the input from the DMM's serial port to "see" the current Var output/input, and pulse the exciter up or down until the selected value and actual value match.


But, I'm a straight rookie when it comes to serial communications.· How would I be able to tell what reading is what?· The serial connection sends volts, amps, watts, vars, and voltamps.· I just want to look at the vars.· Is there some sort of serial standard that all serial devices use?· Should I ask the manufacturer for their "serial pulse scheme", or something like that?· Any suggestions?·· Thanks so much in advance.

·

Mike Green
09-18-2008, 05:20 AM
There's no standard for the information sent over the serial communications. You'll have to get that from the meter manufacturer.

If you have a manual and it describes how to hook your meter to a PC for example, you could use the PC to look at the format of the data and guess what the rules are for the format. It can't be very complicated.

c131frdave
09-18-2008, 05:22 AM
That's what I was afraid of. Thanks.

stamptrol
09-18-2008, 05:59 AM
Do you have a make and model for your DMM?

As Mike suggests, this is not too complicated. Even without the manual, half an hour with a PC and Hyperterminal should give you the information you need to get the meter connected to the Stamp.

Cheers,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

c131frdave
09-18-2008, 06:57 AM
Care to explain? The manual shows three pins, data in, data out, and computer ground. As I am a serial rookie, I don't even know what hyperterminal is...

KRAJ
09-18-2008, 08:09 AM
c131frdave;
These are the standard (minimum) pins necessary to communicate via RS232 w/the computer.
Data in from the DVM should go to data out in the Pc, and viceversa data out to data in. You need to know the protocol in order to communicate (baud rate, #of bits, parity, etc). That should be in the manual, if not just experiment until it communicates (you can'y hurt the computer or BS). ·If you do not have the manual, contact the manufacturer or search the web for one (Just to make it easier). Once you establish communications you can figure out the data structure in no time by downloading it to a spreadsheet or word processor. Set a comma separator or TABS·to separate the fields.

Once you have that you should be able to get your DVM interfaced.
If you need any additional help do not hesitate to write.

Post Edited (batt_man) : 9/18/2008 1:15:38 AM GMT

c131frdave
09-19-2008, 12:49 AM
Ok, I just finished talking with the manufacturer and he stated the following:

you will use the Modbus registers 40279 – 40281 (for voltage AN, BN, CN) and 40290 (for Total VAR).

So what does that mean? lol

Mike Green
09-19-2008, 12:54 AM
The Wikipedia has an article on Modbus with links to details: en.wikipedia.org/wiki/Modbus (http://en.wikipedia.org/wiki/Modbus)
This looks like a good introductory link: www.simplymodbus.ca/FAQ.htm (http://www.simplymodbus.ca/FAQ.htm)

Post Edited (Mike Green) : 9/18/2008 5:59:46 PM GMT

stamptrol
09-19-2008, 09:23 PM
The Modbus protocol will make your job slightly harder. No, that's a lie.....it will make it a lot harder. Plain old serial is much easier to work with. But, Modbus is a very well recognized and widely implemented industrial communication standard. Getting it to work well on a stamp will entitle you to wear a pocket protector and several multicolored pens!

Basically, the stamp will ask the meter to send it the contents of those registers.

If the meter is expecting to use the ASCII version of Modbus, it can be done. If it uses the RTU version, the timing requirements can be a bit tight for the Stamp.

Assuming it is the ASCII version, one technique is to store the query statement in a DATA statement in the Stamp, including the checksum. If you Google Simply MODBUS , theres a utility program which will show you what the query statement looks like for those registers you're concerned with.

Once the meter has been successfully queried, the data coming back can be read by the stamp and interpreted from its Hex or octal format and manipulated as you desire.

Cheers,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·

c131frdave
09-22-2008, 06:17 AM
Ugh... Thanks for that though.

I have 4 "registers", one for each phase of volts, and one for vars. So the stamp asks the meter for register xxxx and waits for a reply, right? Thanks for the help guys. The rs-282 port is connected to a rs-485 blinky blinky (I don't know what it's called), and then give a signal to the generator's computer. I hope I can tap into that some how. The instructions for the blinky blinky says it can support four devices. I have the instructions, it's just a matter of educating myself about the terminology.

Thanks again!

stamptrol
09-22-2008, 07:41 PM
The one thing that may make the pain bearable is that you can get the Stamp to ask for several registers at one time. So, you can send one query and get back the 4 registers you want.

Blinky-blinky? RS232-485 signal converter.

Let us know how you make out.

Cheers,

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tom Sisk

http://www.siskconsult.com
·