![Rohde & Schwarz TS-PIO2 User Manual Download Page 53](http://html1.mh-extra.com/html/rohde-and-schwarz/ts-pio2/ts-pio2_user-manual_1477708053.webp)
Software
R&S
®
TS-PIO2
37
User Manual 1506.7208.12 ─ 06
static ViUInt16 s_digiStim[SAMPLE_COUNT];
static ViUInt16 s_digiResp[SAMPLE_COUNT];
static ViReal64 s_waveform[SAMPLE_COUNT];
static ViReal64 s_measResult[SAMPLE_COUNT];
int main (int argc, char *argv[])
{
ViSession vi;
ViStatus status;
ViReal64 result;
ViChar chName[5], ch1[8], ch2[8];
ViInt32 idx;
/*
open a session to the device driver. The resource descriptor
depends on the slot number of the module and must be adapted
to the target system.
*/
status = rspio2_InitWithOptions ("CAN0::0::2::7::INSTR",
VI_TRUE,
VI_TRUE,
"Simulate=0,RangeCheck=1",
&vi);
/* configure sample count and interval */
status = rspio2_ConfigureSampling (vi, SAMPLE_COUNT, SAMPLE_INTERVAL);
/* fill stimulus buffer */
for (idx = 0; idx < SAMPLE_COUNT; idx++)
{
s_digiStim[idx] = idx; /* counter */
s_waveform[idx] = idx * (10.0 / SAMPLE_COUNT); /* ramp */
}
/* upload samples */
status = rspio2_SetDigitalDynamicMemory (vi, SAMPLE_COUNT, s_digiStim);
status = rspio2_SetAnalogWaveformMemory (vi, SAMPLE_COUNT, s_waveform);
/* configure voltage mesurement at CH16 */
status = rspio2_ConfigureAnalogMeasurement (vi, "CH16", 14.0);
/* configure square wave generation on CH9 and CH10 */
status = rspio2_ConfigureSquareWave (vi, "GRP_C", 2000, 50);
/* generate trigger puls at XTO1 when output/acquisition sequence starts */
status = rspio2_ConfigureTriggerOutput (vi, RSPIO2_TRIG_MASK_XTO1,
Sample program R&S TS-PIO2