2 using your own program – BNC 630 User Manual

Page 64

Advertising
background image

59

7.7.2 Using your own program

You may use your own application program to send the arbitrary waveform data to the 630.

To download a waveform to the 630, you need to send the following to the 630 through the serial port:

1. A two character header consisting of

a) The “W” character. This tells the 630 to expect the download of an arbitrary waveform.

b) A single character which specifies the data format. The character may be

“F” for floating point or decimal format
“T” for time & value floating point format
“D” for digital format
“H” for hexadecimal format
“I” for Integer format
“B” for binary format

2. The waveform data values

3. An optional “X” or “x” character at the end of the data. The “X” character denotes the end of data. If the “X” character is
missing, the 630 will assume all data has been sent after 1 second timeout.

Whitespace (spaces, carriage returns, tabs, etc.) is allowed before or after the W character. Whitespace may come after the format
character except for Binary format. (For more information on data formats, please refer to section 9.0)

EXAMPLE: Sending the following characters downloads a four point waveform in floating point format:

W F .1234 .6874 -2.345e-1 -1.0

The serial port on the 630 defaults to the following parameters: 1 start bit, 8 data bits, 1 stop bit, no parity. It is important that the
sending program’s baud rate match that of the 630. To inspect or change the 630’s baud rate, press the Mode key and then the
Offset key. For more information changing the baud rate, please refer to section 5.20.

You do not need to tell the 630 how many points are in the waveform, or which point is the last. If the 630 does not receive any
characters over the serial port for a 1 second time-out, then the 630 assumes that all arbitrary waveform points have been received.
If the 630 is in Arbitrary Waveform mode, the new waveform will be generated immediately after the time-out.

The 1 second time-out can be avoided by placing an ASCII “X” character (upper or lower case) at the end of your data. This
character tells the 630 that the end of the data has been reached. The 630 will then begin generation of the new waveform
immediately. The “X” character cannot be used with the Binary format.

Make sure that there are no interruptions exceeding 1 second while downloading a waveform, else the 630 will time out and end
the download. Also, if you do not have an “X” character at the end of your data then you must stop sending characters to the 630 for
a minimum of 1 second so that the waveform will be generated.

An example program ARB.BAS is included on the supplied compact disk which demonstrates downloading waveforms in a variety
of formats directly from the program to the 630.

Advertising