GX5961, GX5964, File
Programs the loop counter mode.
GtDio6xSequencerSetLoopCounterMode (nHandle, nCounter, nMode, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Session identifier:● Board handle is used when communicating with the hardware. The Board handle session identifier is returned by calling GtDio6xInitialize or GtDio6xSetupInitialization. ● File handle is used when communicating with a file. The File handle session identifier is returned by calling GtDio6xFileOpen. |
nCounter |
SHORT |
Used to set the loop counter to program (0-15)0. GTDIO6X_LOOP_COUNTER_0: Loop Counter 0. 1. GTDIO6X_LOOP_COUNTER_1: Loop Counter 1. 2. GTDIO6X_LOOP_COUNTER_2: Loop Counter 2. 3. GTDIO6X_LOOP_COUNTER_3: Loop Counter 3. 4. GTDIO6X_LOOP_COUNTER_4: Loop Counter 4. 5. GTDIO6X_LOOP_COUNTER_5: Loop Counter 5. 6. GTDIO6X_LOOP_COUNTER_6: Loop Counter 6. 7. GTDIO6X_LOOP_COUNTER_7: Loop Counter 7. 8. GTDIO6X_LOOP_COUNTER_8: Loop Counter 8. 9. GTDIO6X_LOOP_COUNTER_9: Loop Counter 9. 10. GTDIO6X_LOOP_COUNTER_10: Loop Counter 10. 11. GTDIO6X_LOOP_COUNTER_11: Loop Counter 11. 12. GTDIO6X_LOOP_COUNTER_12: Loop Counter 12. 13. GTDIO6X_LOOP_COUNTER_13: Loop Counter 13. 14. GTDIO6X_LOOP_COUNTER_14: Loop Counter 14. 15. GTDIO6X_LOOP_COUNTER_15: Loop Counter 15. 16. GTDIO6X_LOOP_COUNTER_ALL: Apply to all loop counters. |
nMode |
SHORT |
Used to set the loop counter mode:0. GTDIO6X_LOOP_COUNTER_RELOAD_ON_TERMINAL_COUNT: Reload on terminal count. 1. GTDIO6X_LOOP_COUNTER_DISABLE_ON_TERMINAL_COUNT: Disable on terminal count. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative value on failure. |
There are sixteen 16-bit loop counters. Each of the sixteen loop counters can be programmed to either reload its count or disable when the terminal count is reached.
For example, given the following sample loop sequence:
Step 1 Output vector 1 jump step 1 using LC0 count 2.
Step 2 Output vector 2 jump step 1 using LC1 count 3.
If both loop counters reload on terminal count, then the step order will be: 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2.
If counter 0 is set to disable, then the step order will be: 1, 1, 2, 1, 2, 1, 2, 1, 2.
The following example sets the loop counter 2 mode to reload on terminal count, and returns the settings:
SHORT nMode, nStatus;
GtDio6xSequencerSetLoopCounterMode(nHandle, GTDIO6X_LOOP_COUNTER_2, GTDIO6X_LOOP_COUNTER_RELOAD_ON_TERMINAL_COUNT, &nStatus);
GtDio6xSequencerGetLoopCounterMode(nHandle, GTDIO6X_LOOP_COUNTER_2, &nMode, &nStatus);
GtDio6xSequencerArm, GtDio6xSequencerArmIdleStep, GtDio6xSequencerHalt, GtDio6xSequencerReset, GtDio6xSequencerResume, GtDio6xSequencerRun, GtDio6xSequencerRunEx, GtDio6xSequencerRunIdleStep, GtDio6xSequencerSetBurstCount, GtDio6xSequencerSetChannelsCompareTrigger, GtDio6xSequencerSetRunCompletionMode, GtDio6xSequencerSetFreqSynth, GtDio6xSequencerSetHaltMode, GtDio6xSequencerSetIdleStep, GtDio6xSequencerSetMasterClockSource, GtDio6xSequencerSetRecordOffset, GtDio6xSequencerSetRecordParameters, GtDio6xSequencerSetStopMode, GtDio6xSequencerSetSyncPulseSource, GtDio6xSequencerSetSyncPulseParameters, GtDio6xSequencerSetSystemClockExternal, GtDio6xSequencerSetSystemClockSource, GtDio6xSequencerStop, GtDio6xGetErrorString