ProtoVoltaics RTD Shield with RS232 and RS485 Transceivers  Version 8
 All Classes Functions Variables Pages
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
PV_RTD_RS232_RS485 Class Reference

ProtoVoltaics Resistance Temperature Detector Class. More...

#include <PV_RTD_RS232_RS485_Shield.h>

Inheritance diagram for PV_RTD_RS232_RS485:
Inheritance graph
[legend]
Collaboration diagram for PV_RTD_RS232_RS485:
Collaboration graph
[legend]

Public Member Functions

 PV_RTD_RS232_RS485 (byte i2c_address, float R0)
 Class constructor. More...
 
void Configure_RTD_Alarm (byte alarm, boolean below, boolean above, byte wires, byte channel)
 Configure the RTD trigger for a given alarm channel. More...
 
void Connect_Print_To (boolean rs232, boolean rs485)
 Set where print functions output. More...
 
void Disable_Alarm (byte alarm)
 Disables the given alarm. More...
 
int Disable_All_RTD_Channels ()
 Disable all RTD channels. More...
 
void Enable_Alarm (byte alarm)
 Enables the given alarm. More...
 
int Enable_RTD_Channel (byte wires, byte channel)
 Enables a channel for processing. More...
 
void Factory_Reset ()
 Perform a factory reset on the shield.
 
byte Get_Alarm_Enables ()
 Returns a byte representing with alarms are enabled. More...
 
byte Get_Enabled_RTD_Channels (byte wires)
 Returns a byte with bits representing which channels are enabled. More...
 
unsigned long Get_RTD_ADC_Reading (byte wires, byte channel, int timeout_ms=PV_RTD_COMMUNICATION_TIMOUT_MS)
 Acquire a reading from the analog to digital converter. More...
 
float Get_RTD_Bit_Weight (byte wires, byte channel)
 The bit-weight of the analog-to-digital converter readings. More...
 
byte Get_RTD_Channel_Limit (byte wires)
 Returns the number of channels for the wire type. More...
 
float Get_RTD_Idac (byte wires, byte channel)
 Returns the amperage output on the digital to analog converter output in units of amperes. More...
 
float Get_RTD_PGA (byte wires, byte channel)
 Returns the gain setting of the programmable gain amplifier. More...
 
float Get_RTD_Rbias ()
 Returns the shield's Rbias resistor value. More...
 
float Get_RTD_Resistance (byte wires, byte channel)
 Returns the calculated resistance between the ADC's input terminals. More...
 
unsigned int Get_RTD_SPS ()
 Returns the speed setting of the temperature measurements in samples-per-second. More...
 
float Get_RTD_Temperature_degC (byte wires, byte channel)
 Returns the temperature based on the RTD reading in units of degrees Celsius. More...
 
float Get_RTD_Temperature_degF (byte wires, byte channel)
 Returns the temperature based on the RTD reading in units of degrees Fahrenheit. More...
 
float Get_RTD_Temperature_degR (byte wires, byte channel)
 Returns the temperature based on the RTD reading in units of degrees Rankine. More...
 
float Get_RTD_Temperature_K (byte wires, byte channel)
 Returns the temperature based on the RTD reading in units of Kelvin. More...
 
float Get_RTD_Voltage (byte wires, byte channel)
 Returns the voltage when the ADC is connected to a given channel. More...
 
float Get_RTD_Vref (byte wires, byte channel)
 Returns the reference voltage being used to bias input to the analog-to-digital converter in units of volts. More...
 
byte Get_Signature ()
 Get the shield's signature. More...
 
boolean Has_RS232_Data ()
 True if new data is waiting on the shield's RS232 port. More...
 
boolean Has_RS485_Data ()
 True if new data is waiting on the shield's RS485 port. More...
 
boolean Is_Signature_Ok (byte signature)
 Checks the sheild's signature. More...
 
boolean Is_Valid_RTD_Channel (byte wires, byte channel)
 Returns true if the wire, channel values represent a valid value pair. More...
 
void Print_Registers ()
 Prints the memory registers of the shield. More...
 
byte Read_Register (int register_address)
 Read a register from the shield. More...
 
byte Read_RS232 ()
 Read a byte from the RS232 port. More...
 
byte Read_RS485 ()
 Read a byte from the RS485 port. More...
 
void Reset ()
 Perform a software reset on the shield.
 
void Set_Alarm_Source (byte alarm, boolean rtd, boolean rs232, boolean rs485)
 Sets the alarm source. More...
 
boolean Set_RS232_Configuration (unsigned long baud=115200, byte data_bits=8, byte parity= 'N', byte stop_bits=1, boolean polarity=false)
 Set the RS232 communication configuration. More...
 
boolean Set_RS485_Configuration (unsigned long baud=115200, byte data_bits=8, byte parity= 'N', byte stop_bits=1, boolean polarity=false)
 Set the RS485 communication configuration. More...
 
void Set_RTD_Alarm_Lower_Limit (byte wires, byte channel, long limit)
 Sets the lower alarm limit for an RTD channel. More...
 
void Set_RTD_Alarm_Upper_Limit (byte wires, byte channel, long limit)
 Sets the upper alarm limit for an RTD channel. More...
 
float Set_RTD_Idac (byte wires, byte channel, float new_idac_value)
 Sets the amperage output on the digital to analog converter output current in units of amperes. More...
 
float Set_RTD_PGA (byte wires, byte channel, byte new_gain_value)
 Sets the gain for the programmable gain amplifier. More...
 
unsigned int Set_RTD_SPS (unsigned int new_sps_value)
 Sets the speed setting of the temperature measurements in samples-per-second. More...
 
size_t write (uint8_t data)
 The base function that supports the print and println functions. More...
 
int Write_Register (int register_address, byte data)
 Write a register to the shield. More...
 
int Write_RS232 (byte data)
 Write a byte to the RS232 port. More...
 
int Write_RS485 (byte data)
 Write a byte to the RS485 port. More...
 

Static Public Attributes

static const int PV_RTD_COMMUNICATION_TIMOUT_MS = 100
 The amount of time to wait for an I2C replay message.
 

Private Member Functions

byte Get_Enabled_RTD_Channels_Byte (byte wires)
 Returns a byte with bits representing which channels are enabled. More...
 
byte Get_RTD_Idac_PGA_Configuration (byte wires, byte channel)
 Get the Idac and PGA settings. More...
 
int Get_RTD_Idac_PGA_Register (byte wires, byte channel)
 Get the register that holds the Idac and PGA setting. More...
 
byte Get_UART_Configuration_Byte (byte data_bits, byte parity, byte stop_bits, boolean polarity)
 Translate the UART configuration into a control byte. More...
 
int Set_Register (int register_address)
 Used to set the register to read from or write to. More...
 

Private Attributes

int m_i2c_address
 The I2C address of the shield.
 
boolean m_print_to_rs232
 True if print operations should be output on the RS232 port.
 
boolean m_print_to_rs485
 True if print operations should be output on the RS485 port.
 
float m_R0
 The characteristic resistance of the RTD sensor at 0 degrees Celisus.
 

Detailed Description

ProtoVoltaics Resistance Temperature Detector Class.

Class object for communicating with the ProtoVoltaics multichannel RTD shield with RS232 and RS485 transceivers.

Constructor & Destructor Documentation

PV_RTD_RS232_RS485::PV_RTD_RS232_RS485 ( byte  i2c_address,
float  R0 
)

Class constructor.

  Creates an object to communicate with the RTD shield.
Parameters
i2c_addressThe I2C address of the RTD shield.
R0The resistance of the RTD sensor at 0 degrees Celsius. This is 100.0 for a Pt-100 RTD sensor, 1000.0 for a Pt-1000.0 RTD sensor, and so on.

Member Function Documentation

void PV_RTD_RS232_RS485::Configure_RTD_Alarm ( byte  alarm,
boolean  below,
boolean  above,
byte  wires,
byte  channel 
)

Configure the RTD trigger for a given alarm channel.

This sets the configuration for an RTD alarm. If below and above are both false, the alarm will trigger when the value is between the lower limit threshold and upper limit threshold. If below and above are both true, the alarm will trigger when the value is outside (meaning not between) the lower limit threshold and upper limit threshold.

Parameters
alarmThe alarm to configure: alarm 1 is on pin D2, alarm 2 is on pin D3, alarm 3 is on pin D4, alarm 4 is on pin D5.
belowSet to true if you want an alarm when the value is below the lower limit threshold.
aboveSet to true if you want an alarm when the value is above the upper limit threshold.
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
See Also
Set_Alarm_Upper_Limit(), Set_Alarm_Lower_Limit()

Here is the call graph for this function:

void PV_RTD_RS232_RS485::Connect_Print_To ( boolean  rs232,
boolean  rs485 
)

Set where print functions output.

This controls where print and println function are sent. If both parameters are set to true, then the print and println functions will result in the same output being sent to both ports.

Parameters
rs232Set to true if you want the print and println functions to output to the RS232 port.
rs485Set to true if you want the print and println functions to output to the RS485 port.
void PV_RTD_RS232_RS485::Disable_Alarm ( byte  alarm)

Disables the given alarm.

Disables the given alarm while leaving the enabled state of the other alarms unchanged.

Parameters
alarmThe alarm to disable: use 1 to disable alarm 1 (on pin D2), use 2 to disable alarm 2 (on pin D3), use 3 to disable alarm 3 (on pin D4), use 4 to disable alarm 4 (on pin D5).

Here is the call graph for this function:

int PV_RTD_RS232_RS485::Disable_All_RTD_Channels ( )

Disable all RTD channels.

This will tell the shield to not collect and process RTD measurements. This is typically used if you only want to enable one channel: you could disable all channels and then enable the channel you care about.

Returns
The return value from the I2C transmission.
void PV_RTD_RS232_RS485::Enable_Alarm ( byte  alarm)

Enables the given alarm.

Enables the given alarm while leaving the enabled state of the other alarms unchanged.

Parameters
alarmThe alarm to enable: use 1 to enable alarm 1 (on pin D2), use 2 to enable alarm 2 (on pin D3), use 3 to enable alarm 3 (on pin D4), use 4 to enable alarm 4 (on pin D5).

Here is the call graph for this function:

int PV_RTD_RS232_RS485::Enable_RTD_Channel ( byte  wires,
byte  channel 
)

Enables a channel for processing.

Tells the shield to take RTD measurements for the given wires, channel combination.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The return value from the I2C transmission.

Here is the call graph for this function:

byte PV_RTD_RS232_RS485::Get_Alarm_Enables ( )

Returns a byte representing with alarms are enabled.

The first four bits returned by this function are meaningless. The four least-significant-bits represent the enabled state of the alarms on the shield. When an alarm is enabled it will trigger an output transition on it's alarm pin. When an alarm is not enabled it's alarm pin will never change state.

Returns
A byte representing which alarm pins are enabled on the shield.

Here is the call graph for this function:

Here is the caller graph for this function:

byte PV_RTD_RS232_RS485::Get_Enabled_RTD_Channels ( byte  wires)

Returns a byte with bits representing which channels are enabled.

The least-significant-bit represents the first channel. Bit positions with a 1 mean the channel is enabled and the shield will take RTD measurements and process them. If wires is 2, the most-significant-bit is meaningless and the lower 7 bits represent the seven two-wire RTD channels. If wires is 3, the 4 most-significant-bits are meaningless and the lower 4 bits represent the four three-wire RTD channels. If wires is 4, the 5 most-significant bits are meaningless and the lower 3 bits represent the three four-wire RTD channels.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
Returns
The channels that are enabled: the channels that will collect and process RTD measurements.

Here is the call graph for this function:

byte PV_RTD_RS232_RS485::Get_Enabled_RTD_Channels_Byte ( byte  wires)
private

Returns a byte with bits representing which channels are enabled.

When wires is 2 this returns the same value as Get_Enabled_Channels(). When wires is 3 or 4 the return value is the same: a byte where the low 4 bits represent the enabled states of the 3W channels, the most-significant-bit is zero, and the other bits retpresent the enabled state of the the 4W channels.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
Returns
The channels that are enabled: the channels that will collect and process RTD measurements.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long PV_RTD_RS232_RS485::Get_RTD_ADC_Reading ( byte  wires,
byte  channel,
int  timeout_ms = PV_RTD_COMMUNICATION_TIMOUT_MS 
)

Acquire a reading from the analog to digital converter.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
timeout_msThe maximum amount of time to wait for a reading from the analog-to-digital converter.
Returns
The multiplying factor to convert ADC readings to the voltage read on the ADC's inputs.

Here is the call graph for this function:

Here is the caller graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Bit_Weight ( byte  wires,
byte  channel 
)

The bit-weight of the analog-to-digital converter readings.

This is the scale factor that converts analog-to-digital readings into a voltage value. Multiplying the analog-to-digital readings by this value will tell you the voltage on the analog-to-digital converter's inputs.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The multiplying factor to convert ADC readings to the voltage read on the ADC's inputs.

Here is the call graph for this function:

Here is the caller graph for this function:

byte PV_RTD_RS232_RS485::Get_RTD_Channel_Limit ( byte  wires)

Returns the number of channels for the wire type.

Returns 7 when wires is 2, 4 when wires is 3, 3 when wires is 4, and 0 for all other values.

Parameters
wiresThe wiring configuration of the RTD.
Returns
The number of channels available when using the given RTD wiring.
float PV_RTD_RS232_RS485::Get_RTD_Idac ( byte  wires,
byte  channel 
)

Returns the amperage output on the digital to analog converter output in units of amperes.

The ADS1248 has two current sourcing digital-to-alalog converters. The output current can not be independently controlled, but the output connections of the DACs can be independently controlled. This function returns the output current setting for the DAC given a RTD wire and channel value.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The output drive current of the current digital-to-analog converter.
See Also
Set_RTD_Idac()

Here is the call graph for this function:

Here is the caller graph for this function:

byte PV_RTD_RS232_RS485::Get_RTD_Idac_PGA_Configuration ( byte  wires,
byte  channel 
)
private

Get the Idac and PGA settings.

Returns a byte representing the configuration state of the Idac and PGA settings.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
A byte representing the Idac and PGA configuration.

Here is the call graph for this function:

Here is the caller graph for this function:

int PV_RTD_RS232_RS485::Get_RTD_Idac_PGA_Register ( byte  wires,
byte  channel 
)
private

Get the register that holds the Idac and PGA setting.

Returns the register on the sheild that holds the Idac and PGA settings for the given wires, channel values.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The register address for the Idac and PGA configuration values.

Here is the call graph for this function:

Here is the caller graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_PGA ( byte  wires,
byte  channel 
)

Returns the gain setting of the programmable gain amplifier.

The ADS1248 amplifies the signal from the RTD before measuring it with its 24-bit analog-to-digital converter. This is the gain (which is a unitless quantity) for the given wire and channel values.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The gain setting of the programmable gain amplifier.
See Also
Set_RTD_PGA()

Here is the call graph for this function:

Here is the caller graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Rbias ( )

Returns the shield's Rbias resistor value.

  Rbias sets the reference voltage on the ADS1248.  This resistor value has changed with different versions of the shield.  This
  function returns the value that should be used for the Rbias resistor value for the RTD shield.
Returns
The Rbias resistor value in ohms.

Here is the call graph for this function:

Here is the caller graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Resistance ( byte  wires,
byte  channel 
)

Returns the calculated resistance between the ADC's input terminals.

The resistance between the ADC's inputs is calculated as Get_Voltage/Get_Idac. This will be the resistance of the RTD element connected to the given wire, channel value.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The resistnace between the ADC's input terminals in units of ohms.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned int PV_RTD_RS232_RS485::Get_RTD_SPS ( )

Returns the speed setting of the temperature measurements in samples-per-second.

This is the number of temperature readings that the shield takes per second. Larger values give you an updated measurement more frequently. Lower values give you measurements with more "effective number of bits" in the reading, which should give you more stable readings.

Returns
The temperature measurement speed in samples-per-second.

Here is the call graph for this function:

Here is the caller graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Temperature_degC ( byte  wires,
byte  channel 
)

Returns the temperature based on the RTD reading in units of degrees Celsius.

Measures the resistance on the port of the given wires, channel parameter and caluclates the temperature. This uses the Callendar-Van Dusen equation for the temperature calculation.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The temperature of the sensor in units of degrees Celsius.

Here is the call graph for this function:

Here is the caller graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Temperature_degF ( byte  wires,
byte  channel 
)

Returns the temperature based on the RTD reading in units of degrees Fahrenheit.

Measures the resistance on the port of the given wires, channel parameter and caluclates the temperature. This uses the Callendar-Van Dusen equation for the temperature calculation.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The temperature of the sensor in units of degrees Fahrenheit.

Here is the call graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Temperature_degR ( byte  wires,
byte  channel 
)

Returns the temperature based on the RTD reading in units of degrees Rankine.

Measures the resistance on the port of the given wires, channel parameter and caluclates the temperature. This uses the Callendar-Van Dusen equation for the temperature calculation.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The temperature of the sensor in units of degrees Rankine.

Here is the call graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Temperature_K ( byte  wires,
byte  channel 
)

Returns the temperature based on the RTD reading in units of Kelvin.

Measures the resistance on the port of the given wires, channel parameter and caluclates the temperature. This uses the Callendar-Van Dusen equation for the temperature calculation.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The temperature of the sensor in units of Kelvin.

Here is the call graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Voltage ( byte  wires,
byte  channel 
)

Returns the voltage when the ADC is connected to a given channel.

This function connects the analog-to-digital converter to the given wire, channel configuration and returns the measured voltage.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The voltage measured on the analog-to-digital converter's input pins in units of volts.

Here is the call graph for this function:

Here is the caller graph for this function:

float PV_RTD_RS232_RS485::Get_RTD_Vref ( byte  wires,
byte  channel 
)

Returns the reference voltage being used to bias input to the analog-to-digital converter in units of volts.

The ADS1248 requires a biasing voltage for best performance. This voltage is controlled by the hardware configuration and can not be changed in software.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
The reference voltage based on the hardware configuration.

Here is the call graph for this function:

Here is the caller graph for this function:

byte PV_RTD_RS232_RS485::Get_Signature ( )

Get the shield's signature.

The shield's signature is just a register value that is given the value 0xA6 = 166 = 0b10100110 when the shield is powered on. The signature can be overwritten by the Arduino by using I2C library and writing to the address containing the signature, but the shield itseld does not modify the signature value. This value can be checked against the default value of 0xA6 as a means to see if communication with the shield has been corrupted.

Returns
The signature of the shield.
See Also
Is_Signature_Ok()

Here is the call graph for this function:

Here is the caller graph for this function:

byte PV_RTD_RS232_RS485::Get_UART_Configuration_Byte ( byte  data_bits,
byte  parity,
byte  stop_bits,
boolean  polarity 
)
private

Translate the UART configuration into a control byte.

Translates the parameters into the byte value the shield expects for the given UART configuration.

Parameters
data_bitsThe data bits to use: must be either 8 or 9.
parityThe parity to use: must be either 'N' for None, 'O' (the capital-letter O) for Odd, or 'E' for Even.
stop_bitsThe number of stop bits to use: must be either 1 or 2.
polaritySetting this to true will invert the polarity on the receive line. The receive idle state is typically '1', setting this to 'true' will make the expected receive idle state '0'.

Here is the caller graph for this function:

boolean PV_RTD_RS232_RS485::Has_RS232_Data ( )

True if new data is waiting on the shield's RS232 port.

Determines if new data is waiting on the shield's RS232 port.

Returns
True if there is a byte in the shield's RS232 receive buffer that has never been read.

Here is the call graph for this function:

boolean PV_RTD_RS232_RS485::Has_RS485_Data ( )

True if new data is waiting on the shield's RS485 port.

Determines if new data is waiting on the shield's RS485 port.

Returns
True if there is a byte in the shield's RS485 receive buffer that has never been read.

Here is the call graph for this function:

boolean PV_RTD_RS232_RS485::Is_Signature_Ok ( byte  signature)

Checks the sheild's signature.

This function checks the shield's signature against the default value as a means to see if the communication with the shield has been corrupted. The shield's signature value should not change unless manipulated by direct, low-level writes by the Arduino to the shield. The thinking is that if something goes wrong it is unlikely that a query of the shield's signature will return the default value.

Parameters
signatureThe value to check the shield's signature against.
Returns
True if the shield's signature matches the expected value.
See Also
Get_Signature()

Here is the call graph for this function:

boolean PV_RTD_RS232_RS485::Is_Valid_RTD_Channel ( byte  wires,
byte  channel 
)

Returns true if the wire, channel values represent a valid value pair.

There are seven two-wire RTD channels, four three-wire RTD channels, or three four-wire RTD channels. This method returns true if a value 1 through 7 is given when wires is 2; true if a value 1 through 4 is given when wires is 3; true if a value 1 through 3 is given when wires is 4.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
Returns
True if the wires, channel values represent a valid value pair.

Here is the caller graph for this function:

void PV_RTD_RS232_RS485::Print_Registers ( )

Prints the memory registers of the shield.

Prints all of the memory registers of the shield using 'Serial'. The registers are defined in the PV_RTD_Memory_Map.h file.

Here is the call graph for this function:

byte PV_RTD_RS232_RS485::Read_Register ( int  register_address)

Read a register from the shield.

Returns the value at the given register_address on the shield. The register addresses are defined in the PV_RTD_Memory_Map.h file.

Parameters
register_addressThe register to read: see PV_RTD_Memory_Map.h for a description of the register contents.
Returns
The value contained at the given register_address.

Here is the call graph for this function:

Here is the caller graph for this function:

byte PV_RTD_RS232_RS485::Read_RS232 ( )

Read a byte from the RS232 port.

Reads a byte to the shield's RS232 port.

Returns
The last value received on the shield's RS232 port. Zero if the shield has never received data on its RS232 port.

Here is the call graph for this function:

byte PV_RTD_RS232_RS485::Read_RS485 ( )

Read a byte from the RS485 port.

Reads a byte to the shield's RS485 port.

Returns
The last value received on the shield's RS485 port. Zero if the shield has never received data on its RS485 port.

Here is the call graph for this function:

void PV_RTD_RS232_RS485::Set_Alarm_Source ( byte  alarm,
boolean  rtd,
boolean  rs232,
boolean  rs485 
)

Sets the alarm source.

Each of the alarms can be triggered by the RTD value (as configured using Configure_RTD_Alarm()), by new data arriving on the RS232 port, or by new data arriving on the RS485 port. The alarm may also be triggered by multiple sources: by setting the rtd and rs232 parameters to true the alarm will trigger for both conditions.

Parameters
alarmThe alarm for which you want to set the source.
rtdSet to true if you want the RTD value to trigger the alarm.
rs232Set to true if you want new data arriving on the RS232 port to trigger the alarm.
rs485Set to true if you want new data arriving on the RS485 port to trigger the alarm.
See Also
Configure_RTD_Alarm()

Here is the call graph for this function:

int PV_RTD_RS232_RS485::Set_Register ( int  register_address)
private

Used to set the register to read from or write to.

Set the active register on the shield.

Parameters
register_addressThe register address to make active.
Returns
The return value from the I2C transmission.

Here is the caller graph for this function:

boolean PV_RTD_RS232_RS485::Set_RS232_Configuration ( unsigned long  baud = 115200,
byte  data_bits = 8,
byte  parity = 'N',
byte  stop_bits = 1,
boolean  polarity = false 
)

Set the RS232 communication configuration.

Sets the RS232 communication parameters.

Parameters
baudThe communication baud rate.
data_bitsThe data bits to use: must be either 8 or 9.
parityThe parity to use: must be either 'N' for None, 'O' (the capital-letter O) for Odd, or 'E' for Even.
stop_bitsThe number of stop bits to use: must be either 1 or 2.
polaritySetting this to true will invert the polarity on the receive line. The receive idle state is typically '1', setting this to 'true' will make the expected receive idle state '0'.
Returns
True if settings were successfully applied, false if settings were invalid or not successfully applied.

Here is the call graph for this function:

boolean PV_RTD_RS232_RS485::Set_RS485_Configuration ( unsigned long  baud = 115200,
byte  data_bits = 8,
byte  parity = 'N',
byte  stop_bits = 1,
boolean  polarity = false 
)

Set the RS485 communication configuration.

Sets the RS485 communication parameters.

Parameters
baudThe communication baud rate.
data_bitsThe data bits to use: must be either 8 or 9.
parityThe parity to use: must be either 'N' for None, 'O' (the capital-letter O) for Odd, or 'E' for Even.
stop_bitsThe number of stop bits to use: must be either 1 or 2.
polaritySetting this to true will invert the polarity on the receive line. The receive idle state is typically '1', setting this to 'true' will make the expected receive idle state '0'.
Returns
True if settings were successfully applied, false if settings were invalid or not successfully applied.

Here is the call graph for this function:

void PV_RTD_RS232_RS485::Set_RTD_Alarm_Lower_Limit ( byte  wires,
byte  channel,
long  limit 
)

Sets the lower alarm limit for an RTD channel.

This will set the lower threshold for an alarm limit for the given wires, channel pair.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
limitThe threshold value given as a analog-to-digital converter measurement value.

Here is the call graph for this function:

void PV_RTD_RS232_RS485::Set_RTD_Alarm_Upper_Limit ( byte  wires,
byte  channel,
long  limit 
)

Sets the upper alarm limit for an RTD channel.

This will set the upper threshold for an alarm limit for the given wires, channel pair.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
limitThe threshold value given as a analog-to-digital converter measurement value.

Here is the call graph for this function:

float PV_RTD_RS232_RS485::Set_RTD_Idac ( byte  wires,
byte  channel,
float  new_idac_value 
)

Sets the amperage output on the digital to analog converter output current in units of amperes.

This will set the output amperage used when making measurements for a RTD wire and channel configuration. If the value of new_idac_value is not one of the possible settings then the value will not be changed. 1500e-6 ampere is the default value.

Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
new_idac_valueThe drive amperage to use for the wire and channel configuration. Must be a value from the ADS1248 datasheet: 0, 50e-6, 100e-6, 250e-6, 500e-6, 750e-6, 1000e-6, or 1500e-6.
Returns
The output drive amperage of the digital-to-analog converter.
See Also
Get_RTD_Idac()

Here is the call graph for this function:

float PV_RTD_RS232_RS485::Set_RTD_PGA ( byte  wires,
byte  channel,
byte  new_gain_value 
)

Sets the gain for the programmable gain amplifier.

The multiplier to use when measuring the input voltage on the analog-to-digital converter's input terminals. If the value of new_gain_value is not one of the possible settings then the value will not be changed. For version 1 of the shield (shield's with a date stamp prior to "2-MAY-2014"), the factory reset value is 4 for three-wire RTDs and 2 for two-wire and four-wire RTDs. For version 2 of the shield (shield's with a date stamp of "2-MAY-2014" and after), the factory reset value is 1 for all wire types.

Version 1 - Shields with a date stamp before "2-MAY-2014"
2-Wire / 4-Wire 3-Wire
PGA Max R [ohms] Pt-100 Pt-1000 Max R [ohms] Pt-100 Pt-1000
Max [°C] Max [°F] Max [°C] Max [°F] Max [°C] Max [°F] Max [°C] Max [°F]
1 833.3 Full Range Full Range -42.4 -44.3 1666.7 Full Range Full Range 175.1 347.2
2 416.7 941.1 1726.0 -146.1 -231.0 833.3 Full Range Full Range -42.4 -44.3
4 208.3 289.6 553.3 -196.8 -322.3 416.7 941.1 1726.0 -146.1 -231.0
8 104.2 10.7 51.2 -221.9 -367.5 208.3 289.6 553.3 -196.8 -322.3
16 52.1 -120.5 -184.8 -234.4 -390.0 104.2 10.7 51.2 -221.9 -367.5
32 26.0 -184.2 -299.6 -240.6 -401.2 52.1 -120.5 -184.8 -234.4 -390.0
64 13.0 -215.7 -356.2 -243.8 -406.8 26.0 -184.2 -299.6 -240.6 -401.2
128 6.5 -231.3 -384.3 -245.3 -409.6 13.0 -215.7 -356.2 -243.8 -406.8


Version 2 - Shields with a date stamp of "2-MAY-2014" or later
2-Wire / 4-Wire 3-Wire
PGA Max R [ohms] Pt-100 Pt-1000 Max R [ohms] Pt-100 Pt-1000
Max [°C] Max [°F] Max [°C] Max [°F] Max [°C] Max [°F] Max [°C] Max [°F]
1 4300.0 Full Range Full Range 988.8 1811.9 8600.0 Full Range Full Range Full Range Full Range
2 2150.0 Full Range Full Range 308.3 586.9 4300.0 Full Range Full Range 988.8 1811.9
4 1075.0 Full Range Full Range 19.2 66.6 2150.0 Full Range Full Range 308.3 586.9
8 537.5 1415.5 2579.8 -116.3 -177.4 1075.0 Full Range Full Range 19.2 66.6
16 268.8 463.5 866.3 -182.2 -296.0 537.5 1415.5 2579.8 -116.3 -177.4
32 134.4 89.1 192.4 -214.7 -354.4 268.8 463.5 866.3 -182.2 -296.0
64 67.2 -82.9 -117.3 -230.8 -383.4 134.4 89.1 192.4 -214.7 -354.4
128 33.6 -165.8 -226.5 -238.8 -397.9 67.2 -82.9 -117.3 -230.8 -383.4
Parameters
wires2 for a two-wire RTD, 3 for a three-wire RTD, 4 for a four-wire RTD.
channelThe RTD channel. This can be 1 through 7 for two-wire RTDs, 1 through 4 for three-wire RTDs, or 1 through 3 for four-wire RTDs.
new_gain_valueThe desired multiplier for the ADC measurements.
Returns
The gain setting of the programmable gain amplifier: either 1, 2, 4, 8, 16, 32, 64, or 128.
See Also
Get_RTD_PGA()

Here is the call graph for this function:

unsigned int PV_RTD_RS232_RS485::Set_RTD_SPS ( unsigned int  new_sps_value)

Sets the speed setting of the temperature measurements in samples-per-second.

This is the number of temperature readings that the shield takes per second. Larger values give you an updated measurement more frequently. Lower values give you measurements with more "effective number of bits" in the reading and less noise, which should give you more stable readings.

Parameters
new_sps_valueThe number of samples to take each second, which should be one of the following values: 5, 10, 20, 40, 80, 160, 320, 640, 1000, or 2000.
Returns
The temperature measurement speed in samples-per-second.

Here is the call graph for this function:

size_t PV_RTD_RS232_RS485::write ( uint8_t  data)

The base function that supports the print and println functions.

This is the method that enables the print and println functions. It writes one character to the connected ports.

Parameters
dataThe character to write.
Returns
The number of characters written.
See Also
Connect_Print_To()

Here is the call graph for this function:

int PV_RTD_RS232_RS485::Write_Register ( int  register_address,
byte  data 
)

Write a register to the shield.

Sets the value at the given register_address on the shield. The register addressses are defined in the PV_RTD_Memory_Map.h file.

Parameters
register_addressThe register to write: see PV_RTD_Memory_Map.h for a description of the register contents.
dataThe value to be written.
Returns
The return value from the I2C transmission.

Here is the caller graph for this function:

int PV_RTD_RS232_RS485::Write_RS232 ( byte  data)

Write a byte to the RS232 port.

Writes a byte to the shield's RS232 port.

Parameters
dataThe value to write to the RS232 port.
Returns
The return value from the I2C transmission.

Here is the call graph for this function:

Here is the caller graph for this function:

int PV_RTD_RS232_RS485::Write_RS485 ( byte  data)

Write a byte to the RS485 port.

Writes a byte to the shield's RS485 port.

Parameters
dataThe value to write to the RS485 port.
Returns
The return value from the I2C transmission.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: