Spectrum Brands MC.31XX Starting without interrupt classic mode, Maximum posttrigger in MSamples

Page 48

Programming

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Standard acquisition modes

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Maximum posttrigger in MSamples

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ch0

 

ch1

 

ch2

 

ch3

 

ch4

 

ch5

 

ch6

 

ch7

 

3110

 

3111

 

3112

 

3120

 

3121

 

3122

 

3130

 

3131

 

3132

 

3140

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

128

 

128

 

128

 

128

 

128

 

128

 

128

 

128

 

128

 

128

 

 

x

 

x

 

 

 

 

 

 

 

 

 

 

 

 

 

64

 

64

 

64

 

64

 

64

 

64

 

64

 

64

 

64

 

64

 

 

x

 

 

 

 

 

 

 

x

 

 

 

 

 

 

 

n.a.

 

n.a.

 

128

 

n.a.

 

n.a.

 

128

 

n.a.

 

n.a.

 

128

 

n.a.

 

 

x

 

x

 

 

 

 

 

x

 

x

 

 

 

 

 

n.a.

 

n.a.

 

64

 

n.a.

 

n.a.

 

64

 

n.a.

 

n.a.

 

64

 

n.a.

 

 

x

 

x

 

x

 

x

 

 

 

 

 

 

 

 

 

n.a.

 

32

 

32

 

n.a.

 

32

 

32

 

n.a.

 

32

 

32

 

n.a.

 

 

x

 

x

 

x

 

x

 

x

 

x

 

x

 

x

 

n.a.

 

n.a.

 

32

 

n.a.

 

n.a.

 

32

 

n.a.

 

n.a.

 

32

 

n.a.

 

The amount of memory that can be either set for the used memsize and postcounter values can only be set by certain steps. These steps are results of the internal memory organization. For this reason these steps also define the minimum size for the data memory and the postcounter. The values depend on the number of activated channels and on the type of board being used. The minimum stepsizes for setting up the mem- size and the postcounter are shown in the table below.

Minimum memsize and posttrigger in samples

 

ch0

 

ch1

 

ch2

 

ch3

 

ch4

 

ch5

 

ch6

 

ch7

3110

3111

3112

3120

3121

3122

3130

3131

3132

3140

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x

 

 

 

 

 

 

 

 

 

 

 

 

 

 

32

32

32

32

32

32

32

32

32

32

 

x

 

x

 

 

 

 

 

 

 

 

 

 

 

 

16

16

16

16

16

16

16

16

16

16

 

x

 

 

 

 

 

 

 

x

 

 

 

 

 

 

n.a.

n.a.

32

n.a.

n.a.

32

n.a.

n.a.

32

n.a.

 

x

 

x

 

 

 

 

 

x

 

x

 

 

 

 

n.a.

n.a.

16

n.a.

n.a.

16

n.a.

n.a.

16

n.a.

 

x

 

x

 

x

 

x

 

 

 

 

 

 

 

 

n.a.

16

16

n.a.

16

16

n.a.

16

16

n.a.

 

x

 

x

 

x

 

x

 

x

 

x

 

x

 

x

n.a.

n.a.

16

n.a.

n.a.

16

n.a.

n.a.

16

n.a.

Stepsize of memsize and posttrigger in samples

 

 

 

 

 

 

 

 

ch0

 

ch1

 

ch2

 

ch3

 

ch4

 

ch5

 

ch6

 

ch7

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3110

3111

3112

3120

3121

3122

3130

3131

3132

3140

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

x

 

 

 

 

 

 

 

 

 

 

 

 

 

 

32

32

32

32

32

32

32

32

32

32

 

x

 

x

 

 

 

 

 

 

 

 

 

 

 

 

16

16

16

16

16

16

16

16

16

16

 

x

 

 

 

 

 

 

 

x

 

 

 

 

 

 

n.a.

n.a.

32

n.a.

n.a.

32

n.a.

n.a.

32

n.a.

 

x

 

x

 

 

 

 

 

x

 

x

 

 

 

 

n.a.

n.a.

16

n.a.

n.a.

16

n.a.

n.a.

16

n.a.

 

x

 

x

 

x

 

x

 

 

 

 

 

 

 

 

n.a.

8

8

n.a.

8

8

n.a.

8

8

n.a.

 

x

 

x

 

x

 

x

 

x

 

x

 

x

 

x

n.a.

n.a.

8

n.a.

n.a.

8

n.a.

n.a.

8

n.a.

Starting without interrupt (classic mode)

Command register

Register

Value

Direction

Description

SPC_COMMAND

0

r/w

Command register of the board.

 

SPC_START

10

Starts the board with the current register settings.

 

 

 

 

 

SPC_STOP

20

Stops the board manually.

In this mode the board is started by writing the SPC_START value to the command register. All settings like for example the size of memory and postcounter, the number of activated channels and the trigger settings must have been programmed before. If the start command has been given, the setup data is transferred to the board and the board will start.

If your board has relays to switch between different settings a programmed time will be waited to prevent having the influences of the relays settling time in the signal. For additional information please first see the chapter about the relay settling time. You can stop the board at any time with the command SPC_STOP. This command will stop immediately.

Once the board has been started, it is running totally independent from the host system. Your program has full CPU time to do any calculations or display. The status register shown in the table below shows the current status of the board. The most simple programming loop is simply waiting for the status SPC_READY. This status shows that the board has stopped automatically.

The read only status register can be read out at any time, but it is mostly used for polling on the board’s status after the board has been started. However polling the status will need CPU time.

48

MC.31xx Manual

Image 48
Contents MC.31xx English version April 27Page Hardware Installation Software Driver InstallationIntroduction SoftwareFifo Mode Programming the BoardAnalog Inputs Standard acquisition modesOption Multiple Recording Option Gated SamplingOption Timestamp Option Extra I/OIntroduction PrefaceGeneral Information PrefaceDifferent models of the MC.31xx series MC.3110 MC.3120 MC.3130 MC.3111 MC.3121 MC.3131Introduction MC.3112 MC.3122 MC.3132 Additional options Digital inputsExtra I/O Option -XMF Introduction Additional optionsStarhub TimestampSpectrum type plate Block diagram Technical Data Hardware informationDynamic Parameters Order informationIntroductionHardware information Order No DescriptionHardware Installation Installing the board in the systemSystem Requirements Installing a board with digital inputs/outputs Installing a board with extra I/O Option -XMFHardware Installation Installing multiple boards synchronized by starhub Mounting the wired boardsHooking up the boards Only use the included flat ribbon cablesInstalling multiple synchronized boards Software Driver Installation Interrupt SharingInterrupt Sharing Installation Software Driver Installation WindowsWindows Version controlDriver Update Windows Driver Update Software Driver Installation Windows XPWindows XP Software Driver Installation Windows NT Windows NTAdding boards to the Windows NT driver Linux OverviewInstalling the device Now it is possible to access the board using this deviceDriver info Automatic load of the driverSoftware Software OverviewFirst Test with SBench Software Overview++ Driver Interface Header filesMicrosoft Visual C++ Borland C++ BuilderOther Windows C/C++ compilers National Instruments LabWindows/CVIDriver functions Include DriversSoftware ++ Driver Interface Using the Driver under Linux Function SpcSetParamFunction SpcSetParam Function SpcSetData WindowsDelphi Pascal Programming Interface Type definitionInclude Driver ExamplesSoftware Visual Basic Programming Interface Visual Basic ExamplesVBA for Excel Examples Visual Basic Programming Interface Error handling Programming the BoardOverview Register tablesExample for error checking InitializationStarting the automatic initialization routine PCI RegisterInstalled memory Installed features and optionsHardware version Date of productionUsed interrupt line Used type of driverProgramming the Board Initialization Driver versionPowerdown and reset Example program for the board initializationSpcpcimemsize SpcpciserialnoAnalog Inputs Channel SelectionImportant note on channels selection Analog InputsChannel rerouting Rerouting information for moduleSPCCHROUTE0 SPCCHROUTE1Setting up the inputs Input rangesInput offset Register Value Direction Description Offset rangeAutomatical adjustment of the offset settings Overrange bitInput termination Spcadjautoadj Adjall Spcadjsave ADJUSER0Standard acquisition modes ProgrammingMemory, Pre- and Posttrigger Pretrigger = memsize posttriggerStarting without interrupt classic mode Command registerMaximum posttrigger in MSamples Minimum memsize and posttrigger in samplesStarting with interrupt driven mode Standard acquisition modes ProgrammingStatus register Normal mode Fast 8 bit mode201100 Enables the fast 8 bit mode Data organizationStandard mode Reading out the data with SpcGetDataValue ’start’ as a 32 bit integer value Value ’len’ as a 32 bit integer valueProgramming Fifo Mode General InformationBackground Fifo Read Speed LimitationsProgramming Fifo Mode Software BuffersTheoretical maximum sample rate PCI Bus Throughput 60040 Read out the number of available Fifo buffersFifo Mode Programming Buffer processingAnalog acquisition or generation boards Digital I/O 701x or 702x or pattern generator boardsExample Fifo acquisition mode Fifo acquisition exampleSpcfifostart SpcfifowaitSample format Clock generation Internally generated sample rateStandard internal sample rate Using plain quartz without PLL Maximum internal sample rate in MS/s normal modeExternal reference clock Clock generationExternal clocking Direct external clockMinimum external sample rate Maximum external samplerate in MS/sExternal clock with divider CHANNEL0 CHANNEL1 CHANNEL2 CHANNEL3Fifo Trigger modes and appendant registers General DescriptionSoftware trigger External TTL triggerExample on how to set up the board for positive TTL trigger Edge triggersTrigger modes and appendant registers Positive TTL triggerPulsewidth triggers Positive and negative TTL triggerTTL pulsewidth trigger for long High pulses TTL pulsewidth trigger for short High pulsesTTL pulsewidth trigger for long LOW pulses TTL pulsewidth trigger for short LOW pulsesSpctriggermode Tmttlhighlp SpcpulsewidthChannel Trigger Overview of the channel trigger registersSpctriggermode Tmchannel TmchxoffTriggerlevel Spctriggermode TmchorSPCTRIGGERMODE0 Tmchxoff SPCTRIGGERMODE2 TmchxoffReading out the number of possible trigger levels SPCTRIGGERMODE0 TmchxposSPCHIGHLEVEL0 Input ranges Triggerlevel ±50 mV ±100 mV ±200 mV ±500 mVDetailed description of the channel trigger modes Channel trigger on positive edgeChannel trigger on negative edge Channel trigger on positive and negative edgeChannel pulsewidth trigger for long positive pulses Channel pulsewidth trigger for long negative pulsesChannel pulsewidth trigger for short positive pulses Channel pulsewidth trigger for short negative pulsesTmchxposgsp Channel steepness trigger for flat positive pulses Channel steepness trigger for flat negative pulsesChannel steepness trigger for steep positive pulses Channel steepness trigger for steep negative pulsesChannel window trigger for entering signals Channel window trigger for leaving signalsChannel window trigger for long inner signals Channel window trigger for long outer signalsChannel window trigger for short inner signals Channel window trigger for short outer signalsStandard Mode When using Multiple Recording pretrigger is not availableOption Multiple Recording Recording modesResulting start delays Trigger modesOption Multiple RecordingSpcmemsize SpctriggermodeGeneral information and trigger delay Option Gated SamplingOption Gated Sampling SpcgateEnd of gate alignement Alignement samples per channelNumber of samples on gate signal Allowed trigger modesOption Gated SamplingTrigger modes External TTL edge triggerExample program Example program Option Gated SamplingChannel trigger Spctriggermode TmttlposStartReset mode Option TimestampTimestamp modes LimitsRefClock mode optional Functions for accessing the dataTimestamp Status Reading out timestamp dataData format SpcGetData nr, ch, start, len, dataSpctimestampcount Standard acquisition mode Example programsAcquisition with Multiple Recording Option Extra I/O Digital I/OsAnalog Outputs Channel directionProgramming example Programming example Option Extra I/OBit Standard Mode Digital Inputs enabled Option Digital inputsSample format SpcreaddigitalSynchronization Option Different synchronization optionsSynchronization with option cascading Synchronization with option starhubSetup order for the different synchronization options Set up the board parametersLet the master calculate it’s clocking Write Data to on-board memory output boards onlyExample for data writing Define the boards for trigger masterExample of board #2 set as trigger master 4a Define synchronization or triggerDefine the board for clock master Example board number 0 is clock masterDefine the remaining boards as clock slaves Arm the boards for synchronizationStart all of the trigger master boards Wait for the end of the measurementRead data from the on-board memory acquisition boards only Restarting the board for another synchronized runExample of Fifo buffer allocation 2a Write first data for output boardsSpcsyncmasterfifo SpcsyncslavefifoAdditions for synchronizing different boards General informationCalculating the clock dividers 20xx 30xx 31xx 40xx 45xx 60xx 61xx 70xx 72xxSetting up the clock divider Board type 3122 312040 MS/s Board type 3025 3131Resulting delays using different boards or speeds Delay in standard non Fifo modesDelay in Fifo mode Additions for equal boards with different sample ratesError Codes Error CodesError name Value hex Value dec Error description AppendixPin assignment of the multipin connector Extra I/O with external connectorOption -XMFOption Digital inputs Pin assignment of the multipin cable