Class Io
Defined in File IOApi.h
Class Documentation
-
class Io
This class contains I/O functions.
Public Functions
-
Io(WMX3Api *f)
Constructor to initialize an object of this class. The device created by the WMX3Api object passed to this constructor is used to execute API functions. Also see Devices.
-
Io(const Io &src)
Copy constructor to initialize an object of this class based on an existing object of this class. Also see Copy Operators.
-
Io &operator=(const Io &src)
Copy assignment operator to initialize an object of this class based on an existing object of this class. Also see Copy Operators.
-
Io()
Constructor to initialize an object of this class with a self device. Also see Self Devices.
-
~Io()
Destructor for this class.
-
bool IsDeviceValid()
Return TRUE if this class object has access to a device, and FALSE otherwise. A device is required to execute most functions in this class. If this function returns FALSE, a device can be created by calling the CreateDevice function from the WMX3Api object that was passed to the constructor of this class.
Return TRUE if this class object has access to a device, and FALSE otherwise. A device is required to execute most functions in this class. If this function returns FALSE, a device can be created by calling the CreateDevice function from the WMX3Api object that was passed to the constructor of this class.
-
WMX3APIFUNC GetVersion(int *pMajorVersion, int *pMinorVersion, int *pRevisionVersion, int *pFixVersion)
Get the version of the module rtdll.
Get the version of the module rtdll.
- Parameters:
pMajorVersion – [out] The major version number.
pMinorVersion – [out] The minor version number.
pRevisionVersion – [out] The revision version number.
pFixVersion – [out] The fix version number.
-
WMX3APIFUNC SetOutBit(int addr, int bit, unsigned char data)
Set the value of an output bit.
Set the value of an output bit.
It is recommended to use SetOutBitEx for faster response.
Remark
- Parameters:
addr – [in] The byte address of the bit to set.
bit – [in] The bit address of the bit to set.
data – [in] The value to set the bit to.
-
WMX3APIFUNC SetOutByte(int addr, unsigned char data)
Set the value of an output byte.
Set the value of an output byte.
It is recommended to use SetOutByteEx for faster response.
Remark
- Parameters:
addr – [in] The address of the byte to set.
data – [in] The value to set the byte to.
-
WMX3APIFUNC SetOutBytes(int addr, int size, unsigned char *pData)
Set the value of multiple output bytes.
Set the value of multiple output bytes.
This function does not set the specified data atomically. If the data is read by another thread at the same time, partially updated data may be read.
Remark
It is recommended to use SetOutBytesEx for faster response.
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to set.
pData – [in] A pointer to a unsigned char array that contains the values to set the bytes to. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC SetOutBits(int *pAddr, int *pBit, unsigned char *pData, int count)
Set the value of multiple output bits.
Set the value of multiple output bits.
This function is equivalent to calling the SetOutBit function multiple times, but can be faster due to the reduced overhead. There is no limit to the number of bits that may be specified at once. pAddr[0], pBit[0], and pData[0] specify the first output bit to set, pAddr[1], pBit[1], and pData[1] specify the second output bit to set, and so on. The bits can be specified in any order.
Remark
It is recommended to use SetOutBitsEx for faster response.
- Parameters:
pAddr – [in] A pointer to an int array that contains the byte addresses of the output bits. The size of the array must be equal to the count parameter.
pBit – [in] A pointer to an int array that contains the bit addresses of the output bits. The size of the array must be equal to the count parameter.
pData – [in] A pointer to an unsigned char array that contains the values to set the bits to. The size of the array must be equal to the count parameter.
count – [in] The number of bits to set.
-
WMX3APIFUNC SetOutAnalogDataChar(int addr, char analogData)
Set the value of output analog data spanning one byte.
Set the value of output analog data spanning one byte.
This function sets one byte of the output address space to the specified char type analog data value.
Remark
It is recommended to use SetOutAnalogDataCharEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataUChar(int addr, unsigned char analogData)
Set the value of output analog data spanning one byte.
Set the value of output analog data spanning one byte.
This function sets one byte of the output address space to the specified unsigned char type analog data value.
Remark
It is recommended to use SetOutAnalogDataUCharEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataShort(int addr, short analogData)
Set the value of output analog data spanning two bytes.
Set the value of output analog data spanning two bytes.
This function sets two bytes of the output address space to the specified short type analog data value.
Remark
If the address of the data set by this function crosses the boundary of a multiple of 64 (addr is 63, 127, 191, 255, etc.), the data is not set atomically. In this case, if the data is read by another thread at the same time, partially updated data may be read.
It is recommended to use SetOutAnalogDataShortEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataUShort(int addr, unsigned short analogData)
Set the value of output analog data spanning two bytes.
Set the value of output analog data spanning two bytes.
This function sets two bytes of the output address space to the specified unsigned short type analog data value.
Remark
If the address of the data set by this function crosses the boundary of a multiple of 64 (addr is 63, 127, 191, 255, etc.), the data is not set atomically. In this case, if the data is read by another thread at the same time, partially updated data may be read.
It is recommended to use SetOutAnalogDataUShortEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataInt(int addr, int analogData)
Set the value of output analog data spanning four bytes.
Set the value of output analog data spanning four bytes.
This function sets four bytes of the output address space to the specified int type analog data value.
Remark
If the address of the data set by this function crosses the boundary of a multiple of 64 (addr is 61-63, 125-127, 189-191, 253-255, etc.), the data is not set atomically. In this case, if the data is read by another thread at the same time, partially updated data may be read.
It is recommended to use SetOutAnalogDataIntEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataUInt(int addr, unsigned int analogData)
Set the value of output analog data spanning four bytes.
Set the value of output analog data spanning four bytes.
This function sets four bytes of the output address space to the specified unsigned int type analog data value.
Remark
If the address of the data set by this function crosses the boundary of a multiple of 64 (addr is 61-63, 125-127, 189-191, 253-255, etc.), the data is not set atomically. In this case, if the data is read by another thread at the same time, partially updated data may be read.
It is recommended to use SetOutAnalogDataUIntEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutBitMaskMode(bool enable)
Set the bitmask mode of output.
Set the bitmask mode of output.
When the bitmask function is enabled, output operations using IoApi are only valid for bits for which the bitmask is enabled(1).
Remark
The default value for all bitmasks is enabled(1).
- Parameters:
enable – [in] If FALSE, bitmask mode is disabled. If TRUE, bitmask mode is enabled.
-
WMX3APIFUNC SetOutBitMaskBit(int addr, int bit, unsigned char data)
Set the bitmask of output bit.
Set the bitmask of output bit.
- Parameters:
addr – [in] The byte address of the bit to set.
bit – [in] The bit address of the bit to set.
data – [in] The value to set the bit to.
-
WMX3APIFUNC SetOutBitMaskByte(int addr, unsigned char data)
Set the bitmask of an output byte.
Set the bitmask of an output byte.
- Parameters:
addr – [in] The address of the byte to set.
data – [in] The value to set the byte to.
-
WMX3APIFUNC SetOutBitMaskBytes(int addr, int size, unsigned char *pData)
Set the bitmask of multiple output bytes.
Set the bitmask of multiple output bytes.
This function does not set the specified data atomically. If the data is read by another thread at the same time, partially updated data may be read.
Remark
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to set.
pData – [in] A pointer to a unsigned char array that contains the values to set the bytes to. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC SetOutBitMaskBits(int *pAddr, int *pBit, unsigned char *pData, int count)
Set the bitmask of multiple output bits.
Set the bitmask of multiple output bits.
This function is equivalent to calling the SetOutBitMaskBits function multiple times, but can be faster due to the reduced overhead. There is no limit to the number of bits that may be specified at once. pAddr[0], pBit[0], and pData[0] specify the first output bit to set, pAddr[1], pBit[1], and pData[1] specify the second output bit to set, and so on. The bits can be specified in any order.
Remark
- Parameters:
pAddr – [in] A pointer to an int array that contains the byte addresses of the output bits. The size of the array must be equal to the count parameter.
pBit – [in] A pointer to an int array that contains the bit addresses of the output bits. The size of the array must be equal to the count parameter.
pData – [in] A pointer to an unsigned char array that contains the values to set the bits to. The size of the array must be equal to the count parameter.
count – [in] The number of bits to set.
-
WMX3APIFUNC GetInBit(int addr, int bit, unsigned char *pData)
Get the value of an input bit.
Get the value of an input bit.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
Remark
It is recommended to use GetInBitEx for faster response.
- Parameters:
addr – [in] The byte address of the bit to get.
bit – [in] The bit address of the bit to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetInByte(int addr, unsigned char *pData)
Get the value of an input byte.
Get the value of an input byte.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
Remark
It is recommended to use GetInByteEx for faster response.
- Parameters:
addr – [in] The address of the byte to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetInBytes(int addr, int size, unsigned char *pData)
Get the value of multiple input bytes.
Get the value of multiple input bytes.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
Remark
This function does not read the specified data atomically. If the data is overwritten by another thread at the same time (for example, if a communication interrupt occurs), partially updated data may be read.
It is recommended to use GetInBytesEx for faster response.
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to get.
pData – [out] A pointer to a unsigned char array that will receive the data. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC GetInAnalogDataChar(int addr, char *pAnalogData)
Get the value of input analog data spanning one byte.
Get the value of input analog data spanning one byte.
This function reads one byte of the input address space and returns the data as a char type analog data value.
Remark
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
It is recommended to use GetInAnalogDataCharEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetInAnalogDataUChar(int addr, unsigned char *pAnalogData)
Get the value of input analog data spanning one byte.
Get the value of input analog data spanning one byte.
This function reads one byte of the input address space and returns the data as an unsigned char type analog data value.
Remark
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
It is recommended to use GetInAnalogDataUCharEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to an unsigned char that will receive the data.
-
WMX3APIFUNC GetInAnalogDataShort(int addr, short *pAnalogData)
Get the value of input analog data spanning two bytes.
Get the value of input analog data spanning two bytes.
This function reads two bytes of the input address space and returns the data as a short type analog data value.
Remark
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 63, 127, 191, 255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time (for example, if a communication interrupt occurs), partially updated data may be read.
It is recommended to use GetInAnalogDataShortEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a short that will receive the data.
-
WMX3APIFUNC GetInAnalogDataUShort(int addr, unsigned short *pAnalogData)
Get the value of input analog data spanning two bytes.
Get the value of input analog data spanning two bytes.
This function reads two bytes of the input address space and returns the data as an unsigned short type analog data value.
Remark
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 63, 127, 191, 255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time (for example, if a communication interrupt occurs), partially updated data may be read.
It is recommended to use GetInAnalogDataUShortEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to an unsigned short that will receive the data.
-
WMX3APIFUNC GetInAnalogDataInt(int addr, int *pAnalogData)
Get the value of input analog data spanning four bytes.
Get the value of input analog data spanning four bytes.
This function reads four bytes of the input address space and returns the data as an int type analog data value.
Remark
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 61-63, 125-127, 189-191, 253-255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time (for example, if a communication interrupt occurs), partially updated data may be read.
It is recommended to use GetInAnalogDataIntEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to an int that will receive the data.
-
WMX3APIFUNC GetInAnalogDataUInt(int addr, unsigned int *pAnalogData)
Get the value of input analog data spanning four bytes.
Get the value of input analog data spanning four bytes.
This function reads four bytes of the input address space and returns the data as an unsigned int type analog data value.
Remark
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 61-63, 125-127, 189-191, 253-255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time (for example, if a communication interrupt occurs), partially updated data may be read.
It is recommended to use GetInAnalogDataUIntEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to an unsigned int that will receive the data.
-
WMX3APIFUNC GetOutBit(int addr, int bit, unsigned char *pData)
Get the value of an output bit.
Get the value of an output bit.
It is recommended to use GetOutBitEx for faster response.
Remark
- Parameters:
addr – [in] The byte address of the bit to get.
bit – [in] The bit address of the bit to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetOutByte(int addr, unsigned char *pData)
Get the value of an output byte.
Get the value of an output byte.
It is recommended to use GetOutByteEx for faster response.
Remark
- Parameters:
addr – [in] The address of the byte to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetOutBytes(int addr, int size, unsigned char *pData)
Get the value of multiple output bytes.
Get the value of multiple output bytes.
This function does not read the specified data atomically. If the data is overwritten by another thread at the same time, partially updated data may be read.
Remark
It is recommended to use GetOutBytesEx for faster response.
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to get.
pData – [out] A pointer to a unsigned char array that will receive the data. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC GetOutAnalogDataChar(int addr, char *pAnalogData)
Get the value of output analog data spanning one byte.
Get the value of output analog data spanning one byte.
This function reads one byte of the output address space and returns the data as a char type analog data value.
Remark
It is recommended to use GetOutAnalogDataCharEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataUChar(int addr, unsigned char *pAnalogData)
Get the value of output analog data spanning one byte.
Get the value of output analog data spanning one byte.
This function reads one byte of the output address space and returns the data as an unsigned char type analog data value.
Remark
It is recommended to use GetOutAnalogDataUCharEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataShort(int addr, short *pAnalogData)
Get the value of output analog data spanning two bytes.
Get the value of output analog data spanning two bytes.
This function reads two bytes of the output address space and returns the data as a short type analog data value.
Remark
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 63, 127, 191, 255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time, partially updated data may be read.
It is recommended to use GetOutAnalogDataShortEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataUShort(int addr, unsigned short *pAnalogData)
Get the value of output analog data spanning two bytes.
Get the value of output analog data spanning two bytes.
This function reads two bytes of the output address space and returns the data as an unsigned short type analog data value.
Remark
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 63, 127, 191, 255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time, partially updated data may be read.
It is recommended to use GetOutAnalogDataUShortEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataInt(int addr, int *pAnalogData)
Get the value of output analog data spanning four bytes.
Get the value of output analog data spanning four bytes.
This function reads four bytes of the output address space and returns the data as an int type analog data value.
Remark
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 61-63, 125-127, 189-191, 253-255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time, partially updated data may be read.
It is recommended to use GetOutAnalogDataIntEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataUInt(int addr, unsigned int *pAnalogData)
Get the value of output analog data spanning four bytes.
Get the value of output analog data spanning four bytes.
This function reads four bytes of the output address space and returns the data as an unsigned int type analog data value.
Remark
If the address of the data read by this function crosses the boundary of a multiple of 64 (addr is 61-63, 125-127, 189-191, 253-255, etc.), the data is not read atomically. In this case, if the data is overwritten by another thread at the same time, partially updated data may be read.
It is recommended to use GetOutAnalogDataUIntEx for faster response.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutBitMaskMode(bool *pEnable)
Get the bitmask mode of output.
Get the bitmask mode of output.
When the bitmask function is enabled, output operations using IoApi are only valid for bits for which the bitmask is enabled(1).
Remark
The default value for all bitmasks is enabled(1).
- Parameters:
pEnable – [out] If FALSE, bitmask mode is disabled. If TRUE, bitmask mode is enabled.
-
WMX3APIFUNC GetOutBitMaskBit(int addr, int bit, unsigned char *pData)
Get the bitmask of an output bit.
Get the bitmask of an output bit.
- Parameters:
addr – [in] The byte address of the bit to get.
bit – [in] The bit address of the bit to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetOutBitMaskByte(int addr, unsigned char *pData)
Get the bitmask of an output byte.
Get the bitmask of an output byte.
- Parameters:
addr – [in] The address of the byte to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetOutBitMaskBytes(int addr, int size, unsigned char *pData)
Get the bitmask of multiple output bytes.
Get the bitmask of multiple output bytes.
This function does not read the specified data atomically. If the data is overwritten by another thread at the same time, partially updated data may be read.
Remark
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to get.
pData – [out] A pointer to a unsigned char array that will receive the data. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC SetOutBitEx(int addr, int bit, unsigned char data)
Set the value of an output bit.
Set the value of an output bit.
This function has a faster response time compared to SetOutBit.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the bit to set.
bit – [in] The bit address of the bit to set.
data – [in] The value to set the bit to.
-
WMX3APIFUNC SetOutByteEx(int addr, unsigned char data)
Set the value of an output byte.
Set the value of an output byte.
This function has a faster response time compared to SetOutByte.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The address of the byte to set.
data – [in] The value to set the byte to.
-
WMX3APIFUNC SetOutBytesEx(int addr, int size, unsigned char *pData)
Set the value of multiple output bytes.
Set the value of multiple output bytes.
This function has a faster response time compared to SetOutBytes.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to set.
pData – [in] A pointer to a unsigned char array that contains the values to set the bytes to. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC SetOutBitsEx(int *pAddr, int *pBit, unsigned char *pData, int count)
Set the value of multiple output bits.
Set the value of multiple output bits.
This function is equivalent to calling the SetOutBit function multiple times, but can be faster due to the reduced overhead. There is no limit to the number of bits that may be specified at once. pAddr[0], pBit[0], and pData[0] specify the first output bit to set, pAddr[1], pBit[1], and pData[1] specify the second output bit to set, and so on. The bits can be specified in any order.
Remark
This function has a faster response time compared to SetOutBits.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
pAddr – [in] A pointer to an int array that contains the byte addresses of the output bits. The size of the array must be equal to the count parameter.
pBit – [in] A pointer to an int array that contains the bit addresses of the output bits. The size of the array must be equal to the count parameter.
pData – [in] A pointer to an unsigned char array that contains the values to set the bits to. The size of the array must be equal to the count parameter.
count – [in] The number of bits to set.
-
WMX3APIFUNC SetOutAnalogDataCharEx(int addr, char analogData)
Set the value of output analog data spanning one byte.
Set the value of output analog data spanning one byte.
This function sets one byte of the output address space to the specified char type analog data value.
Remark
This function has a faster response time compared to SetOutAnalogDataChar.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataUCharEx(int addr, unsigned char analogData)
Set the value of output analog data spanning one byte.
Set the value of output analog data spanning one byte.
This function sets one byte of the output address space to the specified unsigned char type analog data value.
Remark
This function has a faster response time compared to SetOutAnalogDataUChar.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataShortEx(int addr, short analogData)
Set the value of output analog data spanning two bytes.
Set the value of output analog data spanning two bytes.
This function sets two bytes of the output address space to the specified short type analog data value.
Remark
This function has a faster response time compared to SetOutAnalogDataShort.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataUShortEx(int addr, unsigned short analogData)
Set the value of output analog data spanning two bytes.
Set the value of output analog data spanning two bytes.
This function sets two bytes of the output address space to the specified unsigned short type analog data value.
Remark
This function has a faster response time compared to SetOutAnalogDataUShort.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataIntEx(int addr, int analogData)
Set the value of output analog data spanning four bytes.
Set the value of output analog data spanning four bytes.
This function sets four bytes of the output address space to the specified int type analog data value.
Remark
This function has a faster response time compared to SetOutAnalogDataInt.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC SetOutAnalogDataUIntEx(int addr, unsigned int analogData)
Set the value of output analog data spanning four bytes.
Set the value of output analog data spanning four bytes.
This function sets four bytes of the output address space to the specified unsigned int type analog data value.
Remark
This function has a faster response time compared to SetOutAnalogDataUInt.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
analogData – [in] The value of the analog data to set the output bytes to.
-
WMX3APIFUNC GetInBitEx(int addr, int bit, unsigned char *pData)
Get the value of an input bit.
Get the value of an input bit.
This function has a faster response time compared to GetInBit.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the bit to get.
bit – [in] The bit address of the bit to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetInByteEx(int addr, unsigned char *pData)
Get the value of an input byte.
Get the value of an input byte.
This function has a faster response time compared to GetInByte.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The address of the byte to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetInBytesEx(int addr, int size, unsigned char *pData)
Get the value of multiple input bytes.
Get the value of multiple input bytes.
This function has a faster response time compared to GetInBytes.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to get.
pData – [out] A pointer to a unsigned char array that will receive the data. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC GetInAnalogDataCharEx(int addr, char *pAnalogData)
Get the value of input analog data spanning one byte.
Get the value of input analog data spanning one byte.
This function reads one byte of the input address space and returns the data as a char type analog data value.
Remark
This function has a faster response time compared to GetInAnalogDataChar.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetInAnalogDataUCharEx(int addr, unsigned char *pAnalogData)
Get the value of input analog data spanning one byte.
Get the value of input analog data spanning one byte.
This function reads one byte of the input address space and returns the data as an unsigned char type analog data value.
Remark
This function has a faster response time compared to GetInAnalogDataUChar.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetInAnalogDataShortEx(int addr, short *pAnalogData)
Get the value of input analog data spanning two bytes.
Get the value of input analog data spanning two bytes.
This function reads two bytes of the input address space and returns the data as a short type analog data value.
Remark
This function has a faster response time compared to GetInAnalogDataShort.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetInAnalogDataUShortEx(int addr, unsigned short *pAnalogData)
Get the value of input analog data spanning two bytes.
Get the value of input analog data spanning two bytes.
This function reads two bytes of the input address space and returns the data as an unsigned short type analog data value.
Remark
This function has a faster response time compared to GetInAnalogDataUShort.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetInAnalogDataIntEx(int addr, int *pAnalogData)
Get the value of input analog data spanning four bytes.
Get the value of input analog data spanning four bytes.
This function reads four bytes of the input address space and returns the data as an int type analog data value.
Remark
This function has a faster response time compared to GetInAnalogDataInt.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetInAnalogDataUIntEx(int addr, unsigned int *pAnalogData)
Get the value of input analog data spanning four bytes.
Get the value of input analog data spanning four bytes.
This function reads four bytes of the input address space and returns the data as an unsigned int type analog data value.
Remark
This function has a faster response time compared to GetInAnalogDataUInt.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
This function obtains the input data that was read by the engine during the most recent interrupt (communication cycle).
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutBitEx(int addr, int bit, unsigned char *pData)
Get the value of an output bit.
Get the value of an output bit.
This function has a faster response time compared to GetOutBit.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the bit to get.
bit – [in] The bit address of the bit to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetOutByteEx(int addr, unsigned char *pData)
Get the value of an output byte.
Get the value of an output byte.
This function has a faster response time compared to GetOutByte.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The address of the byte to get.
pData – [out] A pointer to a unsigned char that will receive the data.
-
WMX3APIFUNC GetOutBytesEx(int addr, int size, unsigned char *pData)
Get the value of multiple output bytes.
Get the value of multiple output bytes.
This function has a faster response time compared to GetOutBytes.
Remark
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to get.
pData – [out] A pointer to a unsigned char array that will receive the data. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC GetOutAnalogDataCharEx(int addr, char *pAnalogData)
Get the value of output analog data spanning one byte.
Get the value of output analog data spanning one byte.
This function reads one byte of the output address space and returns the data as a char type analog data value.
Remark
This function has a faster response time compared to GetOutAnalogDataChar.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataUCharEx(int addr, unsigned char *pAnalogData)
Get the value of output analog data spanning one byte.
Get the value of output analog data spanning one byte.
This function reads one byte of the output address space and returns the data as an unsigned char type analog data value.
Remark
This function has a faster response time compared to GetOutAnalogDataUChar.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataShortEx(int addr, short *pAnalogData)
Get the value of output analog data spanning two bytes.
Get the value of output analog data spanning two bytes.
This function reads two bytes of the output address space and returns the data as a short type analog data value.
Remark
This function has a faster response time compared to GetOutAnalogDataShort.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataUShortEx(int addr, unsigned short *pAnalogData)
Get the value of output analog data spanning two bytes.
Get the value of output analog data spanning two bytes.
This function reads two bytes of the output address space and returns the data as an unsigned short type analog data value.
Remark
This function has a faster response time compared to GetOutAnalogDataUShort.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataIntEx(int addr, int *pAnalogData)
Get the value of output analog data spanning four bytes.
Get the value of output analog data spanning four bytes.
This function reads four bytes of the output address space and returns the data as an int type analog data value.
Remark
This function has a faster response time compared to GetOutAnalogDataInt.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC GetOutAnalogDataUIntEx(int addr, unsigned int *pAnalogData)
Get the value of output analog data spanning four bytes.
Get the value of output analog data spanning four bytes.
This function reads four bytes of the output address space and returns the data as an unsigned int type analog data value.
Remark
This function has a faster response time compared to GetOutAnalogDataUInt.
Because of the difference in the data flow channel, this function cannot be called from an ApiBuffer.
- Parameters:
addr – [in] The byte address of the first byte of the analog data.
pAnalogData – [out] A pointer to a char that will receive the data.
-
WMX3APIFUNC SetInitialOutByte(int addr, unsigned char data, unsigned char enable)
Set the initial value of an output byte that is applied when communication is started.
Set the initial value of an output byte that is applied when communication is started.
This function sets the initial value of an output byte. The initial value is the value that the output byte is set to whenever communication with the servo network is started using the StartCommunication API function.
Remark
- Parameters:
addr – [in] The address of the byte to set.
data – [in] The value to set the byte to.
enable – [in] Set to 1 to enable the initial value of this output byte, and set to 0 to disable it. If the initial value is disabled, the output byte will not be changed when communication is started.
-
WMX3APIFUNC SetInitialOutBytes(int addr, int size, unsigned char *pData, unsigned char *pEnable)
Set the initial values of multiple output bytes that are applied when communication is started.
Set the initial values of multiple output bytes that are applied when communication is started.
This function sets the initial values of multiple output bytes. The initial values are the values that the output bytes are set to whenever communication with the servo network is started using the StartCommunication API function.
Remark
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to set.
pData – [in] A pointer to an unsigned char array that contains the values to set the bytes to. The size of the array must be greater than or equal to the size parameter.
pEnable – [in] A pointer to an unsigned char array that is used to enable or disable the initial value of each output byte. Set to 1 to enable the initial value of the corresponding output byte, and set to 0 to disable it. If the initial value is disabled, the output byte will not be changed when communication is started. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC GetInitialOutByte(int addr, unsigned char *pData, unsigned char *pEnable)
Get the initial value of an output byte that is applied when communication is started.
Get the initial value of an output byte that is applied when communication is started.
This function gets the initial value of an output byte. The initial value is the value that the output byte is set to whenever communication with the servo network is started using the StartCommunication API function.
Remark
- Parameters:
addr – [in] The address of the byte to get.
pData – [out] A pointer to a unsigned char that will receive the data.
pEnable – [out] A pointer to a unsigned char that will contain 1 if the initial value is set for the specified output byte, and 0 otherwise.
-
WMX3APIFUNC GetInitialOutBytes(int addr, int size, unsigned char *pData, unsigned char *pEnable)
Get the initial values of multiple output bytes that are applied when communication is started.
Get the initial values of multiple output bytes that are applied when communication is started.
This function gets the initial values of multiple output bytes. The initial values are the values that the output bytes are set to whenever communication with the servo network is started using the StartCommunication API function.
Remark
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to get.
pData – [out] A pointer to a unsigned char array that will receive the data. The size of the array must be greater than or equal to the size parameter.
pEnable – [out] A pointer to a unsigned char array. Each index will contain 1 if the initial value is set for the output byte corresponding to that index, and 0 otherwise. The size of the array must be greater than or equal to the size parameter.
-
WMX3APIFUNC GetInitialOutByteInterruptId(int addr, unsigned char *pInterruptId)
Get the ID of the interrupt (cyclic handler) that will set the initial value of the specified output byte.
Get the ID of the interrupt (cyclic handler) that will set the initial value of the specified output byte.
This function gets the ID of the interrupt (cyclic handler) that will set the initial value of the specified output byte. The specified output byte will be set to the configured value (if any) when communication is started for this interrupt.
Remark
- Parameters:
addr – [in] The address of the output byte to check.
pInterruptId – [out] A pointer to an unsigned char that will contain the ID of the interrupt that will set the initial value of the specified output byte.
-
WMX3APIFUNC GetInitialOutBytesInterruptId(int addr, int size, unsigned char *pInterruptId)
Get the IDs of the interrupts (cyclic handlers) that will set the initial values of the specified output bytes.
Get the IDs of the interrupts (cyclic handlers) that will set the initial values of the specified output bytes.
This function gets the IDs of the interrupts (cyclic handlers) that will set the initial values of the specified output bytes. Each specified output byte will be set to the configured value (if any) when communication is started for the associated interrupt.
Remark
- Parameters:
addr – [in] The byte address of the head byte.
size – [in] The number of bytes to check.
pInterruptId – [out] A pointer to an unsigned char array. Each index will contain the ID of the interrupt that will set the initial value of the specified output byte.
Public Static Functions
-
static WMX3APIFUNC ErrorToString(int errCode, char *pString, unsigned int size)
Get a string representation of the specified error code.
Get a string representation of the specified error code.
This function returns a string representation of the specified error code. The error code must be defined in the IOErrorCode enum or the ErrorCode enum in the WMX3Api.h header. All errors returned by functions in class Io will be defined in one of these enums. Errors returned by functions in other classes may not be defined in one of these enums, and when such errors are passed to this function, an ErrorCodeNotDefined error will be returned and pString will contain the string representation of this error.
Remark
If pString is too small to contain the entire string representation of the error code, pString will be set to an empty string. An array size of 256 characters will be enough to hold all string representations.
This function is static, and may be called without declaring an instance of the Io class or creating a device.
- Parameters:
errCode – [in] The error code to get the string representation of.
pString – [in] A char array that will contain the string representation of the error.
size – [in] The size of the char array in number of characters.
-
static WMX3APIFUNC ErrorToString(int errCode, wchar_t *pString, unsigned int size)
Get a string representation of the specified error code.
Get a string representation of the specified error code.
This function is a variation of ErrorToString that accepts a wchar_t array. Use this function when using Unicode character sets.
Remark
- Parameters:
errCode – [in] The error code to get the string representation of.
pString – [in] A wchar_t array that will contain the string representation of the error.
size – [in] The size of the wchar_t array in number of characters.
-
static WMX3APIFUNC ApiLogToString(unsigned char *pLogData, unsigned int logDataSize, char *pString, unsigned int size)
Get a string representation of the raw data of an API log.
Get a string representation of the raw data of an API log.
This function converts the raw data for one API function call that was extracted from the API log with the GetApiLogData function.
Remark
See also
- Parameters:
pLogData – [in] A char array containing the raw data.
logDataSize – [in] The size of the pLogData char array. This size must be equal to or greater than the size of the raw data.
pString – [out] A char array that will contain the string representation of the raw data of the API log.
size – [in] The size of the pString char array in number of characters.
-
static WMX3APIFUNC ApiLogToString(unsigned char *pLogData, unsigned int logDataSize, wchar_t *pString, unsigned int size)
Get a string representation of the raw data of an API log.
Get a string representation of the raw data of an API log.
This function is a variation of ApiLogToString that accepts a wchar_t array. Use this function when using Unicode character sets.
Remark
- Parameters:
pLogData – [in] A char array containing the raw data.
logDataSize – [in] The size of the char array. This size must be equal to or greater than the size of the raw data.
pString – [out] A wchar_t array that will contain the string representation of the raw data of the API log.
size – [out] The size of the pString wchar_t array in number of characters.
-
static WMX3APIFUNC GetLibVersion(int *pMajorVersion, int *pMinorVersion, int *pRevisionVersion, int *pFixVersion)
Get the version of the module library.
Get the version of the module library.
This function is static, and may be called without declaring an instance of this class or creating a device.
Remark
- Parameters:
pMajorVersion – [out] The major version number.
pMinorVersion – [out] The minor version number.
pRevisionVersion – [out] The revision version number.
pFixVersion – [out] The fix version number.
-
Io(WMX3Api *f)