I don't know how to enable or disable channels via the DLL, or configure the threshold or the edges. I'm struggling with the dac0, dac1, etc in BOARDSETTING struct and pass it to the mcs6a using the RunCmd function of the DLL.
I made some tests for enabling and disabling channels via sending commands and found a few bugs in the software. The problem is mainly that the sweepmode parameter has to be changed as well as the active parameter for the respective channel. These bugs are now fixed, please download the actual software from our website. With the new software
(MCS6A Server version 1.76) you can do the following:
For enabling the STOP1 channel, send the commands:
For disabling the channel change active=1 into active=0.
The sweepmode parameter is changed automatically accordingly, there is no extra command necessary.
Concerning the dac0, dac1, ... parameters, the following conversion routines (in C) may help you:
WORD v2nimdac(double v)
if (v > 1.4999) f = 0;
else if (v < -1.4999) f = 16383;
else f = (WORD)(((1. - (v/1.5)) * 8192) + 0.5);
double nimdac2v(WORD nimdac)
nimdac &= 0x3fff;
return (1.5 * ( 1. - (((double)nimdac)/8192.)));
The v2nimdac calculates the dac value from the voltage, the nimdac2v is reverse function. Bit 14 and 15 describe the trigger edge as mentioned in the manual:
dac1=2664 ; (hex) dac1 value (STOP1)
; (bit 15,14) : 0=falling, 1=rising, 2=both, 3=both+CFT
If you look at the value 2664 (hex), the highest bits 14 and 15 are zero i.e. falling edge.
The hexadecimal number 2664h is in decimal 9828.
The corresponding voltage is 1.5 * (1. - 9828./8192) = -0.300 Volt.