MATES / Modular Automatic Test Equipment System API  2.5.0.0
Public Member Functions | Properties
IDacNode Interface Reference

Represents a common DAC module. More...

Public Member Functions

void SetDac (int channel, double voltage)
 Set the value of the DAC. Takes calibration data into account. More...
 
void SetDacRaw (int channel, int val)
 Set raw value of the DAC. More...
 
double GetDac (int channel)
 Get the value of the DAC. More...
 
double GetDacMinimum (int channel)
 Get the minimum allowable value of the DAC. More...
 
double GetDacMaximum (int channel)
 Get the maximum allowable value of the DAC. More...
 
float GetRegisterF (RegisterNumber reg)
 Get floating point MATES register. More...
 
int GetRegisterI (RegisterNumber reg)
 Get regular (integral) MATES register. More...
 
void SetRegisterI (RegisterNumber reg, int val)
 Set regular (integral) MATES register. More...
 
void SetRegisterF (RegisterNumber reg, float val)
 Set floating point MATES register. More...
 

Properties

Mates Owner [get]
 The MATES system that this node belongs to. More...
 
NodeId NodeId [get]
 The MATES system that this node belongs to. More...
 
int Addr [get]
 The node address. More...
 

Detailed Description

Represents a common DAC module.

Member Function Documentation

void SetDac ( int  channel,
double  voltage 
)

Set the value of the DAC. Takes calibration data into account.

Parameters
channelThe DAC channel number [0,39]
voltageThe voltage value to set (Volts).

Example usage (mates_test_03.cs):

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Viresco.Mates;
namespace unit_tests
{
[TestClass]
public class mates_test_03
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dac5Node dac = mates.NewDac5Node(NodeId.mates_dac5_mk1_1);
Adc5Node adc = mates.NewAdc5Node(NodeId.mates_adc5_mk1_1);
// Assume there is loopback between DAC and ADC.
dac.SetDac(5, 1.0);
double check = adc.GetAdc(5);
Assert.IsTrue(check >= 0.99 && check <= 1.01);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}

Implemented in DacNode.

void SetDacRaw ( int  channel,
int  val 
)

Set raw value of the DAC.

Parameters
channelThe DAC channel number [0,39].
valThe raw DAC binary code to write.

Example usage (mates_test_04.cs):

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Viresco.Mates;
namespace unit_tests
{
[TestClass]
public class mates_test_04
{
[TestMethod]
public void TestMethod()
{
using (Mates mates = new Mates("mates_REMOTE.mon", 1))
{
try
{
Dac5Node dac = mates.NewDac5Node(NodeId.mates_dac5_mk1_1);
// Set the first channel to the half of the range.
dac.SetDacRaw(0, 65536 / 2);
}
catch
{
Console.Write("Cannot discover node.\n");
}
}
}
}
}

Implemented in DacNode.

double GetDac ( int  channel)

Get the value of the DAC.

Parameters
channelThe DAC channel number [0,39]
Returns
The DAC value in Volts.

Implemented in DacNode.

double GetDacMinimum ( int  channel)

Get the minimum allowable value of the DAC.

Parameters
channelThe DAC channel number [0,39]
Returns
The DAC minimum value in Volts.

Implemented in Dac5Node, and DacNode.

double GetDacMaximum ( int  channel)

Get the maximum allowable value of the DAC.

Parameters
channelThe DAC channel number [0,39]
Returns
The DAC maximum value in Volts.

Implemented in Dac5Node, and DacNode.

float GetRegisterF ( RegisterNumber  reg)
inherited

Get floating point MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
Returns
The register value.
int GetRegisterI ( RegisterNumber  reg)
inherited

Get regular (integral) MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
Returns
The register value.
void SetRegisterI ( RegisterNumber  reg,
int  val 
)
inherited

Set regular (integral) MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
valThe register value.
void SetRegisterF ( RegisterNumber  reg,
float  val 
)
inherited

Set floating point MATES register.

Parameters
regThe register number to access (see Viresco.Mates.Registers.RegisterNumber).
valThe register value.

Property Documentation

Mates Owner
getinherited

The MATES system that this node belongs to.

NodeId NodeId
getinherited

The MATES system that this node belongs to.

int Addr
getinherited

The node address.


The documentation for this interface was generated from the following file: