Opto MMP Toolkit
 All Classes Functions Variables
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
O22SnapIoMemMap Class Reference

#include <O22SIOMM.h>

Public Member Functions

int OpenEnet (char *pchIpAddressArg, int nPort, int nOpenTimeOutMS, int nAutoPUC)
 
int OpenEnet2 (char *pchIpAddressArg, int nPort, int nOpenTimeOutMS, int nAutoPUC, int nConnectionType)
 
int OpenSerial (int nPort, uint8_t nAddress, int nBaudRate, int nOpenTimeOutMS, int nAutoPUC)
 
int OpenSerialPassThru (char *pchIpAddressArg, int nPort, int nSerialPort, uint8_t nSerialAddress, int nSerialBaudRate, bool bTwoWire, int nOpenTimeOutMS, int nAutoPUC, int nConnectionType=SIOMM_TCP)
 
int IsOpenDone ()
 
int Close ()
 
int SetCommOptions (int nTimeOutMS, int nReserved)
 
int GetCommTimeout ()
 
int BuildWriteBlockRequest (uint8_t *pbyWriteBlockRequest, uint8_t byTransactionLabel, uint32_t dwDestinationOffset, uint16_t wDataLength, uint8_t *pbyBlockData)
 
int UnpackWriteResponse (uint8_t *pbyWriteQuadletResponse, uint8_t *pbyTransactionLabel, uint8_t *pbyResponseCode)
 
int BuildReadBlockRequest (uint8_t *pbyReadBlockRequest, uint8_t byTransactionLabel, uint32_t dwDestinationOffset, uint16_t wDataLength)
 
int UnpackReadBlockResponse (uint8_t *pbyReadBlockResponse, uint8_t *pbyTransactionLabel, uint8_t *pbyResponseCode, uint16_t *pwDataLength, uint8_t *pbyBlockData)
 
int ReadQuad (uint32_t dwDestOffset, uint32_t *pdwQuadlet)
 
int WriteQuad (uint32_t dwDestOffset, uint32_t dwQuadlet)
 
int ReadFloat (uint32_t dwDestOffset, float *pfValue)
 
int WriteFloat (uint32_t dwDestOffset, float fValue)
 
int ReadBlock (const uint32_t dwDestOffset, const uint16_t wDataLength, uint8_t *pbyData)
 
int WriteBlock (const uint32_t dwDestOffset, const uint16_t wDataLength, uint8_t *pbyData)
 
int ReadBlockAsIntegers (uint32_t dwDestOffset, uint16_t wDataLength, int *pnData)
 
int WriteBlockAsIntegers (uint32_t dwDestOffset, uint16_t wDataLength, int *pnData)
 
int ReadBlockAsFloats (uint32_t dwDestOffset, uint16_t wDataLength, float *pfData)
 
int WriteBlockAsFloats (uint32_t dwDestOffset, uint16_t wDataLength, float *pfData)
 
int GetStatusPUC (int *pnPUCFlag)
 
int GetStatusLastError (int *pnErrorCode)
 
int GetStatusBootpAlways (int *pnBootpAlways)
 
int GetStatusDegrees (int *pnDegrees)
 
int GetStatusWatchdogTime (int *pnTimeMS)
 
int GetStatusVersionEx (SIOMM_StatusVersion *pVersionData)
 
int GetStatusHardwareEx (SIOMM_StatusHardware *pHardwareData)
 
int GetStatusHardwareEx2 (SIOMM_StatusHardware2 *pHardwareData)
 
int GetStatusNetworkEx (SIOMM_StatusNetwork *pNetworkData)
 
int GetStatusNetworkEx2 (SIOMM_StatusNetwork2 *pNetworkData)
 
int GetStatusWriteEx (SIOMM_StatusWrite *pStatusWriteData)
 
int SetStatusWriteEx (SIOMM_StatusWrite StatusWriteData)
 
int SetStatusOperation (int nOpCode)
 
int SetStatusBootpRequest (int nFlag)
 
int SetStatusDegrees (int nDegFlag)
 
int SetStatusWatchdogTime (int nTimeMS)
 
int GetDateTime (char *pchDateTime)
 
int SetDateTime (char *pchDateTime)
 
int GetSerialModuleConfigurationEx (int nSerialPort, SIOMM_SerialModuleConfigArea *pConfigData)
 
int SetSerialModuleConfigurationEx (int nSerialPort, SIOMM_SerialModuleConfigArea ConfigData)
 
int ConfigurePoint (int nPoint, int nPointType)
 
int GetModuleType (int nPoint, int *pnModuleType)
 
int GetPtConfigurationEx3 (int nPoint, SIOMM_PointConfigArea3 *pData)
 
int GetPtConfigurationEx2 (int nPoint, SIOMM_PointConfigArea2 *pData)
 
int GetPtConfigurationEx (int nPoint, SIOMM_PointConfigArea *pData)
 
int SetPtConfigurationEx3 (int nPoint, SIOMM_PointConfigArea3 Data)
 
int SetPtConfigurationEx2 (int nPoint, SIOMM_PointConfigArea2 Data)
 
int SetPtConfigurationEx (int nPoint, SIOMM_PointConfigArea Data)
 
int SetDigPtConfiguration (int nPoint, int nPointType, int nFeature)
 
int SetAnaPtConfiguration (int nPoint, int nPointType, float fOffset, float fGain, float fHiScale, float fLoScale)
 
int SetPtWatchdog (int nPoint, float fValue, int nEnabled)
 
int GetDigPtState (int nPoint, int *pnState)
 
int GetDigPtOnLatch (int nPoint, int *pnState)
 
int GetDigPtOffLatch (int nPoint, int *pnState)
 
int GetDigPtCounterState (int nPoint, int *pnState)
 
int GetDigPtCounts (int nPoint, int *pnValue)
 
int GetDigPtReadAreaEx (int nPoint, SIOMM_DigPointReadArea *pData)
 
int SetDigPtState (int nPoint, int nState)
 
int SetDigPtCounterState (int nPoint, int nState)
 
int ReadClearDigPtCounts (int nPoint, int *pnState)
 
int ReadClearDigPtOnLatch (int nPoint, int *pnState)
 
int ReadClearDigPtOffLatch (int nPoint, int *pnState)
 
int GetDigBankPointStates (int *pnPts63to32, int *pnPts31to0)
 
int GetDigBankOnLatchStates (int *pnPts63to32, int *pnPts31to0)
 
int GetDigBankOffLatchStates (int *pnPts63to32, int *pnPts31to0)
 
int GetDigBankActCounterStates (int *pnPts63to32, int *pnPts31to0)
 
int GetDigBankReadAreaEx (SIOMM_DigBankReadArea *pData)
 
int SetDigBankPointStates (int nPts63to32, int nPts31to0, int nMask63to32, int nMask31to0)
 
int SetDigBankOnMask (int nPts63to32, int nPts31to0)
 
int SetDigBankOffMask (int nPts63to32, int nPts31to0)
 
int SetDigBankActCounterMask (int nPts63to32, int nPts31to0)
 
int SetDigBankDeactCounterMask (int nPts63to32, int nPts31to0)
 
int GetHDDigitalPointState (int nModule, int nPoint, int *pnState)
 
int GetHDDigitalPointOnLatch (int nModule, int nPoint, int *pnState)
 
int GetHDDigitalPointOffLatch (int nModule, int nPoint, int *pnState)
 
int GetHDDigitalPointCounts (int nModule, int nPoint, int *pnCounts)
 
int SetHDDigitalPointState (int nModule, int nPoint, int nState)
 
int ReadClearHDDigitalPointCounts (int nModule, int nPoint, int *pnCounts)
 
int ReadClearHDDigitalPointOnLatch (int nModule, int nPoint, int *pnState)
 
int ReadClearHDDigitalPointOffLatch (int nModule, int nPoint, int *pnState)
 
int GetAnalogPointValueEx (int nModule, int nPoint, float *pfValue)
 
int GetAnalogPointCountsEx (int nModule, int nPoint, float *pfValue)
 
int GetAnalogPointMinValueEx (int nModule, int nPoint, float *pfValue)
 
int GetAnalogPointMaxValueEx (int nModule, int nPoint, float *pfValue)
 
int GetAnalogPointTpoPeriodEx (int nModule, int nPoint, float *pfValue)
 
int GetAnalogPointReadAreaEx (int nModule, int nPoint, SIOMM_AnaPointReadArea *pData)
 
int SetAnalogPointValueEx (int nModule, int nPoint, float fValue)
 
int SetAnalogPointCountsEx (int nModule, int nPoint, float fValue)
 
int SetAnalogPointTpoPeriodEx (int nModule, int nPoint, float fValue)
 
int ReadClearAnalogPointMinValueEx (int nModule, int nPoint, float *pfValue)
 
int ReadClearAnalogPointMaxValueEx (int nModule, int nPoint, float *pfValue)
 
int GetAnaPtValue (int nPoint, float *pfValue)
 
int GetAnaPtCounts (int nPoint, float *pfValue)
 
int GetAnaPtMinValue (int nPoint, float *pfValue)
 
int GetAnaPtMaxValue (int nPoint, float *pfValue)
 
int GetAnaPtTpoPeriod (int nPoint, float *pfValue)
 
int GetAnaPtReadAreaEx (int nPoint, SIOMM_AnaPointReadArea *pData)
 
int SetAnaPtValue (int nPoint, float fValue)
 
int SetAnaPtCounts (int nPoint, float fValue)
 
int SetAnaPtTpoPeriod (int nPoint, float fValue)
 
int ReadClearAnaPtMinValue (int nPoint, float *pfValue)
 
int ReadClearAnaPtMaxValue (int nPoint, float *pfValue)
 
int GetAnaBankValuesEx (SIOMM_AnaBank *pBankData)
 
int GetAnaBankCountsEx (SIOMM_AnaBank *pBankData)
 
int GetAnaBankMinValuesEx (SIOMM_AnaBank *pBankData)
 
int GetAnaBankMaxValuesEx (SIOMM_AnaBank *pBankData)
 
int GetAnaBanksEx (SIOMM_AnaBanks *pBankData)
 
int SetAnaBankValuesEx (SIOMM_AnaBank BankData)
 
int SetAnaBankCountsEx (SIOMM_AnaBank BankData)
 
int CalcSetAnaPtOffset (int nPoint, float *pfValue)
 
int CalcSetAnaPtGain (int nPoint, float *pfValue)
 
int SetPidLoopConfigurationEx (int nPid, SIOMM_PidLoopConfigArea Data)
 
int SetTpoConfigurationEx (int nTpo, SIOMM_TpoConfigArea Data)
 
int GetTpoConfigurationEx (int nTpo, SIOMM_TpoConfigArea *pTpoData)
 
int SetEventMsgConfigurationEx (int nMsg, SIOMM_EventMsgConfigArea Data)
 
int SetDigitalEventConfigurationEx (int nEvent, SIOMM_DigitalEventConfigArea Data)
 
int SetAlarmEventConfigurationEx (int nEvent, SIOMM_AlarmEventConfigArea Data)
 
int SetSerialEventConfigurationEx (int nEvent, SIOMM_SerialEventConfigArea Data)
 
int SetTimerEventConfigurationEx (int nEvent, SIOMM_TimerEventConfigArea Data)
 
int GetStreamConfiguration (int *pnOnFlag, int *pnIntervalMS, int *pnPort, int *pnIoMirroringEnabled, int *pnStartAddress, int *pnDataSize)
 
int SetStreamConfiguration (int nOnFlag, int nIntervalMS, int nPort, int nIoMirroringEnabled, int nStartAddress, int nDataSize)
 
int GetStreamTarget (int nTarget, int *pnIpAddressArg)
 
int SetStreamTarget (int nTarget, char *pchIpAddressArg)
 
int GetStreamReadAreaEx (SIOMM_StreamStandardBlock *pStreamData)
 
int GetScratchPadBitArea (int *pnBits63to32, int *pnBits31to0)
 
int SetScratchPadBitArea (int nBits63to32, int nBits31to0)
 
int SetScratchPadBitAreaMask (int nOnMask63to32, int nOnMask31to0, int nOffMask63to32, int nOffMask31to0)
 
int GetScratchPadIntegerArea (int nStartIndex, int nLength, int *pnData)
 
int SetScratchPadIntegerArea (int nStartIndex, int nLength, int *pnData)
 
int GetScratchPadFloatArea (int nStartIndex, int nLength, float *pfData)
 
int SetScratchPadFloatArea (int nStartIndex, int nLength, float *pfData)
 
int GetScratchPadStringArea (int nStartIndex, int nLength, SIOMM_ScratchPadString *pStringData)
 
int SetScratchPadStringArea (int nStartIndex, int nLength, SIOMM_ScratchPadString *pStringData)
 
int GetScratchPadInteger64Area (int nStartIndex, int nLength, int *pnData)
 
int SetScratchPadInteger64Area (int nStartIndex, int nLength, int *pnData)
 
int GetDataLoggingSamplesEx (int nStartIndex, int nLength, SIOMM_DataLogSample *pDataSamples)
 
int ConfigurePoint (int nModule, int nPoint, int nPointType)
 
int GetModuleType (int nModule, int nPoint, int *pnModuleType)
 
int GetPointConfigurationEx4 (int nModule, int nPoint, SIOMM_PointConfigArea4 *pData)
 
int GetPointGain (int nModule, int nPoint, float *pfGain)
 
int GetPointOffset (int nModule, int nPoint, float *pfOffset)
 
int SetPointConfigurationEx4 (int nModule, int nPoint, SIOMM_PointConfigArea4 PtConfigData)
 
int SetPointFilterWeight (int nModule, int nPoint, float fFilterWeight)
 
int SetPointGain (int nModule, int nPoint, float fGain)
 
int SetPointOffset (int nModule, int nPoint, float fOffset)
 
int SetPointScale (int nModule, int nPoint, float fHiScale, float fLoScale)
 
int SetPointWatchdog (int nModule, int nPoint, float fValue, int nEnabled)
 
int SetPointName (int nModule, int nPoint, char *pchPointName)
 
int GetDigitalPointReadAreaEx (int nModule, int nPoint, SIOMM_DigPointReadArea *pData)
 
int CalcSetAnalogPointOffsetEx (int nModule, int nPoint, float *pfValue)
 
int CalcSetAnalogPointGainEx (int nModule, int nPoint, float *pfValue)
 
int SetAnalogOutputClamp (int nModule, int nPoint, float fLowClamp, float fHighClamp)
 
int GetAnalogOutputClamp (int nModule, int nPoint, float *pfLowClamp, float *pfHighClamp)
 
int SetAnalogOutputClamp (int nPoint, float fLowClamp, float fHighClamp)
 
int GetAnalogOutputClamp (int nPoint, float *pfLowClamp, float *pfHighClamp)
 

Protected Member Functions

int OpenSockets (char *pchIpAddressArg, int nPort, int nOpenTimeOutMS)
 
int CloseSockets ()
 
int GetBitmask64 (uint32_t dwDestOffset, int *pnPts63to32, int *pnPts31to0)
 
int SetBitmask64 (uint32_t dwDestOffset, int nPts63to32, int nPts31to0)
 
int GetAnaBank (uint32_t dwDestOffset, SIOMM_AnaBank *pBankData)
 
int SetAnaBank (uint32_t dwDestOffset, SIOMM_AnaBank BankData)
 
void UpdateTransactionLabel ()
 
uint32_t GetTickCount ()
 

Protected Attributes

SOCKET m_Socket
 
sockaddr_in m_SocketAddress
 
int m_nConnectionType
 
int m_serialHandle
 
uint8_t m_serialAddress
 
int m_serialBaudRate
 
int m_serialPort
 
bool m_serialTwoWire
 
ConnectionMethod m_method
 
timeval m_tvTimeOut
 
uint32_t m_nTimeOutMS
 
uint32_t m_nOpenTimeOutMS
 
uint32_t m_nOpenTime
 
int m_nRetries
 
int m_nAutoPUCFlag
 
uint8_t m_byTransactionLabel
 

Detailed Description

The O22SnapIoMemMap C++ class is used to communicate from a computer to an Opto 22 SNAP Ethernet I/O unit.

The basic procedure for using this class is:

  1. Create an instance of the O22SnapIoMemMap class
  2. Call OpenEnet() or OpenEnet2() to start connecting to an I/O unit
  3. Call IsOpenDone() to complete the connection process
  4. Call SetCommOptions() to set the desired timeout value
  5. Call any of the memory map functions, such as ConfigurePt(), GetAnaPtValue(), SetDigBankPointStates(), and ReadBlock(), to communicate with the I/O unit. Repeat as neccessary.
  6. Call Close() when done.

Member Function Documentation

int O22SnapIoMemMap::BuildReadBlockRequest ( uint8_t *  pbyReadBlockRequest,
uint8_t  byTransactionLabel,
uint32_t  dwDestinationOffset,
uint16_t  wDataLength 
)

Builds a read block request packet.

This is an internally used utility method to build a read request. Client code isn't likely to need it.

Parameters
pbyReadBlockRequestUser supplied pointer to a block of memory to hold the read request. Must not be NULL, must be at least 16 bytes in size.
byTransactionLabelTransaction label to embed in the read request. Lets the caller identify response packets.
dwDestinationOffsetThe target offset to read from
wDataLengthThe amount of data to read, in bytes.
Returns
SIOMM_ERROR if pbyReadBlockRequest is NULL, SIOMM_OK otherwise.
int O22SnapIoMemMap::BuildWriteBlockRequest ( uint8_t *  pbyWriteBlockRequest,
uint8_t  byTransactionLabel,
uint32_t  dwDestinationOffset,
uint16_t  wDataLength,
uint8_t *  pbyBlockData 
)

Builds a write block request packet.

This is an internally used utility method to build a write request. Client code isn't likely to need it.

Parameters
pbyWriteBlockRequestUser supplied pointer to a block of memory to hold the write request. Must not be NULL, must be at least 16 bytes + wDataLength in size.
byTransactionLabelTransaction label to embed in the write request. Lets the caller identify response packets.
dwDestinationOffsetTarget offset to write data to
wDataLengthLength of the data in pbyBlockData
pbyBlockDataData to be written, this is appended to the end of the request.
Returns
SIOMM_ERROR if pbyWriteBlockRequest or pbyBlockData are NULL, SIOMM_OK otherwise.
int O22SnapIoMemMap::CalcSetAnalogPointGainEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Calculate and set an analog point's gain.

Memory-mapped I/O units with analog capability can calculate offset and gain for analog input points. Calculate offset first, and then calculate gain. See the PAC Manager User's Guide for instructions.

Use this method for I/O units with firmware versions 8.0 or newer. For units with firmware version 7.1 or older, use CalcSetAnaPtGain.

See Also
CalcSetAnaPtGain
Parameters
nModuleInteger between 0 and 63 (inclusive) indicating which module the target point is on.
nPointInteger between 0 and 63 (inclusive) indicating which point on the target module to target
pfValuePointer to a float holding the result from the read operation.
Returns
SIOMM_OK if everything worked correctly.
SIOMM_ERROR if pfValue is NULL, or if either nModule or nPoint are out of range.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::CalcSetAnalogPointOffsetEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Calculate and set an analog point's offset.

Memory-mapped I/O units with analog capability can calculate offset and gain for analog input points. Calculate offset first, and then calculate gain. See the PAC Manager User's Guide for instructions.

Use this method for I/O units with firmware versions 8.0 or newer. For units with firmware version 7.1 or older, use CalcSetAnaPtOffset.

See Also
CalcSetAnaPtOffset
Parameters
nModuleInteger between 0 and 63 (inclusive) indicating which module the target point is on.
nPointInteger between 0 and 63 (inclusive) indicating which point on the target module to target
pfValuePointer to a float holding the result from the read operation.
Returns
SIOMM_OK if everything worked correctly.
SIOMM_ERROR if pfValue is NULL, or if either nModule or nPoint are out of range.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::CalcSetAnaPtGain ( int  nPoint,
float *  pfValue 
)

Calculate and set an analog point's gain.

Memory-mapped I/O units with analog capability can calculate offset and gain for analog input points. Calculate offset first, and then calculate gain. See the PAC Manager User’s Guide for instructions.

Use this method for I/O units with firmware versions 7.1 or lower. For units with firmware version 8.0 or newer, use CalcSetAnalogPointGainEx.

See Also
CalcSetAnalogPointGainEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read operation.
Returns
SIOMM_OK if everything worked correctly.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock
int O22SnapIoMemMap::CalcSetAnaPtOffset ( int  nPoint,
float *  pfValue 
)

Calculate and set an analog point's offset.

Memory-mapped I/O units with analog capability can calculate offset and gain for analog input points. Calculate offset first, and then calculate gain. See the PAC Manager User’s Guide for instructions.

Use this method for I/O units with firmware versions 7.1 or lower. For units with firmware version 8.0 or newer, use CalcSetAnalogPointOffsetEx.

See Also
CalcSetAnalogPointOffsetEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read operation.
Returns
SIOMM_OK if everything worked correctly.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock
int O22SnapIoMemMap::Close ( )

Close the connection to the I/O unit.

Returns
SIOMM_OK if everything is OK, an error otherwise.
int O22SnapIoMemMap::ConfigurePoint ( int  nPoint,
int  nPointType 
)

Tell the I/O unit what kind of point is at a given location.

Digital inputs, high density digital modules, and analog modules are all recognized automatically by the I/O unit when it boots up. Digital outputs are not, and so need to be configured before use.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
nPointTypePoint type value. A digital output is type 0x180, an input is 0x100.
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::ConfigurePoint ( int  nModule,
int  nPoint,
int  nPointType 
)

Tell the I/O unit what kind of point is at a given location.

Digital inputs, high density digital modules, and analog modules are all recognized automatically by the I/O unit when it boots up. Digital outputs are not, and so need to be configured before use.

NOTE: This method only works with I/O units running firmware 8.0 or newer. For I/O units running older firmware, use ConfigurePoint(nPoint, nPointType)

See Appendix A - (Expanded) Analog & Digital Point Configuration - Read/Write of the OptoMMP Protocol Guide for details.

Parameters
nModuleWhich module the point to be configured resides on
nPointPoint number on the module to configure.
nPointTypePoint type value. A digital output is type 0x180, an input is 0x100.
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::GetAnaBankCountsEx ( SIOMM_AnaBank pBankData)

Read the counts value of all 64 possible analog points at once.

Parameters
pBankDataPointer to a SIOMM_AnaBank instance to hold the results of the call.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pBankData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaBankMaxValuesEx ( SIOMM_AnaBank pBankData)

Read the maximum recorded value of all 64 possible analog points at once.

Parameters
pBankDataPointer to a SIOMM_AnaBank instance to hold the results of the call.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pBankData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaBankMinValuesEx ( SIOMM_AnaBank pBankData)

Read the minimum recorded value of all 64 possible analog points at once.

Parameters
pBankDataPointer to a SIOMM_AnaBank instance to hold the results of the call.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pBankData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaBanksEx ( SIOMM_AnaBanks pBankData)

Read the entire analog bank at once.

Parameters
pBankDataPointer to a SIOMM_AnaBanks instance to hold the results of the call.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pBankData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaBankValuesEx ( SIOMM_AnaBank pBankData)

Read the value of all 64 possible analog points at once.

Parameters
pBankDataPointer to a SIOMM_AnaBank instance to hold the results of the call.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pBankData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnalogOutputClamp ( int  nModule,
int  nPoint,
float *  pfLowClamp,
float *  pfHighClamp 
)

Retrieve clamping values for an analog point.

NOTE: This method works with I/O units running firmware versions 8.0 or newer. For units with older firmware versions, use the version of GetAnalogOutputClamp without the nModule parameter.

Parameters
nModuleWhich module the point to be configured resides on
nPointPoint number on the module to configure
pfLowClampPointer to a float to hold the lower bound clamping value
pfHighClampPointer to a float to hold the upper bound clamping value
Returns
SIOMM_OK if the point configuration was read successfully
SIOMM_ERROR if either pfLowClamp or pfHighClamp are NULL
Errors possibly resulting from ReadBlock
int O22SnapIoMemMap::GetAnalogOutputClamp ( int  nPoint,
float *  pfLowClamp,
float *  pfHighClamp 
)

Retrieve clamping values for an analog point.

NOTE: This method works with I/O units running firmware versions older than 8.0. For units with newer firmware versions, use the version of SetAnalogOutputClamp with the nModule parameter.

Parameters
nPointPoint number on the I/O unit to configure
pfLowClampPointer to a float to hold the lower bound clamping value
pfHighClampPointer to a float to hold the upper bound clamping value
Returns
SIOMM_OK if the point configuration was read successfully
SIOMM_ERROR if either pfLowClamp or pfHighClamp are NULL
Errors possibly resulting from ReadBlock
int O22SnapIoMemMap::GetAnalogPointCountsEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Read the current counts of an analog point.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnalogPointMaxValueEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Read the highest recorded value of an analog point.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnalogPointMinValueEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Read the lowest recorded value of an analog point.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnalogPointReadAreaEx ( int  nModule,
int  nPoint,
SIOMM_AnaPointReadArea pData 
)

Read the entirety of an analog point's read area in one shot.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pDataPointer to an instance of a SIOMM_AnaPointReadArea structure to hold the results from the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnalogPointTpoPeriodEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Read an analog point's TPO period.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnalogPointValueEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Read the current value of an analog point.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaPtCounts ( int  nPoint,
float *  pfValue 
)

Read the current counts value of an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use GetAnalogPointCountsEx instead.

See Also
GetAnalogPointCountsEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaPtMaxValue ( int  nPoint,
float *  pfValue 
)

Read the highest recorded value of an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use GetAnalogPointMaxValueEx instead.

See Also
GetAnalogPointMaxValueEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaPtMinValue ( int  nPoint,
float *  pfValue 
)

Read the lowest recorded value of an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use GetAnalogPointMinValueEx instead.

See Also
GetAnalogPointMinValueEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaPtReadAreaEx ( int  nPoint,
SIOMM_AnaPointReadArea pData 
)

Read the entirety of an analog point's read area in one shot.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use GetAnalogPointReadAreaEx instead.

See Also
GetAnalogPointReadAreaEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pDataPointer to a SIOMM_AnaPointReadArea instance to hold the results of the read operation.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaPtTpoPeriod ( int  nPoint,
float *  pfValue 
)

Read an analog point's TPO period.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use GetAnalogPointTpoPeriodEx instead.

See Also
GetAnalogPointTpoPeriodEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetAnaPtValue ( int  nPoint,
float *  pfValue 
)

Read the current value of an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use GetAnalogPointValueEx instead.

See Also
GetAnalogPointValueEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetCommTimeout ( )
inline

Returns the current timeout period as set by SetCommOptions()

Returns
The current timeout period in milliseconds.
int O22SnapIoMemMap::GetDataLoggingSamplesEx ( int  nStartIndex,
int  nLength,
SIOMM_DataLogSample pDataSamples 
)

Read from the I/O Unit's data log.

The SNAP PAC R-Series, SNAP PAC EB or SB, SNAP Ultimate, or SNAP Ethernet I/O unit includes a feature that allows data from memory map addresses to be recorded in a log file. The data from up to 64 memory map addresses can be logged, and all logged data is recorded in one file. The log file holds up to 300 lines of data; when it is filled, new entries replace the oldest ones.

See Chapter 2 - Logging Data in the OptoMMP Protocol Guide for more details.

Parameters
nStartIndexSample location to start reading from
nLengthNumber of samples to read.
pDataSamplesArray of SIOMM_DataLogSample instances to hold the read data. Must be sizeof(SIOMM_DataLogSample) * nLength bytes in length.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pDataSamples is NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::GetDateTime ( char *  pchDateTime)

Read the current date and time time from the I/O unit.

Times are returned in a string in the format YYYY-MM-DD HH:MM:SS:00.

Parameters
pchDateTimeUser supplied pointer to a string. Must not be NULL, must be at least 23 characters in length (with null byte).
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pchDateTime is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigBankActCounterStates ( int *  pnPts63to32,
int *  pnPts31to0 
)

Read the active counter states of tge entire bank of standard density digital points.

Point active counter states are returned as a pair of 32-bit bitmask values: one bit for each of the 64 possible standard density digital points on an I/O unit.

Parameters
pnPts63to32Pointer to an integer to return a bitmask representing points 32 through 63
pnPts31to0Pointer to an integer to return a bitmask representing points 0 through 31
Returns
SIOMM_OK if the bank was read successfully.
SIOMM_ERROR if either parameter was NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigBankOffLatchStates ( int *  pnPts63to32,
int *  pnPts31to0 
)

Read the off-latch states of tge entire bank of standard density digital points.

Point off-latch states are returned as a pair of 32-bit bitmask values: one bit for each of the 64 possible standard density digital points on an I/O unit.

Parameters
pnPts63to32Pointer to an integer to return a bitmask representing points 32 through 63
pnPts31to0Pointer to an integer to return a bitmask representing points 0 through 31
Returns
SIOMM_OK if the bank was read successfully.
SIOMM_ERROR if either parameter was NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigBankOnLatchStates ( int *  pnPts63to32,
int *  pnPts31to0 
)

Read the on-latch states of tge entire bank of standard density digital points.

Point on-latch states are returned as a pair of 32-bit bitmask values: one bit for each of the 64 possible standard density digital points on an I/O unit.

Parameters
pnPts63to32Pointer to an integer to return a bitmask representing points 32 through 63
pnPts31to0Pointer to an integer to return a bitmask representing points 0 through 31
Returns
SIOMM_OK if the bank was read successfully.
SIOMM_ERROR if either parameter was NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigBankPointStates ( int *  pnPts63to32,
int *  pnPts31to0 
)

Read the status of the entire bank of standard density digital points.

Point states are returned as a pair of 32-bit bitmask values: one bit for each of the 64 possible standard density digital points on an I/O unit.

Parameters
pnPts63to32Pointer to an integer to return a bitmask representing points 32 through 63
pnPts31to0Pointer to an integer to return a bitmask representing points 0 through 31
Returns
SIOMM_OK if the bank was read successfully.
SIOMM_ERROR if either parameter was NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigBankReadAreaEx ( SIOMM_DigBankReadArea pData)

Read the entire standard density digital point bank in one shot.

Parameters
pDataPointer to a SIOMM_DigBankReadArea instance to hold the results of the read.
Returns
SIOMM_OK if the bank was read successfully.
SIOMM_ERROR if pData is NULL
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigitalPointReadAreaEx ( int  nModule,
int  nPoint,
SIOMM_DigPointReadArea pData 
)

Get the read area for a high density digital point

Parameters
nModuleWhich module the point to be read resides on
nPointPoint number on the module to read
pDataPointer to a SIOMM_DigPointReadArea instance to hold the results of the read operation
Returns
SIOMM_OK if the point was read successfully
SIOMM_ERROR if pData is NULL
Other values possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigPtCounterState ( int  nPoint,
int *  pnState 
)

Get the active counter state of a digital point.

Note: This method works only for standard density digital points. High density digital points must use GetHDDigitalPointCounterState.

See Also
GetHDDigitalPointCounterState
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnStatePointer to an integer to hold the counter state (e.g. on/off) for the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigPtCounts ( int  nPoint,
int *  pnValue 
)

Get the counters of a digital point.

Note: This method works only for standard density digital points. High density digital points must use GetHDDigitalPointCounts.

See Also
GetHDDigitalPointCounters
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnValuePointer to an integer to hold the counter value for the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigPtOffLatch ( int  nPoint,
int *  pnState 
)

Get the off-latch state of a digital point.

Note: This method works only for standard density digital points. High density digital points must use GetHDDigitalPointOffLatch.

See Also
GetHDDigitalPointOffLatch
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnStatePointer to an integer to hold the current off-latch state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigPtOnLatch ( int  nPoint,
int *  pnState 
)

Get the on-latch state of a digital point.

Note: This method works only for standard density digital points. High density digital points must use GetHDDigitalPointOnLatch.

See Also
GetHDDigitalPointOnLatch
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnStatePointer to an integer to hold the current on-latch state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigPtReadAreaEx ( int  nPoint,
SIOMM_DigPointReadArea pData 
)

Get the full state of a digital point.

Note: This method works only for standard density digital points.

Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pDataPointer to a SIOMM_DigPointReadArea instance to hold the state of the digital point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetDigPtState ( int  nPoint,
int *  pnState 
)

Get the current state of a digital point.

Note: This method works only for standard density digital points. High density digital points must use GetHDDigitalPointState.

See Also
GetHDDigitalPointState
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnStatePointer to an integer to hold the current state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetHDDigitalPointCounts ( int  nModule,
int  nPoint,
int *  pnCounts 
)

Get the current counter of a high-density digital point.

Note: This method works only for standard density digital points. High density digital points must use GetDigPtCounts.

See Also
GetDigPtCounts
Parameters
nModuleWhich module to read a point's state from.
nPointPoint number on the module to read.
pnCountsPointer to an integer to hold the counter value for the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetHDDigitalPointOffLatch ( int  nModule,
int  nPoint,
int *  pnState 
)

Get the off-latch state of a high-density digital point.

Note: This method works only for high density digital points. High density digital points must use GetDigPtOffLatch.

See Also
GetDigPtOffLatch
Parameters
nModuleWhich module to read a point's state from.
nPointPoint number on the module to read.
pnStatePointer to an integer to hold the current off-latch state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetHDDigitalPointOnLatch ( int  nModule,
int  nPoint,
int *  pnState 
)

Get the on-latch state of a high-density digital point.

Note: This method works only for high density digital points. High density digital points must use GetDigPtOnLatch.

See Also
GetDigPtOnLatch
Parameters
nModuleWhich module to read a point's state from.
nPointPoint number on the module to read.
pnStatePointer to an integer to hold the current on-latch state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetHDDigitalPointState ( int  nModule,
int  nPoint,
int *  pnState 
)

Get the current state of a high-density digital point.

Note: This method works only for high density digital points. High density digital points must use GetDigPtState.

See Also
GetDigPtState
Parameters
nModuleWhich module to read a point's state from.
nPointPoint number on the module to read.
pnStatePointer to an integer to hold the current state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetModuleType ( int  nPoint,
int *  pnModuleType 
)

Read the point type of a given point back from the I/O unit.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnModuleTypePointer to an integer to return the point type for the point. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pnModuleType is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetModuleType ( int  nModule,
int  nPoint,
int *  pnModuleType 
)

Determine the type of a point on a given module.

NOTE: This method only works with I/O units running firmware 8.0 or newer. For I/O units running older firmware, use GetModuleType(nPoint, pnModuleType).

Parameters
nModuleWhich module the targetted point resides on
nPointWhich point to check the type for
pnModuleTypePointer to an integer to return the point type for the point. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pnModuleType is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetPointConfigurationEx4 ( int  nModule,
int  nPoint,
SIOMM_PointConfigArea4 pData 
)

Read the full configuration data for a given point.

See Appendix A - (Expanded) Analog & Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to read configuration for.
pDataPointer to a SIOMM_PointConfigArea4 instance. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetPointGain ( int  nModule,
int  nPoint,
float *  pfGain 
)

Read the current gain value of an analog point.

NOTE: This method only works with I/O units running firmware 8.0 or newer.

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to read the gain value for
pfGainPointer to a float value to return the point's gain value.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pfGain is NULL
Other errors possibly resulting from ReadBlock
int O22SnapIoMemMap::GetPointOffset ( int  nModule,
int  nPoint,
float *  pfOffset 
)

Read the current offset value of an analog point

NOTE: This method only works with I/O units running firmware 8.0 or newer

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to read the offset value for
pfOffsetPointer to a float value to return the point's offset value.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pfOffsetis NULL
Other errors possibly resulting from ReadBlock
int O22SnapIoMemMap::GetPtConfigurationEx ( int  nPoint,
SIOMM_PointConfigArea pData 
)

Read the full configuration data for a given point.

NOTE: This method is deprecated, use GetPtConfigurationEx3 instead.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

See Also
GetPtConfigurationEx3
Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pDataPointer to a SIOMM_PointConfigArea instance. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetPtConfigurationEx2 ( int  nPoint,
SIOMM_PointConfigArea2 pData 
)

Read the full configuration data for a given point.

NOTE: This method is deprecated, use GetPtConfigurationEx3 instead.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

See Also
GetPtConfigurationEx3
Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pDataPointer to a SIOMM_PointConfigArea2 instance. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetPtConfigurationEx3 ( int  nPoint,
SIOMM_PointConfigArea3 pData 
)

Read the full configuration data for a given point.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pDataPointer to a SIOMM_PointConfigArea3 instance. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetScratchPadBitArea ( int *  pnBits63to32,
int *  pnBits31to0 
)

Read the I/O unit's scratchpad bits area

Parameters
pnBits63to32Pointer to hold bits 32-63 of the scratchpad area
pnBits31to0Pointer to hold bits 0-31 of the scratchpad area
Returns
SIOMM_OK if the scratchpad area was read successfully.
SIOMM_ERROR if either argument is NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::GetScratchPadFloatArea ( int  nStartIndex,
int  nLength,
float *  pfData 
)

Read from the I/O unit's float scratch pad area

Parameters
nStartIndexIndex of the float scratchpad location to begin reading from
nLengthLength (in float locations) of the data to read
pfDataPointer to a user-supplied buffer to write the data read to. Must be nLength * 4 bytes in length.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pnData was NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::GetScratchPadInteger64Area ( int  nStartIndex,
int  nLength,
int *  pnData 
)

Read from the I/O unit's 64-bit integer scratch pad area

Parameters
nStartIndexIndex of the 64-bit integer scratchpad location to begin reading from
nLengthLength (in integer locations) of the data to read
pnDataPointer to a user-supplied buffer to write the data read to. Must be nLength * 8 bytes in length.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pnData was NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::GetScratchPadIntegerArea ( int  nStartIndex,
int  nLength,
int *  pnData 
)

Read from the I/O unit's integer scratch pad area

Parameters
nStartIndexIndex of the integer scratchpad location to begin reading from
nLengthLength (in integer locations) of the data to read
pnDataPointer to a user-supplied buffer to write the data read to. Must be nLength * 4 bytes in length.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pnData was NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::GetScratchPadStringArea ( int  nStartIndex,
int  nLength,
SIOMM_ScratchPadString pStringData 
)

Read from the I/O unit's string scratch pad area

Parameters
nStartIndexIndex of the string scratchpad location to begin reading from
nLengthLength (in string locations) of the data to read
pStringDataPointer to an array of SIOMM_ScratchPadString instances to hold the read string data. Must be sizeof(SIOMM_ScratchPadString) * nLength bytes in length.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pStringData was NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::GetSerialModuleConfigurationEx ( int  nSerialPort,
SIOMM_SerialModuleConfigArea pConfigData 
)

Read the configuration of the SNAP serial communication modules on the I/O unit.

See Appendix A - Serial Module Configuration - Read/Write of the Opto MMP Protocol Guide for details.

Parameters
nSerialPortWhich serial port to configure. See Appendix A - Serial Module Configuration - Read/Write for how port numbers are determined.
pConfigDataPointer to a SIOMM_SerialModuleConfigArea structure instance to hold the data read.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pConfigData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetStatusBootpAlways ( int *  pnBootpAlways)

Read the "BootP always" flag from the I/O units status area.

If the BootP always flag is 0, the I/O unit will send a BootP (UIO, EIO, SIO, LCE) or DHCP (E1, E2) request only when it is configured to use a static IP address of 0.0.0.0.

If the flag is 1, the I/O unit will send a BootP or DHCP request whenever it is turned on.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

Parameters
pnBootpAlwaysPointer to an integer to store the returned flag.
Returns
SIOMM_OK if the flag was read successfully.
SIOMM_ERROR if pnInteger is NULL.
Other errors possibly resulting from ReadQuad.
int O22SnapIoMemMap::GetStatusDegrees ( int *  pnDegrees)

Read the value of the Degrees flag in the I/O units status area.

A value of 0 means temperature values are returned in degrees Celsius, 1 in degrees Fahrenheit.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

Parameters
pnDegreesPointer to an integer to store the returned flag.
Returns
SIOMM_OK if the flag was read successfully.
SIOMM_ERROR if pnInteger is NULL.
Other errors possibly resulting from ReadQuad.
int O22SnapIoMemMap::GetStatusHardwareEx ( SIOMM_StatusHardware pHardwareData)

Read hardware details from the I/O units status area.

NOTE: This method has been superseded by GetStatusHardwareEx2. You should probably use that one instead.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

See Also
GetStatusHardwareEx2
Parameters
pHardwareDataPointer to a SIOMM_StatusHardware structure to hold the returned hardware details. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pHardwareData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetStatusHardwareEx2 ( SIOMM_StatusHardware2 pHardwareData)

Read hardware details from the I/O units status area.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

Parameters
pHardwareDataPointer to a SIOMM_StatusHardware2 structure to hold the returned hardware details. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pHardwareData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetStatusLastError ( int *  pnErrorCode)

Read the last error code from the I/O units status area.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

Parameters
pnErrorCodePointer to an integer to store the returned error code.
Returns
SIOMM_OK if the error code was read successfully.
SIOMM_ERROR if pnInteger is NULL.
Other errors possibly resulting from ReadQuad.
int O22SnapIoMemMap::GetStatusNetworkEx ( SIOMM_StatusNetwork pNetworkData)

Read current networking details from the I/O units status area.

NOTE: This method has been superseded by GetStatusNetworkEx2. You should probably use that one instead.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

See Also
GetStatusNetworkEx2
Parameters
pNetworkDataPointer to a SIOMM_StatusNetwork structure to hold the returned network details. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pNetworkData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetStatusNetworkEx2 ( SIOMM_StatusNetwork2 pNetworkData)

Read current networking details from the I/O units status area.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

Parameters
pNetworkDataPointer to a SIOMM_StatusNetwork2 structure to hold the returned network details. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pNetworkData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetStatusPUC ( int *  pnPUCFlag)

Read the Powerup Clear flag from the I/O units status area.

A Powerup Clear Flag set to 0 means everything is OK. Any other value means that a Powerup Clear is needed.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

TODO: A Powerup Clear is sent automatically if you enable that parameter in whichever Open* method you use. It can also be sent by calling WriteQuad(SIOMM_STATUS_WRITE_OPERATION, 1). There should probably be a utility method for that.

Parameters
pnPUCFlagPointer to an integer to store the returned powerup clear flag.
Returns
SIOMM_OK if the flag was read successfully.
SIOMM_ERROR if pnPUCFlag is NULL.
Other errors possibly resulting from ReadQuad.
int O22SnapIoMemMap::GetStatusVersionEx ( SIOMM_StatusVersion pVersionData)

Read version information from the I/O units status area.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

Parameters
pVersionDataPointer to a SIOMM_StatusVersion structure to hold the returned version information. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pVersionData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetStatusWatchdogTime ( int *  pnTimeMS)

Read the current watchdog time from the I/O units status area.

Returns the current watchdog time in milliseconds. A value of 0 means watchdog is disabled.

See Appendix A - Status Area Read in the OptoMMP Protocol Guide for additional details.

Parameters
pnTimeMSPointer to an integer to store the returned watchdog time.
Returns
SIOMM_OK if the flag was read successfully.
SIOMM_ERROR if pnInteger is NULL.
Other errors possibly resulting from ReadQuad.
int O22SnapIoMemMap::GetStatusWriteEx ( SIOMM_StatusWrite pStatusWriteData)

Read the current contents of the Status Read/Write area of the I/O unit.

See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.

Parameters
pStatusWriteDataPointer to a SIOMM_StatusWrite structure to hold the returned network details. Must not be NULL.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pStatusWriteData is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::GetStreamConfiguration ( int *  pnOnFlag,
int *  pnIntervalMS,
int *  pnPort,
int *  pnIoMirroringEnabled,
int *  pnStartAddress,
int *  pnDataSize 
)

Read the I/O units current streaming configuration.

Streaming allows your application to get continuous information from a SNAP Ethernet-based I/O unit without the need to continually poll it.

See Chapter 2 - Streaming Data in the OptoMMP Protocol Guide for details.

Parameters
pnOnFlagWhether or not streaming is enabled. 0 is off, non-zero is on.
pnIntervalMSStreaming interval, in milliseconds
pnPortIP port number to stream to
pnIoMirroringEnabledWhether I/O mirroring is enabled. 0 is off, non-zero is on.
pnStartAddressBeginning address of the data being streamed
pnDataSizeSize of data being streamed. Maximum size is 1480 bytes.
Returns
SIOMM_OK if the streaming configuration was read successfully.
Errors possibly resulting from a call to ReadBlock.
int O22SnapIoMemMap::GetStreamReadAreaEx ( SIOMM_StreamStandardBlock pStreamData)

Read the streaming data area of the I/O units memory map.

Returns the current state of the I/O unit's streaming area.

Parameters
pStreamDataPointer to an SIOMM_StreamStandardBlock instance to hold the results of the read.
Returns
SIOMM_OK if the streaming data area was read successfully.
SIOMM_ERROR if pStreamData is NULL
Other errors possibly resulting from ReadBlock
int O22SnapIoMemMap::GetStreamTarget ( int  nTarget,
int *  pnIpAddressArg 
)

Retrieve the IP address of a streaming target

Returns the IP address of the target as a single 4-byte integer.

Parameters
nTargetIndex of the streaming target to retrieve the IP address for. (1-8)
pnIpAddressArgPointer to an integer to hold the returned address. Must not be NULL.
Returns
SIOMM_OK if the IP address was read successfully
SIOMM_ERROR if pnIpAddressArg is NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::IsOpenDone ( )

Called after OpenEnet() or OpenEnet2() to determine if the connection has completed yet.

This method should be called repeatedly until it returns something other than SIOMM_ERROR_NOT_CONNECTED_YET.

If SIOMM_OK is returned, the connection process is complete and there is a connection to the I/O unit.

If the nAutoPUC flag in OpenEnet() or OpenEnet2() was set to TRUE, then this method will attempt to read and clear the I/O units Powerup Clear (PUC) flag after the connection has been made.

Returns
SIOMM_ERROR_NOT_CONNECTED_YET if the connection process isn't complete yet.
SIOMM_TIME_OUT if the connection process timed out.
SIOMM_OK if the connection is complete and ready to be used.
Or possibly another error.
int O22SnapIoMemMap::OpenEnet ( char *  pchIpAddressArg,
int  nPort,
int  nOpenTimeOutMS,
int  nAutoPUC 
)

Starts the connection process to a SNAP Ethernet brain.

Use the IsOpenDone() method to check if the open connection is completed.

This method always connects via TCP. If you wish to use a UDP connection, call OpenEnet2 instead.

See Also
OpenEnet2
IsOpenDone
Parameters
pchIpAddressArgThe IP address or hostname of the Ethernet brain as a string.
nPortThe port that the Ethernet brain is listening (usually 2001)
nOpenTimeOutMSTime to wait for a connection before giving up (milliseconds)
nAutoPUCIf non-zero, clear the brain's Powerup Clear flag automatically.
Returns
SIOMM_OK if everything is OK, an error otherwise.
int O22SnapIoMemMap::OpenEnet2 ( char *  pchIpAddressArg,
int  nPort,
int  nOpenTimeOutMS,
int  nAutoPUC,
int  nConnectionType 
)

Starts the connection process to a SNAP Ethernet brain.

Use the IsOpenDone() method to check if the open connection is completed.

See Also
IsOpenDone
Parameters
pchIpAddressArgThe IP address or hostname of the Ethernet brain as a string.
nPortThe port that the Ethernet brain is listening (usually 2001)
nOpenTimeOutMSTime to wait for a connection before giving up (milliseconds)
nAutoPUCIf non-zero, clear the brain's Powerup Clear flag automatically.
nConnectionTypeSIOMM_TCP or SIOMM_UDP for a TCP or UDP connection.
Returns
SIOMM_OK if everything is OK, an error otherwise.
int O22SnapIoMemMap::OpenSerial ( int  nPort,
uint8_t  nAddress,
int  nBaudRate,
int  nOpenTimeOutMS,
int  nAutoPUC 
)

Connects to a serial brain (SB1 or SB2).

There is no need to call IsOpenDone() when using this connection method: either the connection will succeed or fail to lock the serial port.

Parameters
nPortPort number from your PC, e.g. 3 for COM3
nAddressAddress is set on the brain, e.g. 0xAD
nBaudRateAlso set on the brain, e.g. 230400
nOpenTimeOutMSTime to wait for a connection before giving up (milliseconds)
nAutoPUCIf non-zero, clear the brain's Powerup Clear flag automatically.
Returns
SIOMM_OK if we connect, an error otherwise.
int O22SnapIoMemMap::OpenSerialPassThru ( char *  pchIpAddressArg,
int  nPort,
int  nSerialPort,
uint8_t  nSerialAddress,
int  nSerialBaudRate,
bool  bTwoWire,
int  nOpenTimeOutMS,
int  nAutoPUC,
int  nConnectionType = SIOMM_TCP 
)

Connects to a serial brain (SB1 or SB2) through an Ethernet controller. (S1 or S2).

Parameters
pchIpAddressArgIP address or hostname of the Ethernet controller to connect through, as a string.
nPortThe port that the Ethernet controller is listening (usually 2001).
nConnectionTypeSIOMM_TCP or SIOMM_UDP for a TCP or UDP connection.
nSerialPortPort number from the controller, e.g. 1 for COM1.
nSerialAddressAddress is set on the brain, e.g. 0xAD
nSerialBaudRateAlso set on the brain, e.g. 230400
bTwoWire
nOpenTimeOutMSTime to wait for a connection before giving up (milliseconds)
nAutoPUCIf non-zero, clear the brain's Powerup Clear flag automatically.
Returns
SIOMM_OK if connect, an error otherwise.
int O22SnapIoMemMap::ReadBlock ( const uint32_t  dwDestOffset,
const uint16_t  wDataLength,
uint8_t *  pbyData 
)

Reads a block of data from the I/O unit.

Parameters
dwDestOffsetMemory map offset to read data from
wDataLengthLength of memory to read, in bytes
pbyDataUser supplied pointer to store data read from the brain. Must not be NULL, must be at least wDataLength bytes in size.
Returns
SIOMM_OK if data was read successfully.
SIOMM_ERROR if pbyData is NULL.
Other errors depending on what sort of connection you're using. (Ethernet, Serial, etc.)
int O22SnapIoMemMap::ReadBlockAsFloats ( uint32_t  dwDestOffset,
uint16_t  wDataLength,
float *  pfData 
)

Read a chunk of memory from the brain as an array of integers.

This is a wrapper for ReadBlock.

See Also
ReadBlock
Parameters
dwDestOffsetMemory map offset to read data from
wDataLengthLength of memory to read, in floats (not bytes).
pfDataUser supplied pointer to store data read from the I/O unit. Must not be NULL, must be at least wDataLength * sizeof(float) in length.
Returns
SIOMM_OK if data was read successfully.
SIOMM_ERROR if pnData is NULLL.
Other errors depending on what sort of connection you're using. (e.g. Ethernet, Serial, etc.)
int O22SnapIoMemMap::ReadBlockAsIntegers ( uint32_t  dwDestOffset,
uint16_t  wDataLength,
int *  pnData 
)

Read a chunk of memory from the brain as an array of integers.

This is a wrapper for ReadBlock.

See Also
ReadBlock
Parameters
dwDestOffsetMemory map offset to read data from
wDataLengthLength of memory to read, in integers (not bytes).
pnDataUser supplied pointer to store data read from the I/O unit. Must not be NULL, must be at least wDataLength * sizeof(int) in length.
Returns
SIOMM_OK if data was read successfully.
SIOMM_ERROR if pnData is NULLL.
Other errors depending on what sort of connection you're using. (e.g. Ethernet, Serial, etc.)
int O22SnapIoMemMap::ReadClearAnalogPointMaxValueEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Read and clear the maximum value recorded on an analog point.

NOTE: It's safe to pass NULL for pfValue if you simply want to clear the maximum value.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearAnalogPointMinValueEx ( int  nModule,
int  nPoint,
float *  pfValue 
)

Read and clear the minimum value recorded on an analog point.

NOTE: It's safe to pass NULL for pfValue if you simply want to clear the minimum value.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearAnaPtMaxValue ( int  nPoint,
float *  pfValue 
)

Read and clear the maximum value recorded on an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use ReadClearAnalogPointMaxValueEx instead.

See Also
ReadClearAnalogPointMaxValueEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL;
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearAnaPtMinValue ( int  nPoint,
float *  pfValue 
)

Read and clear the minimum value recorded on an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use ReadClearAnalogPointMinValueEx instead.

See Also
ReadClearAnalogPointMinValueEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pfValuePointer to a float to hold the result of the read.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL;
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearDigPtCounts ( int  nPoint,
int *  pnState 
)

Read and clear the counts value for a digital point.

Note: This method works only for standard density digital points. High density digital points must use ReadClearHDDigitalPointCounts.

See Also
ReadClearHDDigitalPointCounts
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnStatePointer to an integer to hold the counter state for the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearDigPtOffLatch ( int  nPoint,
int *  pnState 
)

Read and clear the off-latch state of a digital point.

Note: This method works only for standard density digital points. High density digital points must use ReadClearHDDigitalPointOffLatch.

See Also
ReadClearHDDigitalPointOffLatch
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnStatePointer to an integer to hold the current off-latch state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearDigPtOnLatch ( int  nPoint,
int *  pnState 
)

Read and clear the on-latch state for a digital point.

Note: This method works only for standard density digital points. High density digital points must use ReadClearHDDigitalPointOnLatch.

See Also
GetHDDigitalPointOnLatch
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
pnStatePointer to an integer to hold the current on-latch state of the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnState is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearHDDigitalPointCounts ( int  nModule,
int  nPoint,
int *  pnCounts 
)

Read and clear the counts value for a high density digital point.

Note: This method works only for high density digital points. High density digital points must use ReadClearDigPtCounts.

See Also
ReadClearDigPtCounts
Parameters
nModuleWhich module to read and clear a point's counter from.
nPointPoint number on the module to read and clear.
pnCountsPointer to an integer to hold the counter value for the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearHDDigitalPointOffLatch ( int  nModule,
int  nPoint,
int *  pnState 
)

Read and clear the off-latch value for a high density digital point.

Note: This method works only for high density digital points. High density digital points must use ReadClearDigPtOffLatch.

See Also
ReadClearDigPtOffLatch
Parameters
nModuleWhich module to read and clear a point's off-latch state from.
nPointPoint number on the module to read and clear.
pnStatePointer to an integer to hold the off-latch state for the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadClearHDDigitalPointOnLatch ( int  nModule,
int  nPoint,
int *  pnState 
)

Read and clear the on-latch value for a high density digital point.

Note: This method works only for high density digital points. High density digital points must use ReadClearDigPtOnLatch.

See Also
ReadClearDigPtOnLatch
Parameters
nModuleWhich module to read and clear a point's on-latch state from.
nPointPoint number on the module to read and clear.
pnStatePointer to an integer to hold the on-latch state for the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pnValue is NULL.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::ReadFloat ( uint32_t  dwDestOffset,
float *  pfValue 
)

Reads a float (4 bytes interpreted as a float) of data from the given offset on the brain.

This is a wrapper for ReadQuad.

Parameters
dwDestOffsetMemory map offset to read data from.
pfValueUser supplied pointer to contain the results of the read. Must not be NULL, must be at least 1 float in length. (e.g. 4 bytes)
Returns
SIOMM_ERROR if pfValue is NULL, otherwise the result from the underlying ReadQuad call.
int O22SnapIoMemMap::ReadQuad ( uint32_t  dwDestOffset,
uint32_t *  pdwQuadlet 
)

Reads a quad (4 bytes) of data from the given offset on the brain.

This is a wrapper for ReadBlock.

Parameters
dwDestOffsetMemory map offset to read data from.
pdwQuadletUser supplied pointer to contain the results of the read. Must not be NULL, must be at least 4 bytes in length.
Returns
SIOMM_ERROR if pwdQuadlet is NULL, otherwise the result from the underlying ReadBlock call.
int O22SnapIoMemMap::SetAlarmEventConfigurationEx ( int  nEvent,
SIOMM_AlarmEventConfigArea  Data 
)

Configure reactions in response to alarms.

Similar to the reactions configured in SetEventMsgConfigurationEx, reactions can be triggered in response to alarms as well.

See Chapter 2 - Using Alarms and Reactions in the OptoMMP Protocol Guide for details.

See Also
SetEventMsgConfigurationEx
Parameters
nEventInteger from 0 to 63 (inclusive) identifying which alarm reaction to configure
DataAn SIOMM_AlarmEventConfigData instance to configure the alarm reaction.
Returns
SIOMM_OK if the alarm configuration was written successfully
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnaBankCountsEx ( SIOMM_AnaBank  BankData)

Write all analog point counter values at once.

Parameters
BankDataSIOMM_AnaBank instance holding values to be written to the analog point counters.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pBankData is NULL.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnaBankValuesEx ( SIOMM_AnaBank  BankData)

Write all analog point values at once.

Parameters
BankDataSIOMM_AnaBank instance holding values to be written to the analog points.
Returns
SIOMM_OK if the data was read successfully.
SIOMM_ERROR if pBankData is NULL.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnalogOutputClamp ( int  nModule,
int  nPoint,
float  fLowClamp,
float  fHighClamp 
)

Set clamping values for an analog point.

NOTE: This method works with I/O units running firmware versions 8.0 or newer. For units with older firmware versions, use the version of SetAnalogOutputClamp without the nModule parameter.

Parameters
nModuleWhich module the point to be configured resides on
nPointPoint number on the module to configure
fLowClampLower bound clamping value
fHighClampUpper bound clamping value
Returns
SIOMM_OK if the point configuration was written successfully
Errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetAnalogOutputClamp ( int  nPoint,
float  fLowClamp,
float  fHighClamp 
)

Set clamping values for an analog point.

NOTE: This method works with I/O units running firmware versions older than 8.0. For units with newer firmware versions, use the version of SetAnalogOutputClamp with the nModule parameter.

Parameters
nPointPoint number on the I/O unit to configure
fLowClampLower bound clamping value
fHighClampUpper bound clamping value
Returns
SIOMM_OK if the point configuration was written successfully
Errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetAnalogPointCountsEx ( int  nModule,
int  nPoint,
float  fValue 
)

Set the counts value of an analog point.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
fValueValue to set on the point.
Returns
SIOMM_OK if the point state was set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnalogPointTpoPeriodEx ( int  nModule,
int  nPoint,
float  fValue 
)

Set the TPO period of an analog point.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

The TPO period is set in units of time in seconds. Valid range: 0.25 to 64.0 seconds, in 0.25 steps.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
fValueValue to set on the point.
Returns
SIOMM_OK if the point state was set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnalogPointValueEx ( int  nModule,
int  nPoint,
float  fValue 
)

Set the value of an analog point.

This method uses the Expanded Analog point memory map, and is only usable on I/O units running firmware 8.0 or greater.

Parameters
nModuleModule number of the point to be read.
nPointPoint number on the module to read.
fValueValue to set on the point.
Returns
SIOMM_OK if the point state was set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnaPtConfiguration ( int  nPoint,
int  nPointType,
float  fOffset,
float  fGain,
float  fHiScale,
float  fLoScale 
)

Configure an analog point.

This method does two things:

  • Configures the point's type, the same thing that ConfigurePoint does.
  • Sets point features. See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for feature values.
Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
nPointTypePoint type value. For analog point types, see the tables in the Configuring I/O Points section of Chapter 2 of the OptoMMP Protocol Guide.
fOffsetPoint offsets
fGainPoint gains
fHiScalePoint high scaling factors
fLoScalePoint low scaling factors
Returns
SIOMM_OK if the point was configured successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnaPtCounts ( int  nPoint,
float  fValue 
)

Sets the counts value of an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use SetAnalogPointCountsEx instead.

See Also
SetAnalogPointCountsEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
fValueValue to set on the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnaPtTpoPeriod ( int  nPoint,
float  fValue 
)

Set the TPO period of an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use SetAnalogPointTpoPeriodEx instead.

The TPO period is set in units of time in seconds. Valid range: 0.25 to 64.0 seconds, in 0.25 steps.

See Also
SetAnalogPointTpoPeriodEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
fValueValue to set on the point.
Returns
SIOMM_OK if the point state was set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetAnaPtValue ( int  nPoint,
float  fValue 
)

Sets the value of an analog point.

This method is meant to be used for I/O units running a firmware version older than 8.0. If your I/O unit is running 8.0 or above, it's recommended that you use SetAnalogPointValueEx instead.

See Also
SetAnalogPointValueEx
Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
fValueValue to set on the point.
Returns
SIOMM_OK if the point state was read successfully.
SIOMM_ERROR if pfValue is NULL.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetCommOptions ( int  nTimeOutMS,
int  nReserved 
)

Set communication options, such as the timeout period.

Parameters
nTimeOutMSTimeout period for normal communications.
nReservedNot used at this time. Set to 0.
Returns
SIOMM_OK if everything is OK, an error otherwise.
int O22SnapIoMemMap::SetDateTime ( char *  pchDateTime)

Set the I/O units date and time.

The date and time is provided as a string with format: YYYY-MM-DD HH:MM:SS:00

Parameters
pchDateTimeString providing the date and time to set on the I/O unit. Must not be NULL.
Returns
SIOMM_OK if the date and time were set successfully.
SIOMM_ERROR if pchDateTime is NULL.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigBankActCounterMask ( int  nPts63to32,
int  nPts31to0 
)

Turn on the counters for a subset of all standard density digital points on at once.

For any digital point with a 1 in the provided mask parameters, turn that point's counter on.

Parameters
nPts63to32Bitmask to choose which points to set states for. (Points 32 through 63)
nPts31to0Bitmask to choose which points to set states for. (Points 0 through 31)
Returns
SIOMM_OK if the point states were set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigBankDeactCounterMask ( int  nPts63to32,
int  nPts31to0 
)

Turn on the counters for a subset of all standard density digital points off at once.

For any digital point with a 1 in the provided mask parameters, turn that point's counter off.

Parameters
nPts63to32Bitmask to choose which points to set states for. (Points 32 through 63)
nPts31to0Bitmask to choose which points to set states for. (Points 0 through 31)
Returns
SIOMM_OK if the point states were set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigBankOffMask ( int  nPts63to32,
int  nPts31to0 
)

Set the state of a subset of all standard density digital points off at once.

For any digital point with a 1 in the provided mask parameters, set that point's state to off.

Parameters
nPts63to32Bitmask to choose which points to set states for. (Points 32 through 63)
nPts31to0Bitmask to choose which points to set states for. (Points 0 through 31)
Returns
SIOMM_OK if the point states were set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigBankOnMask ( int  nPts63to32,
int  nPts31to0 
)

Set the state of a subset of all standard density digital points on at once.

For any digital point with a 1 in the provided mask parameters, set that point's state to on.

Parameters
nPts63to32Bitmask to choose which points to set states for. (Points 32 through 63)
nPts31to0Bitmask to choose which points to set states for. (Points 0 through 31)
Returns
SIOMM_OK if the point states were set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigBankPointStates ( int  nPts63to32,
int  nPts31to0,
int  nMask63to32,
int  nMask31to0 
)

Set the states of (potentially) all standard density digital points in one call.

The two mask parameters determine which points to actually set: only points with 1 values in the masks will have their states changed. The Pts values determine which states to set.

Parameters
nPts63to32Integer representing the states to set for points 32 through 63
nPts31to0Integer representing the states to set for points 0 through 31
nMask63to32Bitmask to choose which points to set states for. (Points 32 through 63)
nMask31to0Bitmask to choose which points to set states for. (Points 0 through 31)
Returns
SIOMM_OK if the point states were set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigitalEventConfigurationEx ( int  nEvent,
SIOMM_DigitalEventConfigArea  Data 
)

Configure digital events and reactions.

Note: This method works with I/O units running firmware versions 8.0 or lower.

In a digital event, the I/O unit monitors one or more inputs, outputs, and Scratch Pad bits for a match to a specific pattern (the event). When the pattern is matched, the I/O unit reacts in a predetermined way. The reaction can turn digital points on or off and can also set bits in the Scratch Pad. You can configure up to 128 digital events and reactions.

See Chapter 2 - Using Digital Events and Reactions in the OptoMMP Protocol Guide for details.

Parameters
nEventInteger from 0 to 127 (inclusive) identifying which event reaction to configure.
DataAn SIOMM_DigitalEventConfigArea instance to configure the event reaction.
Returns
SIOMM_OK if the event configuration was written successfully
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigPtConfiguration ( int  nPoint,
int  nPointType,
int  nFeature 
)

Configure a digital point.

This method does two things:

  • Configures the point's type, the same thing that ConfigurePoint does.
  • Sets point features. See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for feature values.
Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
nPointTypePoint type value. A digital output is type 0x180, an input is 0x100.
nFeatureFeature to configure.
Returns
SIOMM_OK if the point was configured successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigPtCounterState ( int  nPoint,
int  nState 
)

Turn counters on or off for a digital point.

Note: This method works only for standard density digital points.

Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
nState0 to turn counters off, non-zero to turn them on.
Returns
SIOMM_OK if the point state was set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetDigPtState ( int  nPoint,
int  nState 
)

Set the state of a digital point. (e.g. on/off)

Note: This method works only for standard density digital points. High density digital points must use SetHDDigitalPointState.

Parameters
nPointPoint number on the I/O unit to read. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
nStateValue to set for the digital point's state.
Returns
SIOMM_OK if the point state was set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetEventMsgConfigurationEx ( int  nMsg,
SIOMM_EventMsgConfigArea  Data 
)

Configure an event message.

A SNAP Ethernet I/O can be configured to send a message via email, data streaming, SNMP or a serial module when a specific event occurs.

See Chapter 2 - Setting Up Event Messages in the OptoMMP Protocol Guide for details.

Parameters
nMsgInteger between 0 and 127 (inclusive) indicating which message slot to configure
DataAn SIOMM_EventMsgConfigArea instance with the data needed to configure the event message
Returns
SIOMM_OK if the message configuration write completed successfully
Other values possibly resulting from a call to WriteBlock.
int O22SnapIoMemMap::SetHDDigitalPointState ( int  nModule,
int  nPoint,
int  nState 
)

Set the state of a high-density digital point. (e.g. on/off)

Note: This method works only for high density digital points. High density digital points must use SetDigPtState.

See Also
SetDigPtState
Parameters
nModuleWhich module the point to be written resides on.
nPointPoint number on the module to written to.
nStateValue to set for the digital point's state.
Returns
SIOMM_OK if the point state was set successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetPidLoopConfigurationEx ( int  nPid,
SIOMM_PidLoopConfigArea  Data 
)

Configure a PID (proportional/integral/derivative) loop to run on the I/O unit.

See Also
SIOMM_PidLoopConfigArea for more details on how to configure PID loops.
Parameters
nPidWhich PID loop to configure. The number of available PID loops depends on the I/O unit.
DataA SIOMM_PidLoopConfigArea instance containing the PID loop configuration data you wish to set.
Returns
SIOMM_OK if everything worked correctly.
Errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetPointConfigurationEx4 ( int  nModule,
int  nPoint,
SIOMM_PointConfigArea4  PtConfigData 
)

Set the full configuration data for a given point.

See Appendix A - (Expanded) Analog & Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to set configuration for.
PtConfigDataSIOMM_PointConfigArea4 instance holding the configuration for this point
Returns
SIOMM_OK if the configuration was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetPointFilterWeight ( int  nModule,
int  nPoint,
float  fFilterWeight 
)

Set an analog point's filter weight.

SNAP Ethernet-based I/O units can use a filter weight to smooth analog input signals that are erratic or change suddenly. The formula used for filtering is Y = ( X - Y )/W + Y, where Y is the filtered value, X is the new unfiltered value, and W is the filter weight.

A filter weight of 0 turns off the calculation. Values less than or equal to 0.5 are changed to 0, since those values would cause an unstable signal.

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to set configuration for.
fFilterWeightFilter weight value to set for the point.
Returns
SIOMM_OK if the point's configuration was written successfully
Other errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetPointGain ( int  nModule,
int  nPoint,
float  fGain 
)

Set an analog point's gain value.

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to set configuration for.
fGainFilter weight value to set for the point.
Returns
SIOMM_OK if the point's configuration was written successfully
Other errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetPointName ( int  nModule,
int  nPoint,
char *  pchPointName 
)

Sets a user-friendly name for a point.

A point's name is limited to 51 characters, including a NULL byte.

Parameters
nModuleWhich module the point to be named resides on
nPointPoint number on the module to set a name for
pchPointNameC-string holding the point's name
Returns
SIOMM_OK if the point's name was written successfully
SIOMM_ERROR if pchPointName is NULL
Other errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetPointOffset ( int  nModule,
int  nPoint,
float  fOffset 
)

Set an analog point's offset value

Parameters
nModuleWhich module the targeted resides on
nPointPoint number on the module to set the offset value for
fOffsetOffset value to set on the point
Returns
SIOMM_OK if the point's configuration was written successfully
Errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetPointScale ( int  nModule,
int  nPoint,
float  fHiScale,
float  fLoScale 
)

Set scaling values for an analog point.

You can scale analog input or output points to match your needs. For example, you can scale a -5 V to +5 V input point to reflect 0% to 100%. Point types may be unipolar or bipolar.

See Chapter 2 - Scaling (Analog Points) of the OptoMMP Protocol Guide for details.

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to set scaling values for
fHiScaleHigh value to use for scaling
fLoScaleLow value to use for scaling
Returns
SIOMM_OK if the point's scaling values were written successfully
Errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetPointWatchdog ( int  nModule,
int  nPoint,
float  fValue,
int  nEnabled 
)

Configure a watchdog for a point

A watchdog monitors communication on the OptoMMP port. If nothing accesses the port for the length of time set in the watchdog, the I/O unit automatically sets designated digital and analog I/O points to the values you have determined.

A watchdog helps make sure that a communication failure doesn’t result in disaster. If communication fails between the host and the I/O unit controlling a process, the watchdog makes sure the process is automatically brought to a safe state. For example, a valve could automatically close to avoid completely emptying a tank.

Parameters
nModuleWhich module the targeted point resides on
nPointPoint number on the module to set watchdog parameters for
fValueValue to set the point to if communications fail
nEnabledTurn the watchdog on or off. 0 means off, non-zero means on.
Returns
SIOMM_OK if the point was configured successfully.
Errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetPtConfigurationEx ( int  nPoint,
SIOMM_PointConfigArea  Data 
)

Set the full configuration for a given point.

NOTE: This method is deprecated, use SetPtConfigurationEx3 instead.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

See Also
SetPtConfigurationEx3
Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
DataSIOMM_PointConfigArea instance filled out with the point's full configuration details.
Returns
SIOMM_OK if the data was read successfully.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::SetPtConfigurationEx2 ( int  nPoint,
SIOMM_PointConfigArea2  Data 
)

Set the full configuration for a given point.

NOTE: This method is deprecated, use SetPtConfigurationEx3 instead.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

See Also
SetPtConfigurationEx3
Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
DataSIOMM_PointConfigArea2 instance filled out with the point's full configuration details.
Returns
SIOMM_OK if the data was read successfully.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::SetPtConfigurationEx3 ( int  nPoint,
SIOMM_PointConfigArea3  Data 
)

Set the full configuration for a given point.

See Appendix A - (Old) Analog and Digital Point Configuration Information - Read/Write of the OptoMMP Protocol Guide for details.

Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
DataSIOMM_PointConfigArea3 instance filled out with the point's full configuration details.
Returns
SIOMM_OK if the data was read successfully.
Other errors possibly resulting from ReadBlock.
int O22SnapIoMemMap::SetPtWatchdog ( int  nPoint,
float  fValue,
int  nEnabled 
)

Sets a watchdog value for a point.

A watchdog monitors communication on the OptoMMP port. If nothing accesses the port for the length of time set in the watchdog, the I/O unit automatically sets designated digital and analog I/O points to the values you have determined.

A watchdog helps make sure that a communication failure doesn’t result in disaster. If communication fails between the host and the I/O unit controlling a process, the watchdog makes sure the process is automatically brought to a safe state. For example, a valve could automatically close to avoid completely emptying a tank.

Parameters
nPointPoint number on the I/O unit to configure. Typically, this will be the module slot on the rack multiplied by 4, plus the point number on that module.
fValueValue to set the point to if communications fail
nEnabledTurn the watchdog on or off. 0 means off, non-zero means on.
Returns
SIOMM_OK if the point was configured successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetScratchPadBitArea ( int  nBits63to32,
int  nBits31to0 
)

Set the I/O unit's scratchpad bits area

Parameters
nBits63to32Bitmask to set for bits 32-63
nBits31to0Bitmask to set for bits 0-31
Returns
SIOMM_OK if the scratpchpad area was set successfully
Errors possibly resulting from a call to WriteBlock
int O22SnapIoMemMap::SetScratchPadBitAreaMask ( int  nOnMask63to32,
int  nOnMask31to0,
int  nOffMask63to32,
int  nOffMask31to0 
)

Set the I/O unit's scratchpad area.

This method allows the caller to conditionally set bits in the scratchpad area. Any bit location set to 1 in nOnMask* arguments will be set ON, others will be left untouched. Any bit location set to 1 in the nOffMask* arguments will be set OFF, others will be left untouched.

Parameters
nOnMask63to32Bitmask of locations to set ON, bits 32-63
nOnMask31to0Bitmask of locations to set ON, bits 0-31
nOffMask63to32Bitmask of locations to set OFF, bits 32-63
nOffMask31to0Bitmask of locations to set OFF, bits 0-31
Returns
SIOMM_OK if the scratchpad area was written to successfully
Errors possibly resulting from a call to WriteBlock
int O22SnapIoMemMap::SetScratchPadFloatArea ( int  nStartIndex,
int  nLength,
float *  pfData 
)

Write to the I/O unit's float scratch pad area

Parameters
nStartIndexIndex of the float scratchpad location to begin writing to
nLengthLength (in float locations) of the data to write
pfDataPointer to a user-supplied buffer of data to write. Must be nLength * 4 bytes in length.
Returns
SIOMM_OK if the data was written successfully
SIOMM_ERROR if pnData was NULL
Other errors possibly resulting from a call to WriteBlock
int O22SnapIoMemMap::SetScratchPadInteger64Area ( int  nStartIndex,
int  nLength,
int *  pnData 
)

Write to the I/O unit's 64-bit integer scratch pad area

Parameters
nStartIndexIndex of the 64-bit integer scratchpad location to begin writing to
nLengthLength (in integer locations) of the data to write
pnDataPointer to a user-supplied buffer of data to write. Must be nLength * 8 bytes in length.
Returns
SIOMM_OK if the data was written successfully
SIOMM_ERROR if pnData was NULL
Other errors possibly resulting from a call to WriteBlock
int O22SnapIoMemMap::SetScratchPadIntegerArea ( int  nStartIndex,
int  nLength,
int *  pnData 
)

Write to the I/O unit's integer scratch pad area

Parameters
nStartIndexIndex of the integer scratchpad location to begin writing to
nLengthLength (in integer locations) of the data to write
pnDataPointer to a user-supplied buffer of data to write. Must be nLength * 4 bytes in length.
Returns
SIOMM_OK if the data was written successfully
SIOMM_ERROR if pnData was NULL
Other errors possibly resulting from a call to WriteBlock
int O22SnapIoMemMap::SetScratchPadStringArea ( int  nStartIndex,
int  nLength,
SIOMM_ScratchPadString pStringData 
)

Write to the I/O unit's string scratch pad area

Parameters
nStartIndexIndex of the string scratchpad location to begin reading from
nLengthLength (in string locations) of the data to read
pStringDataArray of SIOMM_ScratchPadString instances to write to the I/O units string scratchpad. Must be sizeof(SIOMM_ScratchPadString) * nLength bytes in length.
Returns
SIOMM_OK if the data was read successfully
SIOMM_ERROR if pStringData was NULL
Other errors possibly resulting from a call to ReadBlock
int O22SnapIoMemMap::SetSerialEventConfigurationEx ( int  nEvent,
SIOMM_SerialEventConfigArea  Data 
)

Configure reactions in response to serial events.

See Chapter 2 - Using Serial Events and Reactions of the OptoMMP Protocol Guide for details.

Parameters
nEventIndex of the serial event to configure
DataAn SIOMM_SerialEventConfigArea instance to use to configure the serial reaction
Returns
SIOMM_OK if the serial event configuration was written successfully
Other errors possibly resulting from WriteBlock
int O22SnapIoMemMap::SetSerialModuleConfigurationEx ( int  nSerialPort,
SIOMM_SerialModuleConfigArea  ConfigData 
)

Write configuration data for a SNAP serial communication module.

See Appendix A - Serial Module Configuration - Read/Write of the Opto MMP Protocol Guide for details.

Parameters
nSerialPortWhich serial port to configure. See Appendix A - Serial Module Configuration - Read/Write for how port numbers are determined.
ConfigDataSIOMM_SerialModuleConfigArea structure instance with the data to be written.
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetStatusBootpRequest ( int  nFlag)

Set the I/O unit to send BootP or DHCP request when turned on.

Possible values for nFlag:

  • 0 Send BootP or DHCP request only if device's IP address is 0.0.0.0.
  • 1 Always send BootP or DHCP request when device is turned on.

See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.

Parameters
nFlagBootP request flag.
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetStatusDegrees ( int  nDegFlag)

Configure the I/O unit to report temperatures in degrees Celsius or degrees Fahrenheit

Possible values for nDegFlag:

  • 0 Report temperatures in degrees Celsius. (this is the default)
  • 1 Report temperatures in degrees Fahrenheit.

See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.

Parameters
nDegFlagOption to set for reporting temperatures.
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetStatusOperation ( int  nOpCode)

Writes the given opcode to the SIOMM_STATUS_WRITE_OPERATION location in the I/O units memory map.

Some example opcodes are:

  • 0x00000001 - Send Powerup Clear
  • 0x00000002 - Reset to defaults
  • 0x00000003 - Store all configuration data to flash.

See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.

Parameters
nOpCodeOpcode to write to the SIOMM_STATUS_WRITE_OPERATION location.
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetStatusWatchdogTime ( int  nTimeMS)

Set watchdog time in milliseconds.

A value of 0 disables the watchdog. Any other positive value sets the watchdog time in milliseconds. Negative values are an error.

See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.

Parameters
nTimeMSWatchdog time in milliseconds. (Must be >= 0)
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetStatusWriteEx ( SIOMM_StatusWrite  StatusWriteData)

Write new data to the Status Read/Write area of the I/O unit.

See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.

Parameters
StatusWriteDataA SIOMM_StatusWrite structure holding the data to be written to the Status Write area.
Returns
SIOMM_OK if the data was written successfully.
Other errors possibly resulting from WriteBlock.
int O22SnapIoMemMap::SetStreamConfiguration ( int  nOnFlag,
int  nIntervalMS,
int  nPort,
int  nIoMirroringEnabled,
int  nStartAddress,
int  nDataSize 
)

Set the IO units current streaming configuration.

Streaming allows your application to get continuous information from a SNAP Ethernet-based I/O unit without the need to continually poll it.

See Chapter 2 - Streaming Data in the OptoMMP Protocol Guide for details.

Parameters
nOnFlagWhether or not streaming is enabled. 0 is off, non-zero is on.
nIntervalMSStreaming interval, in milliseconds
nPortIP port number to stream to
nIoMirroringEnabledWhether I/O mirroring is enabled. 0 is off, non-zero is on.
nStartAddressBeginning address of the data to be streamed
nDataSizeSize of data to be streamed. Maximum size is 1480 bytes.
Returns
SIOMM_OK if the streaming configuration was read successfully.
Errors possibly resulting from a call to ReadBlock.
int O22SnapIoMemMap::SetStreamTarget ( int  nTarget,
char *  pchIpAddressArg 
)

Set the IP address for a streaming target

The IP address is passed as a string in dotted number notation, e.g. "1.2.3.4". The passed string must be an IP adddress; the method does not perform hostname lookups.

Parameters
nTargetIndex of the streaming target to set the IP address for. (1-8)
pchIpAddressArgIP address to set as a dotted string (e.g. "1.2.3.4")
Returns
SIOMM_OK if the IP address was set successfully
SIOMM_ERROR if pchIpAddressArg is NULL
Other errors possibly resulting from a call to WriteBlock
int O22SnapIoMemMap::SetTimerEventConfigurationEx ( int  nEvent,
SIOMM_TimerEventConfigArea  Data 
)

Configure a timer event.

Note: Only supported on firmware versions 8.0 and older.

See Appendix A - Digital Events - Expanded (Formerly Timers) of the OptoMMP Protocol Guide for more details.

Parameters
nEventIndex of the timer event to configure
DataAn SIOMM_TimerEventConfigArea instance used to configure the timer event
Returns
SIOMM_ if the timer event configuration was written successfully
Errors possibly resulting from WriteBlock
int O22SnapIoMemMap::UnpackReadBlockResponse ( uint8_t *  pbyReadBlockResponse,
uint8_t *  pbyTransactionLabel,
uint8_t *  pbyResponseCode,
uint16_t *  pwDataLength,
uint8_t *  pbyBlockData 
)

Unpacks a read response.

This is an internally used utility method to build a read request. Client code isn't likely to need it.

Parameters
pbyReadBlockResponseResponse packet from the server
pbyTransactionLabelUser supplied pointer to a uint8_t to hold the transaction label from the packet
pbyResponseCodeUser supplied pointer to a uint8_t to hold the response code from the packet.
pwDataLengthUser supplied pointer to a uint16_t to hold the length of the data in the response packet
pbyBlockDataUser supplied pointer to hold the data from the read request.
Returns
SIOMM_ERROR if any inputs are NULL, SIOMM_ERROR_INCORRECT_TCODE_RECIEVED if the packet isn't valid, SIOMM_OK otherwise.
int O22SnapIoMemMap::UnpackWriteResponse ( uint8_t *  pbyWriteQuadletResponse,
uint8_t *  pbyTransactionLabel,
uint8_t *  pbyResponseCode 
)

Unpacks a write response packet.

This is an internally used utility method; client code isn't likely to need it.

Parameters
pbyWriteQuadletResponseResponse packet from the server.
pbyTransactionLabelUser supplied pointer to a uint8_t to hold the transaction label from the packet
pbyResponseCodeUser supplied pointer to a uint8_t to hold the response code from the packet.
Returns
SIOMM_ERROR if any of the input parameters are NULL, or if this is not a write response packet. SIOMM_OK otherwise.
int O22SnapIoMemMap::WriteBlock ( const uint32_t  dwDestOffset,
const uint16_t  wDataLength,
uint8_t *  pbyData 
)

Writes a block of data to the I/O unit.

Parameters
dwDestOffsetMemory map offset to write data to
wDataLengthLength of memory to write (e.g. pbyData), in bytes
pbyDataData to write to the brain.
Returns
SIOMM_OK if data was written successfully.
SIOMM_ERROR if pbyData is NULL.
Other errors depending on what sort of connection you're using. (Ethernet, Serial, etc.)
int O22SnapIoMemMap::WriteBlockAsFloats ( uint32_t  dwDestOffset,
uint16_t  wDataLength,
float *  pfData 
)

Write an array of floats to the I/O unit.

This is a wrapper for WriteBlock

See Also
WriteBlock
Parameters
dwDestOffsetMemory map offset to write data to
wDataLengthLength of the array of float in pnData. (Not length in bytes).
pfDataArray of floats to write to the I/O unit.
Returns
SIOMM_OK if data was written successfully.
SIOMM_ERROR if pnData is NULL.
Other errors depending on what sort of connection you're using. (e.g. Ethernet, Serial, etc.)
int O22SnapIoMemMap::WriteBlockAsIntegers ( uint32_t  dwDestOffset,
uint16_t  wDataLength,
int *  pnData 
)

Write an array of integers to the I/O unit.

This is a wrapper for WriteBlock

See Also
WriteBlock
Parameters
dwDestOffsetMemory map offset to write data to
wDataLengthLength of the array of integers in pnData. (Not length in bytes).
pnDataArray of integers to write to the I/O unit.
Returns
SIOMM_OK if data was written successfully.
SIOMM_ERROR if pnData is NULL.
Other errors depending on what sort of connection you're using. (e.g. Ethernet, Serial, etc.)
int O22SnapIoMemMap::WriteFloat ( uint32_t  dwDestOffset,
float  fValue 
)

Writes a float (4 bytes) of data to the given offset on the brain.

This is a wrapper for WriteQuad

Parameters
dwDestOffsetMemory map offset to write data to.
fValueData to be written to the device.
Returns
The result from the underlying WriteQuad call.
int O22SnapIoMemMap::WriteQuad ( uint32_t  dwDestOffset,
uint32_t  dwQuadlet 
)

Writes a quad (4 bytes) of data to the given offset on the brain.

This is a wrapper for WriteBlock

Parameters
dwDestOffsetMemory map offset to write data to.
dwQuadletData to be written to the device.
Returns
The result from the underlying WriteBlock call.

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