#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 () |
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:
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.
pbyReadBlockRequest | User supplied pointer to a block of memory to hold the read request. Must not be NULL, must be at least 16 bytes in size. |
byTransactionLabel | Transaction label to embed in the read request. Lets the caller identify response packets. |
dwDestinationOffset | The target offset to read from |
wDataLength | The amount of data to read, in bytes. |
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.
pbyWriteBlockRequest | User 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. |
byTransactionLabel | Transaction label to embed in the write request. Lets the caller identify response packets. |
dwDestinationOffset | Target offset to write data to |
wDataLength | Length of the data in pbyBlockData |
pbyBlockData | Data to be written, this is appended to the end of the request. |
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.
nModule | Integer between 0 and 63 (inclusive) indicating which module the target point is on. |
nPoint | Integer between 0 and 63 (inclusive) indicating which point on the target module to target |
pfValue | Pointer to a float holding the result from the read operation. |
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.
nModule | Integer between 0 and 63 (inclusive) indicating which module the target point is on. |
nPoint | Integer between 0 and 63 (inclusive) indicating which point on the target module to target |
pfValue | Pointer to a float holding the result from the read operation. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read operation. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read operation. |
int O22SnapIoMemMap::Close | ( | ) |
Close the connection to the I/O unit.
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.
nPoint | Point 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. |
nPointType | Point type value. A digital output is type 0x180, an input is 0x100. |
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.
nModule | Which module the point to be configured resides on |
nPoint | Point number on the module to configure. |
nPointType | Point type value. A digital output is type 0x180, an input is 0x100. |
int O22SnapIoMemMap::GetAnaBankCountsEx | ( | SIOMM_AnaBank * | pBankData | ) |
Read the counts value of all 64 possible analog points at once.
pBankData | Pointer to a SIOMM_AnaBank instance to hold the results of the call. |
int O22SnapIoMemMap::GetAnaBankMaxValuesEx | ( | SIOMM_AnaBank * | pBankData | ) |
Read the maximum recorded value of all 64 possible analog points at once.
pBankData | Pointer to a SIOMM_AnaBank instance to hold the results of the call. |
int O22SnapIoMemMap::GetAnaBankMinValuesEx | ( | SIOMM_AnaBank * | pBankData | ) |
Read the minimum recorded value of all 64 possible analog points at once.
pBankData | Pointer to a SIOMM_AnaBank instance to hold the results of the call. |
int O22SnapIoMemMap::GetAnaBanksEx | ( | SIOMM_AnaBanks * | pBankData | ) |
Read the entire analog bank at once.
pBankData | Pointer to a SIOMM_AnaBanks instance to hold the results of the call. |
int O22SnapIoMemMap::GetAnaBankValuesEx | ( | SIOMM_AnaBank * | pBankData | ) |
Read the value of all 64 possible analog points at once.
pBankData | Pointer to a SIOMM_AnaBank instance to hold the results of the call. |
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.
nModule | Which module the point to be configured resides on |
nPoint | Point number on the module to configure |
pfLowClamp | Pointer to a float to hold the lower bound clamping value |
pfHighClamp | Pointer to a float to hold the upper bound clamping value |
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.
nPoint | Point number on the I/O unit to configure |
pfLowClamp | Pointer to a float to hold the lower bound clamping value |
pfHighClamp | Pointer to a float to hold the upper bound clamping value |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pData | Pointer to an instance of a SIOMM_AnaPointReadArea structure to hold the results from the read. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pData | Pointer to a SIOMM_AnaPointReadArea instance to hold the results of the read operation. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read. |
|
inline |
Returns the current timeout period as set by SetCommOptions()
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.
nStartIndex | Sample location to start reading from |
nLength | Number of samples to read. |
pDataSamples | Array of SIOMM_DataLogSample instances to hold the read data. Must be sizeof(SIOMM_DataLogSample) * nLength bytes in length. |
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.
pchDateTime | User supplied pointer to a string. Must not be NULL, must be at least 23 characters in length (with null byte). |
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.
pnPts63to32 | Pointer to an integer to return a bitmask representing points 32 through 63 |
pnPts31to0 | Pointer to an integer to return a bitmask representing points 0 through 31 |
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.
pnPts63to32 | Pointer to an integer to return a bitmask representing points 32 through 63 |
pnPts31to0 | Pointer to an integer to return a bitmask representing points 0 through 31 |
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.
pnPts63to32 | Pointer to an integer to return a bitmask representing points 32 through 63 |
pnPts31to0 | Pointer to an integer to return a bitmask representing points 0 through 31 |
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.
pnPts63to32 | Pointer to an integer to return a bitmask representing points 32 through 63 |
pnPts31to0 | Pointer to an integer to return a bitmask representing points 0 through 31 |
int O22SnapIoMemMap::GetDigBankReadAreaEx | ( | SIOMM_DigBankReadArea * | pData | ) |
Read the entire standard density digital point bank in one shot.
pData | Pointer to a SIOMM_DigBankReadArea instance to hold the results of the read. |
int O22SnapIoMemMap::GetDigitalPointReadAreaEx | ( | int | nModule, |
int | nPoint, | ||
SIOMM_DigPointReadArea * | pData | ||
) |
Get the read area for a high density digital point
nModule | Which module the point to be read resides on |
nPoint | Point number on the module to read |
pData | Pointer to a SIOMM_DigPointReadArea instance to hold the results of the read operation |
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.
nPoint | Point 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. |
pnState | Pointer to an integer to hold the counter state (e.g. on/off) for the point. |
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.
nPoint | Point 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. |
pnValue | Pointer to an integer to hold the counter value for the point. |
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.
nPoint | Point 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. |
pnState | Pointer to an integer to hold the current off-latch state of the point. |
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.
nPoint | Point 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. |
pnState | Pointer to an integer to hold the current on-latch state of the point. |
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.
nPoint | Point 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. |
pData | Pointer to a SIOMM_DigPointReadArea instance to hold the state of the digital point. |
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.
nPoint | Point 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. |
pnState | Pointer to an integer to hold the current state of the point. |
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.
nModule | Which module to read a point's state from. |
nPoint | Point number on the module to read. |
pnCounts | Pointer to an integer to hold the counter value for the point. |
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.
nModule | Which module to read a point's state from. |
nPoint | Point number on the module to read. |
pnState | Pointer to an integer to hold the current off-latch state of the point. |
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.
nModule | Which module to read a point's state from. |
nPoint | Point number on the module to read. |
pnState | Pointer to an integer to hold the current on-latch state of the point. |
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.
nModule | Which module to read a point's state from. |
nPoint | Point number on the module to read. |
pnState | Pointer to an integer to hold the current state of the point. |
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.
nPoint | Point 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. |
pnModuleType | Pointer to an integer to return the point type for the point. Must not be NULL. |
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).
nModule | Which module the targetted point resides on |
nPoint | Which point to check the type for |
pnModuleType | Pointer to an integer to return the point type for the point. Must not be NULL. |
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.
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to read configuration for. |
pData | Pointer to a SIOMM_PointConfigArea4 instance. Must not be NULL. |
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.
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to read the gain value for |
pfGain | Pointer to a float value to return the point's gain value. |
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
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to read the offset value for |
pfOffset | Pointer to a float value to return the point's offset value. |
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.
nPoint | Point 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. |
pData | Pointer to a SIOMM_PointConfigArea instance. Must not be NULL. |
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.
nPoint | Point 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. |
pData | Pointer to a SIOMM_PointConfigArea2 instance. Must not be NULL. |
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.
nPoint | Point 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. |
pData | Pointer to a SIOMM_PointConfigArea3 instance. Must not be NULL. |
int O22SnapIoMemMap::GetScratchPadBitArea | ( | int * | pnBits63to32, |
int * | pnBits31to0 | ||
) |
Read the I/O unit's scratchpad bits area
pnBits63to32 | Pointer to hold bits 32-63 of the scratchpad area |
pnBits31to0 | Pointer to hold bits 0-31 of the scratchpad area |
int O22SnapIoMemMap::GetScratchPadFloatArea | ( | int | nStartIndex, |
int | nLength, | ||
float * | pfData | ||
) |
Read from the I/O unit's float scratch pad area
nStartIndex | Index of the float scratchpad location to begin reading from |
nLength | Length (in float locations) of the data to read |
pfData | Pointer to a user-supplied buffer to write the data read to. Must be nLength * 4 bytes in length. |
int O22SnapIoMemMap::GetScratchPadInteger64Area | ( | int | nStartIndex, |
int | nLength, | ||
int * | pnData | ||
) |
Read from the I/O unit's 64-bit integer scratch pad area
nStartIndex | Index of the 64-bit integer scratchpad location to begin reading from |
nLength | Length (in integer locations) of the data to read |
pnData | Pointer to a user-supplied buffer to write the data read to. Must be nLength * 8 bytes in length. |
int O22SnapIoMemMap::GetScratchPadIntegerArea | ( | int | nStartIndex, |
int | nLength, | ||
int * | pnData | ||
) |
Read from the I/O unit's integer scratch pad area
nStartIndex | Index of the integer scratchpad location to begin reading from |
nLength | Length (in integer locations) of the data to read |
pnData | Pointer to a user-supplied buffer to write the data read to. Must be nLength * 4 bytes in length. |
int O22SnapIoMemMap::GetScratchPadStringArea | ( | int | nStartIndex, |
int | nLength, | ||
SIOMM_ScratchPadString * | pStringData | ||
) |
Read from the I/O unit's string scratch pad area
nStartIndex | Index of the string scratchpad location to begin reading from |
nLength | Length (in string locations) of the data to read |
pStringData | Pointer to an array of SIOMM_ScratchPadString instances to hold the read string data. Must be sizeof(SIOMM_ScratchPadString) * nLength bytes in length. |
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.
nSerialPort | Which serial port to configure. See Appendix A - Serial Module Configuration - Read/Write for how port numbers are determined. |
pConfigData | Pointer to a SIOMM_SerialModuleConfigArea structure instance to hold the data read. |
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.
pnBootpAlways | Pointer to an integer to store the returned flag. |
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.
pnDegrees | Pointer to an integer to store the returned flag. |
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.
pHardwareData | Pointer to a SIOMM_StatusHardware structure to hold the returned hardware details. Must not be NULL. |
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.
pHardwareData | Pointer to a SIOMM_StatusHardware2 structure to hold the returned hardware details. Must not be NULL. |
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.
pnErrorCode | Pointer to an integer to store the returned error code. |
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.
pNetworkData | Pointer to a SIOMM_StatusNetwork structure to hold the returned network details. Must not be NULL. |
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.
pNetworkData | Pointer to a SIOMM_StatusNetwork2 structure to hold the returned network details. Must not be NULL. |
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.
pnPUCFlag | Pointer to an integer to store the returned powerup clear flag. |
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.
pVersionData | Pointer to a SIOMM_StatusVersion structure to hold the returned version information. Must not be NULL. |
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.
pnTimeMS | Pointer to an integer to store the returned watchdog time. |
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.
pStatusWriteData | Pointer to a SIOMM_StatusWrite structure to hold the returned network details. Must not be NULL. |
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.
pnOnFlag | Whether or not streaming is enabled. 0 is off, non-zero is on. |
pnIntervalMS | Streaming interval, in milliseconds |
pnPort | IP port number to stream to |
pnIoMirroringEnabled | Whether I/O mirroring is enabled. 0 is off, non-zero is on. |
pnStartAddress | Beginning address of the data being streamed |
pnDataSize | Size of data being streamed. Maximum size is 1480 bytes. |
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.
pStreamData | Pointer to an SIOMM_StreamStandardBlock instance to hold the results of the read. |
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.
nTarget | Index of the streaming target to retrieve the IP address for. (1-8) |
pnIpAddressArg | Pointer to an integer to hold the returned address. Must not be NULL. |
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.
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.
pchIpAddressArg | The IP address or hostname of the Ethernet brain as a string. |
nPort | The port that the Ethernet brain is listening (usually 2001) |
nOpenTimeOutMS | Time to wait for a connection before giving up (milliseconds) |
nAutoPUC | If non-zero, clear the brain's Powerup Clear flag automatically. |
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.
pchIpAddressArg | The IP address or hostname of the Ethernet brain as a string. |
nPort | The port that the Ethernet brain is listening (usually 2001) |
nOpenTimeOutMS | Time to wait for a connection before giving up (milliseconds) |
nAutoPUC | If non-zero, clear the brain's Powerup Clear flag automatically. |
nConnectionType | SIOMM_TCP or SIOMM_UDP for a TCP or UDP connection. |
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.
nPort | Port number from your PC, e.g. 3 for COM3 |
nAddress | Address is set on the brain, e.g. 0xAD |
nBaudRate | Also set on the brain, e.g. 230400 |
nOpenTimeOutMS | Time to wait for a connection before giving up (milliseconds) |
nAutoPUC | If non-zero, clear the brain's Powerup Clear flag automatically. |
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).
pchIpAddressArg | IP address or hostname of the Ethernet controller to connect through, as a string. |
nPort | The port that the Ethernet controller is listening (usually 2001). |
nConnectionType | SIOMM_TCP or SIOMM_UDP for a TCP or UDP connection. |
nSerialPort | Port number from the controller, e.g. 1 for COM1. |
nSerialAddress | Address is set on the brain, e.g. 0xAD |
nSerialBaudRate | Also set on the brain, e.g. 230400 |
bTwoWire | |
nOpenTimeOutMS | Time to wait for a connection before giving up (milliseconds) |
nAutoPUC | If non-zero, clear the brain's Powerup Clear flag automatically. |
int O22SnapIoMemMap::ReadBlock | ( | const uint32_t | dwDestOffset, |
const uint16_t | wDataLength, | ||
uint8_t * | pbyData | ||
) |
Reads a block of data from the I/O unit.
dwDestOffset | Memory map offset to read data from |
wDataLength | Length of memory to read, in bytes |
pbyData | User supplied pointer to store data read from the brain. Must not be NULL, must be at least wDataLength bytes in size. |
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.
dwDestOffset | Memory map offset to read data from |
wDataLength | Length of memory to read, in floats (not bytes). |
pfData | User supplied pointer to store data read from the I/O unit. Must not be NULL, must be at least wDataLength * sizeof(float) in length. |
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.
dwDestOffset | Memory map offset to read data from |
wDataLength | Length of memory to read, in integers (not bytes). |
pnData | User supplied pointer to store data read from the I/O unit. Must not be NULL, must be at least wDataLength * sizeof(int) in length. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pfValue | Pointer to a float to hold the result of the read. |
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.
nPoint | Point 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. |
pnState | Pointer to an integer to hold the counter state for the point. |
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.
nPoint | Point 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. |
pnState | Pointer to an integer to hold the current off-latch state of the point. |
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.
nPoint | Point 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. |
pnState | Pointer to an integer to hold the current on-latch state of the point. |
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.
nModule | Which module to read and clear a point's counter from. |
nPoint | Point number on the module to read and clear. |
pnCounts | Pointer to an integer to hold the counter value for the point. |
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.
nModule | Which module to read and clear a point's off-latch state from. |
nPoint | Point number on the module to read and clear. |
pnState | Pointer to an integer to hold the off-latch state for the point. |
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.
nModule | Which module to read and clear a point's on-latch state from. |
nPoint | Point number on the module to read and clear. |
pnState | Pointer to an integer to hold the on-latch state for the point. |
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.
dwDestOffset | Memory map offset to read data from. |
pfValue | User 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) |
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.
dwDestOffset | Memory map offset to read data from. |
pdwQuadlet | User supplied pointer to contain the results of the read. Must not be NULL, must be at least 4 bytes in length. |
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.
nEvent | Integer from 0 to 63 (inclusive) identifying which alarm reaction to configure |
Data | An SIOMM_AlarmEventConfigData instance to configure the alarm reaction. |
int O22SnapIoMemMap::SetAnaBankCountsEx | ( | SIOMM_AnaBank | BankData | ) |
Write all analog point counter values at once.
BankData | SIOMM_AnaBank instance holding values to be written to the analog point counters. |
int O22SnapIoMemMap::SetAnaBankValuesEx | ( | SIOMM_AnaBank | BankData | ) |
Write all analog point values at once.
BankData | SIOMM_AnaBank instance holding values to be written to the analog points. |
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.
nModule | Which module the point to be configured resides on |
nPoint | Point number on the module to configure |
fLowClamp | Lower bound clamping value |
fHighClamp | Upper bound clamping value |
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.
nPoint | Point number on the I/O unit to configure |
fLowClamp | Lower bound clamping value |
fHighClamp | Upper bound clamping value |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
fValue | Value to set on the point. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
fValue | Value to set on the point. |
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.
nModule | Module number of the point to be read. |
nPoint | Point number on the module to read. |
fValue | Value to set on the point. |
int O22SnapIoMemMap::SetAnaPtConfiguration | ( | int | nPoint, |
int | nPointType, | ||
float | fOffset, | ||
float | fGain, | ||
float | fHiScale, | ||
float | fLoScale | ||
) |
Configure an analog point.
This method does two things:
nPoint | Point 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. |
nPointType | Point type value. For analog point types, see the tables in the Configuring I/O Points section of Chapter 2 of the OptoMMP Protocol Guide. |
fOffset | Point offsets |
fGain | Point gains |
fHiScale | Point high scaling factors |
fLoScale | Point low scaling factors |
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.
nPoint | Point 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. |
fValue | Value to set on the point. |
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.
nPoint | Point 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. |
fValue | Value to set on the point. |
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.
nPoint | Point 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. |
fValue | Value to set on the point. |
int O22SnapIoMemMap::SetCommOptions | ( | int | nTimeOutMS, |
int | nReserved | ||
) |
Set communication options, such as the timeout period.
nTimeOutMS | Timeout period for normal communications. |
nReserved | Not used at this time. Set to 0. |
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
pchDateTime | String providing the date and time to set on the I/O unit. Must not be NULL. |
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.
nPts63to32 | Bitmask to choose which points to set states for. (Points 32 through 63) |
nPts31to0 | Bitmask to choose which points to set states for. (Points 0 through 31) |
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.
nPts63to32 | Bitmask to choose which points to set states for. (Points 32 through 63) |
nPts31to0 | Bitmask to choose which points to set states for. (Points 0 through 31) |
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.
nPts63to32 | Bitmask to choose which points to set states for. (Points 32 through 63) |
nPts31to0 | Bitmask to choose which points to set states for. (Points 0 through 31) |
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.
nPts63to32 | Bitmask to choose which points to set states for. (Points 32 through 63) |
nPts31to0 | Bitmask to choose which points to set states for. (Points 0 through 31) |
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.
nPts63to32 | Integer representing the states to set for points 32 through 63 |
nPts31to0 | Integer representing the states to set for points 0 through 31 |
nMask63to32 | Bitmask to choose which points to set states for. (Points 32 through 63) |
nMask31to0 | Bitmask to choose which points to set states for. (Points 0 through 31) |
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.
nEvent | Integer from 0 to 127 (inclusive) identifying which event reaction to configure. |
Data | An SIOMM_DigitalEventConfigArea instance to configure the event reaction. |
int O22SnapIoMemMap::SetDigPtConfiguration | ( | int | nPoint, |
int | nPointType, | ||
int | nFeature | ||
) |
Configure a digital point.
This method does two things:
nPoint | Point 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. |
nPointType | Point type value. A digital output is type 0x180, an input is 0x100. |
nFeature | Feature to configure. |
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.
nPoint | Point 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. |
nState | 0 to turn counters off, non-zero to turn them on. |
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.
nPoint | Point 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. |
nState | Value to set for the digital point's state. |
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.
nMsg | Integer between 0 and 127 (inclusive) indicating which message slot to configure |
Data | An SIOMM_EventMsgConfigArea instance with the data needed to configure the event message |
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.
nModule | Which module the point to be written resides on. |
nPoint | Point number on the module to written to. |
nState | Value to set for the digital point's state. |
int O22SnapIoMemMap::SetPidLoopConfigurationEx | ( | int | nPid, |
SIOMM_PidLoopConfigArea | Data | ||
) |
Configure a PID (proportional/integral/derivative) loop to run on the I/O unit.
nPid | Which PID loop to configure. The number of available PID loops depends on the I/O unit. |
Data | A SIOMM_PidLoopConfigArea instance containing the PID loop configuration data you wish to set. |
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.
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to set configuration for. |
PtConfigData | SIOMM_PointConfigArea4 instance holding the configuration for this point |
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.
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to set configuration for. |
fFilterWeight | Filter weight value to set for the point. |
int O22SnapIoMemMap::SetPointGain | ( | int | nModule, |
int | nPoint, | ||
float | fGain | ||
) |
Set an analog point's gain value.
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to set configuration for. |
fGain | Filter weight value to set for the point. |
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.
nModule | Which module the point to be named resides on |
nPoint | Point number on the module to set a name for |
pchPointName | C-string holding the point's name |
int O22SnapIoMemMap::SetPointOffset | ( | int | nModule, |
int | nPoint, | ||
float | fOffset | ||
) |
Set an analog point's offset value
nModule | Which module the targeted resides on |
nPoint | Point number on the module to set the offset value for |
fOffset | Offset value to set on the point |
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.
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to set scaling values for |
fHiScale | High value to use for scaling |
fLoScale | Low value to use for scaling |
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.
nModule | Which module the targeted point resides on |
nPoint | Point number on the module to set watchdog parameters for |
fValue | Value to set the point to if communications fail |
nEnabled | Turn the watchdog on or off. 0 means off, non-zero means on. |
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.
nPoint | Point 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. |
Data | SIOMM_PointConfigArea instance filled out with the point's full configuration details. |
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.
nPoint | Point 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. |
Data | SIOMM_PointConfigArea2 instance filled out with the point's full configuration details. |
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.
nPoint | Point 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. |
Data | SIOMM_PointConfigArea3 instance filled out with the point's full configuration details. |
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.
nPoint | Point 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. |
fValue | Value to set the point to if communications fail |
nEnabled | Turn the watchdog on or off. 0 means off, non-zero means on. |
int O22SnapIoMemMap::SetScratchPadBitArea | ( | int | nBits63to32, |
int | nBits31to0 | ||
) |
Set the I/O unit's scratchpad bits area
nBits63to32 | Bitmask to set for bits 32-63 |
nBits31to0 | Bitmask to set for bits 0-31 |
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.
nOnMask63to32 | Bitmask of locations to set ON, bits 32-63 |
nOnMask31to0 | Bitmask of locations to set ON, bits 0-31 |
nOffMask63to32 | Bitmask of locations to set OFF, bits 32-63 |
nOffMask31to0 | Bitmask of locations to set OFF, bits 0-31 |
int O22SnapIoMemMap::SetScratchPadFloatArea | ( | int | nStartIndex, |
int | nLength, | ||
float * | pfData | ||
) |
Write to the I/O unit's float scratch pad area
nStartIndex | Index of the float scratchpad location to begin writing to |
nLength | Length (in float locations) of the data to write |
pfData | Pointer to a user-supplied buffer of data to write. Must be nLength * 4 bytes in length. |
int O22SnapIoMemMap::SetScratchPadInteger64Area | ( | int | nStartIndex, |
int | nLength, | ||
int * | pnData | ||
) |
Write to the I/O unit's 64-bit integer scratch pad area
nStartIndex | Index of the 64-bit integer scratchpad location to begin writing to |
nLength | Length (in integer locations) of the data to write |
pnData | Pointer to a user-supplied buffer of data to write. Must be nLength * 8 bytes in length. |
int O22SnapIoMemMap::SetScratchPadIntegerArea | ( | int | nStartIndex, |
int | nLength, | ||
int * | pnData | ||
) |
Write to the I/O unit's integer scratch pad area
nStartIndex | Index of the integer scratchpad location to begin writing to |
nLength | Length (in integer locations) of the data to write |
pnData | Pointer to a user-supplied buffer of data to write. Must be nLength * 4 bytes in length. |
int O22SnapIoMemMap::SetScratchPadStringArea | ( | int | nStartIndex, |
int | nLength, | ||
SIOMM_ScratchPadString * | pStringData | ||
) |
Write to the I/O unit's string scratch pad area
nStartIndex | Index of the string scratchpad location to begin reading from |
nLength | Length (in string locations) of the data to read |
pStringData | Array of SIOMM_ScratchPadString instances to write to the I/O units string scratchpad. Must be sizeof(SIOMM_ScratchPadString) * nLength bytes in length. |
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.
nEvent | Index of the serial event to configure |
Data | An SIOMM_SerialEventConfigArea instance to use to configure the serial reaction |
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.
nSerialPort | Which serial port to configure. See Appendix A - Serial Module Configuration - Read/Write for how port numbers are determined. |
ConfigData | SIOMM_SerialModuleConfigArea structure instance with the data to be written. |
int O22SnapIoMemMap::SetStatusBootpRequest | ( | int | nFlag | ) |
Set the I/O unit to send BootP or DHCP request when turned on.
Possible values for nFlag:
See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.
nFlag | BootP request flag. |
int O22SnapIoMemMap::SetStatusDegrees | ( | int | nDegFlag | ) |
Configure the I/O unit to report temperatures in degrees Celsius or degrees Fahrenheit
Possible values for nDegFlag:
See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.
nDegFlag | Option to set for reporting temperatures. |
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:
See Appendix A - Status Area Write in the OptoMMP Protocol Guide for additional details.
nOpCode | Opcode to write to the SIOMM_STATUS_WRITE_OPERATION location. |
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.
nTimeMS | Watchdog time in milliseconds. (Must be >= 0) |
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.
StatusWriteData | A SIOMM_StatusWrite structure holding the data to be written to the Status Write area. |
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.
nOnFlag | Whether or not streaming is enabled. 0 is off, non-zero is on. |
nIntervalMS | Streaming interval, in milliseconds |
nPort | IP port number to stream to |
nIoMirroringEnabled | Whether I/O mirroring is enabled. 0 is off, non-zero is on. |
nStartAddress | Beginning address of the data to be streamed |
nDataSize | Size of data to be streamed. Maximum size is 1480 bytes. |
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.
nTarget | Index of the streaming target to set the IP address for. (1-8) |
pchIpAddressArg | IP address to set as a dotted string (e.g. "1.2.3.4") |
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.
nEvent | Index of the timer event to configure |
Data | An SIOMM_TimerEventConfigArea instance used to configure the timer event |
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.
pbyReadBlockResponse | Response packet from the server |
pbyTransactionLabel | User supplied pointer to a uint8_t to hold the transaction label from the packet |
pbyResponseCode | User supplied pointer to a uint8_t to hold the response code from the packet. |
pwDataLength | User supplied pointer to a uint16_t to hold the length of the data in the response packet |
pbyBlockData | User supplied pointer to hold the data from the read request. |
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.
pbyWriteQuadletResponse | Response packet from the server. |
pbyTransactionLabel | User supplied pointer to a uint8_t to hold the transaction label from the packet |
pbyResponseCode | User supplied pointer to a uint8_t to hold the response code from the packet. |
int O22SnapIoMemMap::WriteBlock | ( | const uint32_t | dwDestOffset, |
const uint16_t | wDataLength, | ||
uint8_t * | pbyData | ||
) |
Writes a block of data to the I/O unit.
dwDestOffset | Memory map offset to write data to |
wDataLength | Length of memory to write (e.g. pbyData), in bytes |
pbyData | Data to write to the brain. |
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
dwDestOffset | Memory map offset to write data to |
wDataLength | Length of the array of float in pnData. (Not length in bytes). |
pfData | Array of floats to write to the I/O unit. |
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
dwDestOffset | Memory map offset to write data to |
wDataLength | Length of the array of integers in pnData. (Not length in bytes). |
pnData | Array of integers to write to the I/O unit. |
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
dwDestOffset | Memory map offset to write data to. |
fValue | Data to be written to the device. |
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
dwDestOffset | Memory map offset to write data to. |
dwQuadlet | Data to be written to the device. |