|
fdhwlib
2.0.25
|
#include <wgcommand.h>
Implementation of the WG Command interface defined by Mair & Rohner OEG (M&R Systems, www.mrsys.at) for their waveform generators.
Tested with waveform generator WG-1220.
Implement timeout waiting for the device
Implement the missing commands
Definition at line 31 of file wgcommand.h.
| WGCommand::WGCommand | ( | ) |
| WGCommand::~WGCommand | ( | ) |
| void WGCommand::closeDevice | ( | ) |
Close device.
Restore the parameters of the device
| double WGCommand::exp10 | ( | double | exp | ) |
Calculate 10 power exp.
| double WGCommand::getAmplitude | ( | ) |
Get amplitude in mV.
| int WGCommand::getClock | ( | ) |
Get clock source.
| int WGCommand::getDutyCycle | ( | ) |
Get duty cycle.
| int WGCommand::getFilterMode | ( | ) |
Get filter mode.
| double WGCommand::getFrequency | ( | ) |
Get freqency in Hz.
| int WGCommand::getGain | ( | ) |
Get gain.
| int WGCommand::getMode | ( | ) |
Request mode (0 = remote/ 1= local)
| int WGCommand::getModulation | ( | ) |
Get modulation type.
| double WGCommand::getOffset | ( | ) |
Get offset in mVpp.
| int WGCommand::getOffsetMode | ( | ) |
Get offset mode.
| int WGCommand::getParameter | ( | char | cmdId | ) |
Generic function to get a two byte parameter.
| int WGCommand::getSyncPosition | ( | ) |
Get sync Position.
| int WGCommand::getTriggerMode | ( | ) |
Get trigger mode.
| void WGCommand::getType | ( | int * | model, |
| int * | nChannel = 0, |
||
| int * | morph = 0 |
||
| ) |
Get device type.
| int WGCommand::getVersion | ( | char * | version | ) |
Get firmware version The version V <major>.
<minor> is coded as <major> * 10 + <minor>
| int WGCommand::getWaveForm | ( | ) |
Get waveform.
| void WGCommand::openDevice | ( | const char * | device = "/dev/ttyS0" | ) |
Open device and set correct parameter to the serial device.
| void WGCommand::sendCmd | ( | unsigned char * | cmd, |
| unsigned char * | ack | ||
| ) |
Send one command to the device.
| void WGCommand::setAmplitude | ( | double | amplitude | ) |
Set amplitude in mV.
| void WGCommand::setClock | ( | int | source | ) |
Set clock source.
| void WGCommand::setDebug | ( | int | debug | ) |
Set debug level (0 = no debug)
| void WGCommand::setDefaults | ( | ) |
Set to factory defaults.
| void WGCommand::setDutyCycle | ( | int | dutycycle | ) |
Set duty cycle in percent.
| void WGCommand::setFilterMode | ( | int | mode | ) |
Set filter mode (filter enabled, filter disabled)
| void WGCommand::setFrequency | ( | double | frequency | ) |
Set frequency in Hz.
| void WGCommand::setGain | ( | int | gain | ) |
Set gain (off, 0dB, -20dB)
| void WGCommand::setMode | ( | int | mode | ) |
Select mode of operation (0 = remode/ 1 = local)
| void WGCommand::setModulation | ( | int | mode | ) |
Set modulation type (off, FM, AM)
| void WGCommand::setOffset | ( | double | offset | ) |
Set offset in mVpp.
| void WGCommand::setOffsetMode | ( | int | mode | ) |
Set offset mode (signal positive, signal negtive, signal negative and positive)
| void WGCommand::setParameter | ( | char | cmdId, |
| int | par1 = 0, |
||
| int | par2 = 0 |
||
| ) |
Generic function to set a two byte parameter.
| void WGCommand::setSyncPosition | ( | int | pos | ) |
Set sync position.
| void WGCommand::setTriggerMode | ( | ) |
Set trigger mode (continuous, single shot, external trigger)
| void WGCommand::setWaveForm | ( | int | mode | ) |
Set wavform (sinus, square, triangular, DC, noise)
struct termios WGCommand::bufferedTio [private] |
Buffered terminal settings.
Definition at line 173 of file wgcommand.h.
int WGCommand::debug [private] |
Debug level.
Definition at line 161 of file wgcommand.h.
std::string WGCommand::device [private] |
Device name.
Definition at line 164 of file wgcommand.h.
int WGCommand::fd [private] |
File descriptor for open device.
Definition at line 167 of file wgcommand.h.
double WGCommand::gain [private] |
Gain factor (0dB -> 1, -20dB -> 0.1)
Definition at line 179 of file wgcommand.h.
char WGCommand::lastAck[7] [private] |
Buffer with the last acknowlede.
Definition at line 176 of file wgcommand.h.
struct termios WGCommand::wgTio [private] |
Settings of serial device for WG devices.
Definition at line 170 of file wgcommand.h.