DI SingleBuffered ExternalTrigger Synchronized with DO.
Downloads
Filename: dipatternsynchwithdo.zip
Requirements: View
Notice that input port begins to input data on the second falling edge of the clock. It ignores the first one. Therefore, if you wire directly from the output port to the input port to test it, you must do some data manipulation to align the values in the buffer.
In this program piBuffer is used as the output buffer, and piBuffer2 is used as the input buffer. The least significant byte of piBuffer(0) is used as the trigger. The most significant byte of piBuffer(0) will be read into the least significant byte of piBuffer2(0). Then, the least significant byte of piBuffer(1) will be read into the most significant byte of piBuffer(0). This process continues until the input port has read all the values specified by UlCounts2.
Be sure to output one more 16-bit value than you input, since the input port ignores the first byte. If you don't, the input port will wait for one more rising edge of the clock that it will never receive. Because the group size is 1, make ulCount 2 larger than ulCount2 (the 32HS only does 16-bit transfers).
EXAMPLES OF TASK TYPES:
BUF, NCH, HANDSHK, EXTTRIG, ASYNC
LIST OF KEY PARAMETERS:
iGroup, iGroupSize, iDir, iStartTrigON, ulCount, iResource, ulAlignIndex, ulRemaining
NOTE:
Since variables are hardcoded, there is no guarantee that this program will work for your configuration. This example is simply presented as a code snippet of how you can use NI-DAQ functions to perform a task.
LIST OF NI-DAQ FUNCTIONS USED IN THIS EXAMPLE:
DIG_Grp_Config, NIDAQErrorHandler, DIG_Block_PG_Config,
DIG_Trigger_Config, Align_DMA_Buffer, DIG_Block_In,
DIG_Block_Check, NIDAQYield, DIG_Block_Clear, DIG_Grp_Mode
NOTE: For further details on each NI-DAQ function, refer to the NI-DAQ Online Help (NIDAQPC.HLP).
I/O CONNECTIONS:
Connect your digital input signals to port 2. Connect the ground reference to the digital ground pin. Connect DIOA7 to ACK2. Connect REQ1 to REQ2. Refer to the hardware user manual for more I/O connection details.
For more information about how to run this example, refer to the NI-DAQ Examples Online Help (NIDAQEx.HLP).
Requirements
Filename: dipatternsynchwithdo.zip
Software Requirements
Language(s): Visual Basic .NET
Additional Software: Visual Basic 6.0
Hardware Requirements
Hardware Group: Digital I/O (DIO)
Driver: Traditional NI-DAQ (Legacy) 6.9.0
Reader Comments | Submit a comment »
Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
