| MIL 10 Reference
| Customize Help
| Save Settings

MsysIoCommandRegister



See also
Availability
Available in MIL-Lite
Available in MIL

Available on Windows
Available on Linux

Not supported on:
Not supported on Matrox CronosPlus
Not supported on Matrox GPU processing driver
Not supported on Matrox GigE Vision driver
Not supported on Matrox IEEE 1394 IIDC driver
Not supported on Matrox Iris GT
Not supported on Matrox Morphis
Not supported on Matrox Morphis QxT
Not supported on Matrox Orion HD
Not supported on Matrox Radient eCL
Not supported on Matrox Radient eV-CXP
Not supported on Matrox Solios eA/XA
Not supported on Matrox Solios ecl/xcl/ev-cl
Not supported on Matrox USB3 Vision driver (requires Update 19)
Not supported on Matrox Vio
Fully supported on:
Fully supported on Host system

For any information regarding a MIL system added during a MIL Update, see the MIL system’s release note

Not available on Matrox 4Sight-X
Not available on Matrox Supersight
Not available on Non-Matrox computer
Available on Matrox 4Sight GP
function map Function map
Examples
Synopsis
Add a command to change the state of a bit of the I/O command register at a specified time or counter value.
Syntax
MIL_INT MsysIoCommandRegister(
MIL_ID IoCmdListSysId, //in
MIL_INT64 Operation, //in
MIL_INT64 Reference, //in
MIL_DOUBLE DelayFromReference, //in
MIL_DOUBLE Duration, //in
MIL_INT64 BitToOperate, //in
void *CommandStatusPtr //out
)
Description

This function adds (registers) a command to the I/O command list to change the state of a specified bit of the I/O command register at a specified moment (time or counter value). To route the state of an I/O command register bit to an output signal, use MsysControl() with M_IO_SOURCE before you change the state of the bit.

When adding a command, you must specify when it must be executed. If the command list was allocated using MsysIoAlloc() with M_CLOCK, specify the time at which to execute the command in seconds after a specified reference time; otherwise, specify it in number of counter increments after a specified reference counter value. For example, if you want to execute a command 50 msecs after the moment MsysIoCommandRegister() is called, you would specify M_REFERENCE_VALUE_CURRENT as the reference time and 0.05 seconds as the amount of time after this reference time to execute the command.

When adding a command to change an I/O command register bit such that a pulse is generated on the associated signal, two commands are actually added; one command to transition the signal at the specified moment and one command to transition the signal back to its original state after the specified pulse duration. Note that if you want to specify the duration of the pulse in seconds, but MsysIoAlloc() with M_CLOCK is not set as the counter source, use a timer to generate the pulse and the I/O command list to trigger the timer (generation of the pulse); schedule an M_IMPULSE command instead and use the affected I/O command register bit as the trigger source of the timer.

Multiple commands can be scheduled to execute at the same time or counter value, as long as the commands are affecting different I/O command register bits. If a command has been registered with the I/O command list to affect a specific I/O command register bit, and you attempt to add a different command to affect the same bit at the same specified time or counter value, the original command will be overwritten.

[Matrox-4sight-GP]

This function is only available on Matrox 4Sight GPm.

Note that this function reference has not been updated for a MIL system added during a MIL update. Refer to the MIL system's release note to see which MIL system’s documentation you should use in its place and any possible differences.
Parameters
This function is not supported on the selected boards.
This function reference has not been updated for the selected MIL system. To show the content of this page, choose a second MIL system; refer to the MIL system's release note to see which MIL system’s documentation to choose and any possible differences.
Parameters
IoCmdListSysId

Specifies the identifier of the I/O command list in which to add a command.

Operation

Specifies the command to add to the I/O command list to change the state of the specified I/O command register bit. This parameter can be set to one of the following values:

function map For specifying the command to register
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_EDGE_FALLING

Specifies that the command will change the specified bit such that the associated signal will transition from high to low, if it is high.

a
Collapse M_EDGE_RISING

Specifies that the command will change the specified bit such that the associated signal will transition from low to high, if it is low.

a
Collapse M_IMPULSE

Specifies the command will change the specified bit such that the associated signal will produce the shortest possible active-high pulse on the specified I/O command list bit. An active-high pulse is a low-to-high signal transition followed by a high-to-low signal transition. Unlike M_PULSE_HIGH, the Duration parameter must be set to M_DEFAULT and a single command producing the shortest possible pulse is generated. This operation should not be output to external devices since it might be filtered out as noise. It can, however, be used to trigger internal hardware devices, such as timers.

(summarize)
a
Collapse M_NONE

Specifies no operation is performed. This operation can be used to cancel a command previously added to the I/O command list.

(summarize)
a
Collapse M_PULSE_HIGH

Specifies to add two commands to the I/O command list, an M_EDGE_RISING and an M_EDGE_FALLING command, to change the specified bit such that the associated signal will produce an active-high pulse. An active-high pulse is a low-to-high signal transition followed by a high-to-low signal transition; specify the length of the pulse using the Duration parameter. Note that if the signal is already high, it will remain high for the specified duration and then transition to low (unless a command is added to transition it to low earlier).

(summarize)
a
Collapse M_PULSE_LOW

Specifies to add two commands to the I/O command list, an M_EDGE_FALLING and an M_EDGE_RISING command, to change the specified bit such that the associated signal will produce an active-low pulse. An active-low pulse is a high-to-low signal transition followed by a low-to-high signal transition; specify the length of the pulse using the Duration parameter. Note that if the signal is already low, it will remain low for the specified duration and then transition to high (unless a command is added to transition it to high earlier).

(summarize)
a
Reference

Specifies the reference time or counter value to which the delay is added. This parameter can be set to one of the following values:

function map For specifying the reference timestamp
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_REFERENCE_VALUE_CURRENT

Specifies to schedule the command relative to the current moment (that is, the moment MsysIoCommandRegister() is called).

a
Collapse Value

Specifies the time or counter value relative to which to schedule the command. This is typically a previously inquired time or counter value. You can inquire the time or counter value at a specific moment during the execution of your program using MsysIoInquire() with M_REFERENCE_VALUE. Additionally, if using a latch that has previously saved the time or counter value upon a hardware event, you can inquire this using MsysIoInquire() with M_REFERENCE_LATCH_VALUE or within the scope of a system hook-handler function using MsysGetHookInfo() with M_REFERENCE_LATCH_VALUE.

(summarize)
a
DelayFromReference

Specifies the delay to add to the reference time or counter value; the sum of the two establishes the specific moment that the command is executed. If the I/O command list was allocated with M_CLOCK as the counter source, specify the delay in seconds. Otherwise, specify it in number of counter increments.

Duration

Specifies the duration of the pulse if the command specified with Operation is M_PULSE_HIGH or M_PULSE_LOW. If the I/O command list was allocated with M_CLOCK as the counter source, specify the delay in seconds. Otherwise, specify it in number of counter increments. When adding other types of commands, set this parameter to M_DEFAULT.

BitToOperate

Specifies the bit of the I/O command register to affect with the command. This parameter can be set to the following value:

function map For specifying the bit of the I/O command register to operate
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_IO_COMMAND_BITn

Specifies that the command must affect bit n of the I/O command register, where n can be a value of 0 to 7.

Note that, if you need to route the state of the bit to an auxiliary signal, use MsysControl() with M_IO_SOURCE before you change the state of the bit.

(summarize)
a
CommandStatusPtr

Specifies the address in which to write whether the command was successfully added to the list. You can set this parameter to M_NULL if this information is not required.

This parameter can return one of the following values:

function map For returning the status of the command registration
CollapseValue Description
MIL system-specific
tooltip (†)
Collapse M_NULL

Specifies that the function successfully scheduled the command.

a
Collapse M_INVALID

Specifies that the moment at which to execute the command had elapsed when the function was executed.

a
Collapse M_UNKNOWN

Specifies that the function encountered an error and could not schedule the command.

a
Return value
The returned value is M_NULL if the function successfully scheduled the command, M_INVALID if the moment at which to execute the command had elapsed when the function was executed, and M_UNKNOWN if the function encountered an error or if the CommandStatusPtr parameter was set to M_NULL.
Compilation information
Header Include mil.h.
Library Use mil.lib.
DLL Requires mil.dll.
EDGE FALLING EDGE RISING IMPULSE NONE PULSE HIGH PULSE LOW REFERENCE VALUE CURRENT IO COMMAND BITn NULL INVALID UNKNOWN