Home

LabOne Programming Manual

image

Contents

1. fpf fe fe Sf SE A 3 fo fy f f f f f f_ Frequency Figure 2 5 Sweeper scanning modes Binary sweep scan 1 Table 2 2 Sweeper Output Values Name Type Unit Description timestamp uint64 Ticks Atimestamp that gets updated each timea new measurement point has been recorded by the sweeper divide by the device s clockbase to obtain seconds It is not part of the sweeper s measurement data and only relevant for intermediate reads of sweeper data before the current sweep has finished frequency double Hz The oscillator frequency for each measurement point for a frequency sweep this is the same as grid double Volts Demodulator x value double Volts Demodulator y value double VoltsRMS Demodulator R value LabOne Programming Manual Revision 31421 Zurich Instruments 28 2 2 Sweeper Module Name Type Unit Description phase double Radians Demodulator phase value auxin0 double Volts Auxiliary Input 1 value auxinl double Volts Auxiliary Input 2 value frequencystddev double Hz Standard deviation of the oscillator frequency xstddev double Volts Standard deviation of demodulator x value ystddev double Volts Standard deviation of demodulator y value rstddev double VoltsRMS Standard deviation of de
2. Z lValue ZI_LWARNING_GENERAL see ZIResul Type_en ZI_WARNING see ZIResult_enum ZI_LWARNING_BASE see ZlResult_en um um Z _WARNING_MAX see ZIResult_enum Z _WARNING_NOTFOUND see ZIResult_enum Z _WARNING_OVERFLOW see ZIResult_enum ZI_WARNING_UNDERRUN see ZIResult_enum ziCore Tips and Tricks 40 40 zoomFFT Module 30 31 t_enum see see see see see see see see NONE see ZIValueType_enum see see see see see LabOne Programming Manual Revision 31421 Zurich Instruments 355
3. the tree gt ZI LIST SETTINGSONLY 0x08 turns only nodes which are marked as settings Or combinations of flags might be used path path path Handle of the PID Advisor session Path string of the node handle Handle of the PID Advisor session Starts the pidAdvisor if not yet running handle Not applicable to this module handle Handle of the PID Advisor session LabOne Programming Manual Revision 31421 Zurich Instruments 67 3 5 LabOne Matlab API ziDAQ Command Reference oo le result oo AP dE ol oo le result oo de AP dE dE dE AP AP AAP AP dE AP AP OP AP AP AP CP OP AP AO AP AP P dE AP AP P P AP AP CP CP AP AO AP AP P P AP AP P P de oo le ao AP de AP oP oP AP AP oP oo le oe ZiDAQ read ZiDAQ finish ziDAQ clear ZiDAQ save error 4 Enables debug log and sets the debug level ziDAQ logOn Flags handle ziDAQ progress handle handle handle handle filename Debugging Functions debuglevel message LOG_ LOG_ LOG SET LOG SYNC _S LOG SYNC _S Read pidAdvisor data subset Returns 1 if the command is finished handle Handle of the PID Advisor session If the simulation is still ongoing only a of the data is returned handle ziDAQ setDebugLevel Debug level fatal 5 ziDAQ writeDebugLoqg severity error 4 Severity fatal 5
4. connectDevice ziDAQServer argl str arg2 str arg3 str arg4 gt None Connect with the data server to a specified device over the specified interface The device must be visible to the server If the device is already connected the call will be ignored The function will block until the device is connected and the device is ready to use This method is useful for UHF devices offering several communication interfaces argl Reference to the ziDAQServer class arg2 Device serial arg3 Device interface arg4 Optional interface parameters string connectDevice ziDAQServer argl str arg2 str arg3 gt None deviceSettings deviceSettings ziDAQServer argl long arg2 gt ziDeviceSettings Create a deviceSettings class This will start a thread for running an asynchronous deviceSettings argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms disconnect disconnect ziDAQServer argl gt None disconnectDevice disconnectDevice ziDAQServer argl str arg2 gt None Disconnect a device on the data server This function will return immediately The disconnection of the device may not yet finished argl Reference to the ziDAQServer class arg2 Device serial string of device to disconnect echoDevice echoDevice ziDAQServer argl str arg2 gt None Sends an echo command to a device and blocks until answer is received This is useful to flush all
5. AP JP AP AP oP cP AP oO handle Path string The default flag listing if the given node turns absolute turns only nodes which means the they are at the termost level of handle Subscribe to one or several nodes handle Unsubscribe from one or several nodes handle Handle of the PLL Advisor session greater than 65 deg for stable conditions pllAdvisor pmfreq int Output parameter Simulated phase margin frequency pllAdvisor q int Quality factor Currently not used pllAdvisor rate int PLL Advisor sampling rate of the PLL control loop pllAdvisor stable int Output parameter When 1 the PLL Advisor found a stable solution with the given settings When 0 revise your settings and rerun the PLL Advisor pllAdvisor targetbw int Requested PLL bandwidth Higher frequencies may need manual tuning Output parameter BW is smaller than the Target BW 1 indicates the simulated PLL timeout int64 Poll timeout in Creates a PLL Advisor class for simulating the PLL in the ms thread start set the command parameters then set the calculate parameter to start path flags int64 O gt ZI LIST NONE 0x00 returning a simple gt ZI LIST RECURSIVE 0x01 turns the nodes recursively gt ZI LIST ABSOLUTE 0x02 paths gt ZI LIST LEAFSONLY 0x04 that are leafs the tree gt ZI LIST SETTINGSONLY 0x08 turns only nodes which are marked as setting Or combinati
6. Z INFO SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred ZI ERROR LENGTH if the path s length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by bufferSize is too small for all elements Z ERROR OVERFLOW when a FIFO overflow occurred 7 _ERROR_COMMAND on an incorrect answer of the server _ZI_ERROR SERVER INTERNAL if an internal error occurred in Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved 7 _ERROR_TIMEOUT when communication timed out See Tree Listing for an example LabOne Programming Manual Revision 31421 Zurich Instruments 300 6 4 File Documentation See Also ziAPlUpdate LabOne Programming Manual Revision 31421 Zurich Instruments 301 6 4 File Documentation ziAPlUpdateDevices ZIResult_enum ziAPlUpdateDevices ZIConnection conn Search for the newly connected devices and update the tree This function forces the Data Server to search for newly connected devices and to connect to run them Parameters lin conn Pointer to ZIConnection Returns Z _INFO_SUCCESS See Also ziAPIListNodes LabOne Programming Manual Revision 31421 Zurich Instruments 302 6 4 File Documentation ziAPIConnectDevice ZIResult_enum ziAPIConnectDevice ZIConnection conn const char deviceSerial const char devicelnterface const char interfaceParams Connect
7. m Z ERROR _MUTEX LOCK Unable to lock mutex Z ERROR _MUTEX_UNLOCK Unable to unlock mutex Z ERROR THREAD START Unable to start thread LabOne Programming Manual Revision 31421 Zurich Instruments 281 6 4 File Documentation ZILERROR_THREAD_JOIN Unable to join thread ZI_ERROR_SOCKET_INIT Can t initialize socket m 7ZI_ERROR_SOCKET_CONNECT Unable to connect socket Z ERROR HOSTNAME Hostname not found ZI_ERROR_CONNECTION Connection invalid Z ERROR TIMEOUT Command timed out Z ERROR COMMAND Command internally failed ZI ERROR_SERVER_INTERNAL Command failed in server Z ERROR_LENGTH Provided Buffer length is too small Z ERROR FILE Can t open file or read from it Z ERROR_DUPLICATE There is already a similar entry Z ERROR_READONLY Attempt to set a read only node m ZI_ERROR_DEVICE_NOT_VISIBLE Device is not visible to the server m ZILERROR_DEVICE_IN_USE Device is already connected by a different server Z ERROR DEVICE INTERFACE Device does currently not support the specified interface ZI ERROR DEVICE CONNECTION TIMEOUT Device connection timeout ZI ERROR DEVICE DIFFERENT INTERFACE Device already connected over a different Interface ZI ERROR DEVICE NEEDS_FW_UPGRADE Device needs FW upgrade ZI ERROR _ZIEVENT_DATATYPE_MISMATCH LabOne Pro
8. LabOne Programming Manual Revision 31421 Zurich Instruments 208 6 3 Data Structure Documentation TreeChange Tree ByteArrayData ByteArray ScopeWave Wave LabOne Programming Manual Revision 31421 Zurich Instruments 209 6 3 Data Structure Documentation 6 3 8 struct Zl AuxInSample The structure used to hold data for a single auxiliary inputs sample include ziAPI h typedef struct ZIAuxInSample ZITimeStamp timeStamp double cho double chi ZIAuxInSample Data Fields 7 TimeStamp timeStamp The timestamp at which the values have been measured double chO Channel 0 voltage double ch1 Channel 1 voltage LabOne Programming Manual Revision 31421 Zurich Instruments 210 6 3 Data Structure Documentation 6 3 9 struct ZiIByteArray The structure used to hold an arbitrary array of bytes This is the version without timestamp used in API Level 1 compatibility mode include ziAPI h typedef struct ZIByteArray uint32 t length uint8 t bytes 0 ZIByteArray Data Fields uint32_tlength Length ofthe data readable from the Bytes field uint8_t bytes The data itself The array has the size given in length LabOne Programming Manual Revision 31421 Zurich Instruments 211 6 3 Data Structure Documentation 6 3 10 struct ZIByteArrayTS The structure used to hold an arbitrary array of bytes This is the same as ZIByteArray but with timestamp inclu
9. devicesettings path string Path where the settings files are to be located If not set the default settings location of the LabOne software is used path Path string flags int64 0 gt ZI LIST NONE 0x00 The default flag returning a simple devicesettings filename string The file to which the settings are to be saved loaded devicesettings command string The save load command to execute save Read device settings and save 5 to file 5 load Load settings from file and write to device read Read device settings only no save handle ziDAQ deviceSettings timeout int64 timeout Poll timeout in ms Creates a device settings class for saving loading device settings to from a file Before the thread start set the path 5 filename and command parameters To run the command use the 5 execute function 5 result ziDAQ listNodes handle path flags int64 01 LabOne Programming Manual Revision 31421 Zurich Instruments 63 3 5 LabOne Matlab API ziDAQ Command Reference listing if the given node int64 1 gt ZI LIST RECURSIVE 0x01 Returns the nodes recursively int64 2 gt ZI LIST ABSOLUTE 0x02 Returns absolute paths int64 4 gt ZI LIST LEAFSONLY 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree int64 8 gt ZI LIST SETTINGSONLY 0x08 Returns only nodes which are marked as setting Or combinati
10. handle Handle of the PID Advisor session Stop the PID Advisor module handle Handle of the PID Advisor session End the current PID Advisor thread handle Save the measured data to a file Handle of the PID Advisor session File name string without debuglevel status 6 severity status 6 trace 0 trace 0 inf message info l otherwise 0 Handle of the PID Advisor session Report the progress of the command with a number between 0 and 1 extension Oly debug 2 debug 2 Message to output to the log flags LOG_NONE SET DOUBLE INT BYTE SET SET Outputs message to the debug log filename T DOUBLE T INT my Di LOG_SYNC_SET_BYTE GET_DOUBLE LOG_ LOG_ LOG_ LOG_ LOG_ LOG m GE Fe GE GET p G GI INT BYTE _DE GET_DIO T_AUXIN OD LOG LISTNODES LOG SUBSCRIBE LOG UNSUBSCRI LOG GET AS EVENT LOG LOG POLL LOG filename LOG ST LOG ST LOG ST style BE UPDATE LOG POLL EVENT ALL Log file name TYLE TELNET 0 TYLE MATLAB 1 PYLE PYTHON 2 Log all messages sent to the ziServer for debugging if ena style 0x00000000 0x00000001 0x00000002 0x00000004 0x00000010 0x00000020 0x00000040 0x00000100 0x00000200 0x00000400 0x00001000 0x00002000 0x00004000 0x00010000 0x00020000 0x00040000 0x00080000 0x001
11. include lt stdlib h gt include lt stdio h gt include ziAPI h void GetSample ZIConnection Conn ZIResult_enum RetVal char ErrBuffer LabOne Programming Manual Revision 31421 Zurich Instruments 311 6 4 File Documentation ZIDIOSample DIOSample if RetVal ziAPIGetDIOSample Conn DEV1046 dios 0 output amp DIOSample ZI_INFO_SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf TS Sf bits 08x n float DIOSample timeStamp Jy DIOSample bits See Also ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 312 6 4 File Documentation ziAPIGetAuxInSample ZIResult_enum ziAPIGetAuxInSample ZIConnection conn const char path ZlAuxinSample value Paramet Returns gets the Auxln sample of the specified node This function retrieves the newest available AuxIn sample from the specified node The value first found is returned if more than one value is available a wildcard is used in the path This function is only applicable to nodes ending in AUXINS O 9 SAMPLE ers in conn Pointer to the ziConnection with which the Value should be retrieved lin path Path to the Node holding the value out value Pointer to an ZlAuxlnSample struct in which the value should be written Zl SUCCESS on success Z CO
12. include ziAPI h typedef struct DIOSample ziTimeStampType TimeStamp unsigned int Bits unsigned int Reserved DIOSample Data Fields zilimeStampType TimeStamp unsigned int Bits unsigned int Reserved LabOne Programming Manual Revision 31421 Zurich Instruments 271 6 4 File Documentation struct ByteArrayData The ByteArrayData struct holds data for the ZI_LDATA_BYTEARRAY data type Deprecated See Z ByteArray include ziAPI h typedef struct ByteArrayData unsigned int Len unsigned char Bytes 0 ByteArrayData Data Fields unsigned int Len unsigned char Bytes LabOne Programming Manual Revision 31421 Zurich Instruments 272 6 4 File Documentation struct ziEvent This struct holds event data forwarded by the Data Server Deprecated See ZlEvent include ziAPI h typedef struct ziEvent ziAPIDataType Type unsigned int Count unsigned char Path 256 union ziEvent Val Val unsigned char Data 0x400000 ziEvent Data Structures union ziEvent Val Data Fields ziAPIDataType Type unsigned int Count unsigned char Path union ziEvent Val Val unsigned char Data Detailed Description ziEvent is used to give out events like value changes or errors to the user Event handling functionality is provided by ziAPISubscribe and ziAPlUnSubscribe as well as ziAPIPollDataEx LabOne Programming Manual Revi
13. unsigned in unsigned in Bandwidth t ScopeChannel Scope channel of the represented data t TriggerChannel Trigger channel of the represented data t BWLimit limit flag unsigned int Count Count of samples short Data First wave data LabOne Programming Manual Revision 31421 Zurich Instruments 206 6 3 Data Structure Documentation 6 3 6 struct TreeChange The structure used to hold info about added or removed nodes This is the version without timestamp used in API v1 compatibility mode include ziAPI h typedef struct TreeChange uint32 t Action char Name 32 TreeChange Data Fields uint32_t Action field indicating which action occured on the tree A value of the ZlTreeAction_enum TREE_ACTION enum char Name Name of the Path that has been added removed or changed LabOne Programming Manual Revision 31421 Zurich Instruments 207 6 3 Data Structure Documentation 6 3 7 union ziEvent Val typedef union ziEvent Val void Void DemodSample SampleDemod AuxInSample SampleAuxIn DIOSample SampleDIO ziDoubleType Double ziIntegerType Integer a TreeChange m ree ByteArrayData ByteArray ScopeWave Wave ziEvent Val Data Fields void Void DemodSample SampleDemod AuxinSample SampleAuxin DlOSample SampleDIO ziDoubleType Double zilntegerType Integer
14. 1000 2000 3000 4000 5000 6000 7000 Frequency Hz 1 496e6 1000 2000 3000 4000 5000 6000 7000 Frequency Hz 1 496e6 Amplitude dBV scaled with Filter Figure 4 4 The plot produced by the LabOne Python API example example zoomfft py the plots show the results of an FFT performed with ziCore s zoomFFT module on demodulator output obtained over a simple feedback cable Exploring which Examples are available Python s help system can be used to see which examples are available for a particular device class when help is called on the module the available examples are listed under the Package Contents section For example for the zhinst examples common package LabOne Programming Manual Revision 31421 Zurich Instruments 76 4 2 Getting Started with the LabOne Python API gt gt gt help zhinst examples common Help on package zhinst examples common in zhinst examples NAME zhinst examples common Zurich Instruments LabOne Python API Examples for any instrument class FILE usr lib python2 7 dist packages zhinst examples common init py MODULE DOCS http does python org library zhinst examples common PACKAGE CONTENTS example connect example connect config example poll example record edge trigger example save device settings example save device settings expert example save device settings simple example sweeper example zoomfft DATA all example_connect example connect example c
15. DEV1046 demods rate 100 t ZI INFO SUCCESS ZiAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValueD Conn DEV1046 demods 0 rate amp ValueD ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n ValueD See Also ziAPISetValueD ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 148 6 2 Module Documentation ziAPIGetValuel ZIResult_enum ziAPIGetValuel ZIConnection conn const char path ZllntegerData value gets the integer type value ofthe specified node This function retrieves the numerical value of the specified node as an integer type value The value first found is returned if more than one value is available a wildcard is used in the path Parameters in conn Pointer to ZIConnection with which the value should be retrieved lin path Path to the node holding the value out value Pointer to an 64bit integer in which the value should be written Returns 7Z _INFO_SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred Z ERROR LENGTH if the path s length exceeds MAX_PATH_LEN Z _FRROR_OVERFLOW when a FIFO overflow occurred Z _FRROR COMMAND on an incorrect answ
16. SampleAuxln see ziEvent Val sampleCount see ZIPWAWave see ZIScopeWave SampleDemod see ziEvent Val SampleDIO see ziEvent Val sampleFormat see ZIScopeWave ScopeChannel see ScopeWave scopeWave see ZlEvent scopeWaveOld see ZlEvent segmentNumber see ZIScopeWave sequenceNumber see ZIScopeWave TimeStamp see AuxInSample see DemodSample see DIOSample data see ZlEvent see ZIPWAWave see timeStamp see ZlAuxlnSample see ZIScopeWave ZIByteArrayTS see ZlDemodSample see Data see ScopeWave see ziEvent ZIDIOSample see ZIDoubleDataTS see dataFloat see ZIScopeWave ZlintegerDataTS see ZIPWAWave see datalnt16 see ZIScopeWave ZIScopeWave see ZiTreeChangeData datalnt32 see ZIScopeWave totalSamples see ZIScopeWave dataTransferMode see ZIScopeWave Tree see ziEvent Val demodSample see ZIEvent treeChangeData see ZIEvent DIOBits see DemodSample treeChangeDataOld see ZIEvent dioBits see ZIDemodSample TREE _ ACTION 290 dioSample see ZIEvent TREE_ACTION_ADD see TREE_ACTION Double see ziEvent Val TREE_ACTION_CHANGE see TREE_ACTION doubleData see ZIEvent TREE_ACTION_REMOVE see TREE_ACTION LabOne Programming Manual Revision 31421 Zurich Instruments 353 trigger see ZIDemodSample TriggerChannel see ScopeWave triggerEnable see ZIScopeWave triggerInput see ZIScopeWave triggerTimeStamp see ZIScopeWave Type see ziEvent untyped see ZIEvent
17. use the value from sweep bandwidth 2 Automatic Note to use either Fixed or Manual mode sweep bandwidth must be set to a value gt 0 even though in manual mode it is ignored sweep bandwidth double Defines the measurement bandwidth for Fixed bandwidth selection and corresponds to the noise equivalent power bandwidth NEP sweep order uint64 Defines the filter roll off to use in Fixed bandwidth selection Valid values are between 1 6 dB octave and 8 48 dB octave sweep maxbandwidth double Specifies the maximum bandwidth used when in auto bandwidth mode sweep bandwidthcontrol 2 The default is 1 25MHz sweep omegasuppression double dB Damping of omega and 2omega components when in auto bandwidth mode sweep bandwidthcontrol 2 Default is 40dB in favor of sweep speed Use a higher value for strong offset values or 3omega measurement methods sweep loopcount uint64 The number of sweeps to perform sweep phaseunwrap bool Enable unwrapping of slowly changing phase evolutions around the 180 degree boundary sweep sincfilter bool Enables the sinc filter if the sweep frequency is below 50 Hz This will improve the sweep speed at low frequencies as omega components do not need to be suppressed by the normal low pass filter sweep scan uint64 Selects the scanning type O Sequential incremental scanning from start to stop value se
18. Sf X f Y f n float DemodSample timeStamp DemodSample x DemodSample Y See Also ziAPlGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 152 6 2 Module Documentation ziAPIGet DIOSample ZIResult_enum ziAPIGetDIOSample ZIConnection conn const char path ZIDIOSample value Paramet Returns Gets the Digital I O sample of the specified node This function retrieves the newest available DIO sample from the specified node The value first found is returned if more than one value is available a wildcard is used in the path This function is only applicable to nodes ending in DIOS O 9 INPUT ers lin conn Pointer to the ZIConnection with which the value should be retrieved lin path Path to the node holding the value out value Pointer toa ZIDIOSample struct in which the value should be written 7Z _INFO_SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred ZI ERROR LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z _ERROR_OVERFLOW when a FIFO overflow occurred Z ERROR COMMAND on an incorrect answer of the server Z ERROR SERVER INTERNAL if an internal error occurred in the Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved or no value is attach
19. Val see ziEvent value see ZIDoubleDataTS see ZiEvent see ZlintegerDataTS valueType see ZlEvent Void see ziEvent Val Wave see ziEvent Val X see DemodSample x see ZIDemodSample see ZIPWASample Y see DemodSample y see ZIDemodSample see ZIPWASample ziAPlAllocateEvent 339 ziAPlAllocateEventEx 192 331 ziAPlAsyncSetByteArray 172 330 ziAPlAsyncSetDoubleData 170 328 ziAPlAsyncSetintegerData 171 329 ziAPlConnect 130 293 ziAPlConnectDevice 143 303 ziAPIConnectEx 133 296 ziAPIDeallocateEvent 340 ziAP DeallocateEventEx 193 332 ziAPIDestroy 129 292 ziAPIDisconnect 131 294 ziAPIDisconnectDevice 144 304 ziAPlEchoDevice 169 327 ziAPlGetAuxInSample 155 313 ziAPIGetConnectionAPlLevel 135 298 ziAPlGetDemodSample 151 309 ziAPlGetDIOSample 153 311 ziAPlGetError 200 337 ziAPIGetRevision 136 299 ziAPlGetValueAsPollData 197 336 ziAPlGetValueAuxIn 175 344 ziAPlGetValueB 157 315 ziAPlGetValueD 147 305 ziAPlGetValueDIO 174 343 ziAPlGetValuel 149 307 ziAPlGetValueS 173 342 ziAPlInit 128 291 ziAPlListImplementations 132 295 ziAPlListNodes 140 300 ziAPIPollData 198 341 ziAPIPollDataEx 196 335 ziAPlSecondsTimeStamp 345 ziAPISetValueB 163 321 ziAPISetValueD 159 317 ziAPISetValuel 161 319 ziAPISubscribe 194 333 ziAPISync 168 326 ziAPISyncSetValueB 167 325 ziAPISyncSetValueD 165 323 ziAPISyncSetValuel 166 324 ziAPlUnSubscribe
20. ZIResult_enum ziAPIGetValueB ZIConnection conn const char path unsigned char buffer unsigned int length unsigned int bufferSize gets the Bytearray value of the specified node This function retrieves the newest available DIO sample from the specified node The value first found is returned if more than one value is available a wildcard is used in the path Parameters Returns in conn Pointer to the ziConnection with which the value should be retrieved lin path Path to the Node holding the value out buffer Pointer to a buffer to store the retrieved data in out length Pointer to an unsigned int to store the length of data in if an error ocurred or the length of the passed buffer dosn t reach a zero will be returned lin bufferSize The length of the passed buffer m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no value is attached to the node 7 _TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include
21. avoid memory leaks ziOpen vi demods O sample ziGetValueDem a SS demods D sample ziOpen vi jodSample vi ziClose vi Wy Computer Km Y vimns Using shiftregisters for data objects avoids memory allocation and runnin the garbage collector too often N My Computer 4 elia alu E edk 10pt Application Font MESEM de Figure 5 6 Examples of simple LabVIEW programs for the Zurich Instruments HF2 Series Left A well implemented loop Right An example for loop gone wrong LabOne Programming Manual Revision 31421 Zurich Instruments 121 Chapter 6 C Programming The LabOne C API also known as ziAPI provides a simple and robust way to communicate with the Data Server It enables you to get or set parameters and receive streaming data LabOne Programming Manual Revision 31421 Zurich Instruments 122 6 1 Getting Started 6 1 Getting Started After installing the LabOne software package and relevant drivers for your instrument you are ready start programming with ziAPI All you need is aC compiler linker and editor The structure of a program using ziAPI can be split into three parts initialization connection data manipulation and disconnection cleanup The basic object that is always used is the ziConnection data structure First ziConnection is has to be initialized by calling ziAPlInit After initiali
22. class ziDeviceSettings Boost Python instance Method resolution order ziDeviceSettings Boost Python instance __builtin__ object Methods defined here __reduce__ lt unnamed Boost Python function gt clear clear ziDeviceSettings argl gt None End the deviceSettings thread execute execute ziDeviceSettings argl gt None Execute the save loadcommand finish finish ziDeviceSettings argl gt None Stop the load save command The command may be restarted by calling execute again finished finished ziDeviceSettings argl gt bool Check if the command execution has finished Returns True if finished get get ziDeviceSettings argl str arg2 bool arg3 gt object Return a dict with all nodes from the specified sub tree argl Reference to the ziDAQDeviceSettings class arg2 Path string of the node Use wild card to select all arg3 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False get ziDeviceSettings argl str arg2 gt object listNodes listNodes ziDeviceSettings argl str arg2 int arg3 gt list This function returns a list of node names found at the specified path argl Reference to the pyDeviceSettings class arg2 Path for which the nodes should be listed The path may contain wildcards so that the returned nodes do not necessarily have to ha
23. f8 f8 u4 8 8 ZICONTROL NAMES t x y freq dio auxin0 auxinl chunk u8 timestamp u8 x f8 Grustz Tasty TES ys LEE TEST PES TUAN SAE as 1 1 4 4 3 Help for ziPython s ziDAQServer class gt gt gt help zhinst ziPython ziDAOServer Help on class ziDAQServer in zhinst ziPython zhinst ziPython ziDAQServer class ziDAQServer Boost Python instance Class to connect with the instrument server of Zurich Instruments Method resolution order ziDAQServer Boost Python instance __builtin__ object Methods defined here init _ init _ object argl gt None _ init object argl str arg2 int arg3 gt None Connect to the server by using host address and port number argl Reference to the ziDAQServer class LabOne Programming Manual Revision 31421 Zurich Instruments 86 4 4 LabOne Python API ziPython Command Reference arg2 Host string e g 127 0 0 1 for localhost arg3 Port number e g 8004 for the ziDataServer _ init object argl str arg2 int arg3 int arg4 gt None Connect to the server by using host address and port number argl Reference to the ziDAQServer class arg2 Host string e g 127 0 0 1 for localhost arg3 Port number e g 8004 for the ziDataServer arg4 API level number __reduce__ lt unnamed Boost Python function gt connect connect ziDAQServer argl gt None connectDevice
24. uint32_t harmonic Harmonic setting uint32_t binCount Bin count of the PWA double frequency Frequency during PWA accumulation uint8_t pwalype Type of the PWA uint8_t mode PWA Mode 0 zoom PWA 1 harmonic PWA uint8_t overflow Overflow indicators overflow 0 Data accumulator overflow overflow 1 Counter at limit overflow 6 2 Reserved overflow 7 Invalid missing frames uint8_t commensurable Commensurability of the data uint32_t reservedUInt Reserved unsigned int ZIPWASample data PWA data vector LabOne Programming Manual Revision 31421 Zurich Instruments 232 6 3 Data Structure Documentation 6 3 19 struct ZIScopeWave The structure used to hold scope data The data may be formatted differently depending on settings See the description of the structure members for details include ziAPI h typedef struct ZIScopeWave ZITimeStamp timeStamp ZITimeStamp triggerTimeStamp double dt uint8 t channelEnable 4 uint8 t channelInput 4 uint8 t triggerEnable uint8 t triggerInput uint8 t reserved0 2 uint8 t channelBWLimit 4 uint8 t channelMath 4 float channelScaling 4 uint32 t sequenceNumber uint32 t segmentNumber uint32 t blockNumber uint64 t totalSamples uint8 t dataTransferMode uint8 t blockMarker uint8 t flags uint8 t sampleFormat uint32 t LabOne Programming Manual Revision 3142
25. uint32_t sequenceNumber Current scope shot sequence number Identifies a scope shot uint32_t segmentNumber Current segment number uint32_t blockNumber Current block number from the beginning of a scope shot Large scope shots are split into blocks which need to be concatenated to obtain the complete scope shot uint64_ttotalSamples Total number of samples in one channel in the current scope shot same for all channels uint8_tdatalransferMode Data transfer mode SingleTransfer 0 BlockTransfer 1 ContinuousTransfer 3 FFTSingleTransfer 4 Other values are reserved uint8_t blockMarker Block marker Bit 0 1 End marker for continuous or multi block transfer Bit 7 0 Reserved uint8_t flags Indicator Flags Bit 0 1 Data loss detected samples are 0 Bit 1 1 Missed trigger Bit 2 1 Transfer failure corrupted data uint8_t sampleFormat Data format of samples Int16 0 Int32 1 Float 2 Int16Interleaved 4 Int32Interleaved 5 Floatinterleaved 6 uint32_tsampleCount Number of samples in one channel in the current block same for all channels int16_t datalnt16 int32_t datalnt32 float dataFloat union ZIScopeWave 0 data First wave data LabOne Programming Manual Revision 31421 Zurich Instruments 235 6 3 Data Structure Documentation 6 3 20 struct ZITreeChangeData The struct is holding info about added
26. ziDAQ get path path Path string Gets a structure of the node data from the specified branch High speed streaming nodes e g devN demods 0 sample are not returned Wildcards may be used in which case read only nodes are ignored Zi DAO flush Flush all data in the socket connection and API buffers Call this function before a subscribe with subsequent poll to get rid of old streaming data that might still be in the buffers de de dE AP AP AP AP P AP AP AP OP CP P X AP AP OO ZiDAQ echoDevice device device device string e g dev100 Sends an echo command to a device and blocks until answer is received This is useful to flush all buffers between API and device to enforce that further code is only executed after the device executed a previous command ZiDAQ sync Synchronize all data path Ensures that get and poll commands return data which was recorded after the setting changes in front of the sync command This sync command replaces the functionality of all syncSet flush and echoDevice commands ziDAQ programRT device filename device device string e g dev100 filename filename of RT program Writes down the RT program To use this function the RT option must be available for the specified device AP de de W AP AP AP AP AP AP AP OP OP AP AP AP AP OP P AP AP P P de result ziDAQ secondsTimeStamp timestamps timestamps vector of uint64 ticks Deprecated In or
27. 6 auxinO 7 auxin1 trigger N type uint64 z The trigger type see Table 2 5 Note For the pulse trigger type there is a subtle difference between the way the trigger level and the hysteresis are used for positive negative pulse triggering trigger N edge 1 or 2 and both trigger N edge 3 The difference can be seen in Figure 2 9 and Figure 2 10 LabOne Programming Manual Revision 31421 Zurich Instruments 36 2 5 Device Settings Module 2 5 Device Settings Module The Device Settings Module provides functionality for saving and loading device settings to and from file The file is saved in XML format In general users are recommended to use the utility functions provided by the APIs instead of using the Device Settings module directly The Matlab API provides ziSaveSettings and ziLoadSettings and the Python API provides zhinst utils save_settings and zhinst utils load settings These are convenient wrappers to the Device Settings module for loading settings asynchronously i e these functions block until loading or saving has completed the desired behavior in most cases Advanced users can use the Device Settings module directly if they need to implement loading or saving a synchronously non blocking See Table 2 7 for the input parameters to configure the Device Settings Module Table 2 7 Device Settings Input Parameters Setting Path Type Description devicesettings device byte array The device ID
28. More recent versions of libstdc are readily available in Linux distributions telling Matlab to use this one instead doesn t have any negative side effects since the standard C library is backwards compatible We proceed as following a Locate the version of libstdc available within your Linux distribution for example on Ubuntu 12 04 LTS the location and versions are usr lib i386 linux gnu libstdctt so 6 0 16 82 bit usr lib x86 64 linux gnu libstdct so 6 0 16 64 bit Note Version 6 0 11 or higher is required by ziDAg b Append this path to the LD PRELOAD environment variable export LD PRELOAD LD_PRELOAD path to libstdc so 6 0 2 2 Restart Matlab if necessary LabOne Prog ramming Manual Revision 31421 Zurich Instruments 44 3 1 Installing the LabOne Matlab API 3 1 4 Verifying Successful Matlab Configuration In order to verify that Matlab is correctly configured to use ziDAQ please perform the following steps 1 Ensure that the correct Data Server is running for your device and that your device is currently connected to the Data Server The quickest way to check is to start the User Interface for your device see Section 1 1 for more details 2 Check that ziDAQ s connect command can instantiate an API session to the Data Server by using the following command with the correct port for your instrument cf Section 1 1 1 in the Matlab command window m gt gt ziDAQ connect
29. Python 70 112 Built in help 75 Command reference 80 zhinst package 80 zhinst s utility functions 80 ziDAQRecorder class 102 ziDAQServer class 86 ziDAQSweeper class 95 ziDAQZoomFFT class 99 ziDeviceSettings class 92 ziPidAdvisor class 109 ziPllAdvisor class 106 Comparison to other interfaces 9 Contents of the API package 75 Examples running 75 Exploring the available examples 76 Getting started 75 Help accessing 75 Installing the API 71 Linux 73 Windows 72 Loading data in Python 79 Locating the zhinst installation 77 Modules 77 Modules configuring 77 Recommended python packages for ziPython 71 Reference 80 Requirements for using ziPython 71 Running examples 75 Tips and tricks 79 S Software Trigger Module 32 36 Sweeper Module 21 29 Bandwidth control 22 Measurement data 22 Measurement data averaging 23 Scanning mode 21 Settling time 22 Settling time definition 22 Sweep parameter 21 LabOne Programming Manual Revision 31421 Zurich Instruments 352 Sweep range 21 Synchronous commands 20 U UHF Leaf 16 Z ziAPI Comparison to other interfaces 9 ziAPI C API functions and data types Action see TreeChange action see ZlTreeChangeData AuxInO see DemodSample auxIn0 see ZIDemodSample AuxIn1 see DemodSample auxin1 see ZIDemodSample auxlnSample see ZIEvent binCount see ZIPWAWave binPhase see ZIPWASample Bits see DIOSample bits see ZIDIOSample
30. The device name of the path can be omitted and is given by sweep device sweep loopcount int Number of sweep loops default 1 sweep endless int Sweep endless default 0 0 endless off use loopcount 1 endless on ignore loopcount sweep samplecount int Number of samples per sweep sweep settling time double Settling time before measurement is performed sweep settling tc double Settling time in time constant units 5 low precision 15 medium precision 50 high precision sweep settling inaccuracy int Demodulator filter settling inaccuracy defining the wait time between a sweep parameter change and recording of the next sweep point Typical inaccuracy values 10m for highest sweep speed for large signals 100u for precise amplitude measurements 100n for precise noise measurements Depending on the order the settling accuracy will define the number of filter time constants the sweeper has to wait The maximum between this value and the settling time is taken as wait time until the next sweep point is recorded sweep xmapping int Sweep mode 0 linear 1 logarithmic sweep scan int Scan type 0 sequential 1 binary 2 bidirectional 3 reverse sweep bandwidth double Fixed bandwidth Hz 0 Automatic calculation sweep bandwidthcontrol int Sets the bandwidth control mode default 2 0 Manual user sets bandwidth and order 1 Fixed uses fixed bandwidth value 2 Auto calculates best bandw
31. The structure used to hold data for a single digital I O sample include ziAPI h typedef struct ZIDIOSample ZITimeStamp timeStamp uint32 t DIES uint32 t reserved ZIDIOSample Data Fields 7 TimeStamp timeStamp The timestamp at which the values have been measured uint32_tbits The digital I O values uint32_t reserved Filler to keep 8 bytes alignment in the array of ZIDIOSample structures LabOne Programming Manual Revision 31421 Zurich Instruments 252 6 4 File Documentation struct ZIByteArray The structure used to hold an arbitrary array of bytes This is the version without timestamp used in API Level 1 compatibility mode include ziAPI h typedef struct ZIByteArray uint32 t length uint8 t bytes 0 ZIByteArray Data Fields uint32_t length Length of the data readable from the Bytes field uint8_t bytes The data itself The array has the size given in length LabOne Programming Manual Revision 31421 Zurich Instruments 253 6 4 File Documentation struct ZIByteArrayTS The structure used to hold an arbitrary array of bytes This is the same as ZIByteArray but with timestamp include ziAPI h typedef struct ZIByteArrayTS ZITimeStamp timeStamp uint32 t length uint8 t bytes 0 ZIByteArrayTS Data Fields nl ZITimeStamp timeStamp Time stamp at which the data was updated uint32_tlength length of the data readable from t
32. argl Reference to the ziDAQRecorder class arg2 File name string without extension Setec set ziDAQRecorder argl str arg2 float arg3 gt None Trigger Parameters Path name Type Description trigger buffersize double Overwrite the buffersize s of the trigger object set when it was instantiated Recommended buffer size is 2 trigger 0 duration The device ID to execute the software trigger e g dev123 compulsory parameter Enable endless triggering 1 enable 0 disable Force a trigger The path to the demod sample to trigger on e g demods 3 sample see also trigger 0 source Signal that is used to trigger on 0 x X_SOURCE 1 y Y_SOURCE 2 r R_SOURCE 3 angle ANGLE SOURCE 4 frequency FREQUENCY SOURCE 5 phase PHASE SOURCE 6 auxiliary input 0 AUXINO SOURCE 7 auxiliary input 1 AUXIN1 SOURCE Number of trigger edges to record Trigger type used Some parameters are only valid for special trigger types 0 trigger off analog edge trigger on source digital trigger mode on DIO analog pulse trigger on source analog tracking trigger on source rigger edge rising edge falling edge both Automatically find the value of trigger 0 level based on the current signal value Digital trigger condition Bit masking for bits used for triggering Used for digital trigger WNHRHBPWNE Trigger frame position s left side relative to trigg
33. const char path ZllntegerData value gets the integer type value of the specified node ziResult_enum ziAPlGetDemodSample ZIConnection conn const char path ZIDemodSample value Gets the demodulator sample value of the specified node ziResult_enum ziAPIGetDIOSample ZIConnection conn const char path ZIDIOSample value Gets the Digital I O sample of the specified node Z Result enum ziAPIGetAuxlnSample ZIConnection conn const char path ZlAuxInSample value gets the Auxln sample of the specified node Z Result enum ziAPIGetValueB ZIConnection conn const char path unsigned char buffer unsigned int length unsigned int bufferSize gets the Bytearray value of the specified node Z Result_ enum ziAPISetValueD ZIConnection conn const char path ZIDoubleData value asynchronously sets a double type value to one or more nodes specified in the path ziResult_enum ziAPISetValuel ZIConnection conn const char path ZllntegerData value asynchronously sets an integer type value to one or more nodes specified in a path Z Result_ enum ziAPISetValueB ZIConnection conn const char path unsigned char buffer unsigned int length asynchronously sets the binary type value of one ore more nodes specified in the path Z Result enum ziAPISyncSetValueD ZIConnection conn const char path ZIDoubleData value synchronously sets a double type value to one or more nodes specified inthe pat
34. const char implementation Connects to Data Server and enables extended ZiAPI With apiLevel ZI_API_VERSION_1 and implementation NULL this call is equivalent to plain ziAPlConnect With other version and implementation values enables corresponding ziAPI extension and connection using different implementation ers lin conn Pointer to the ZIConnection with which the connection should be established in hostname Name of the host to which it should be connected if NULL localhost will be used as default lin port The number of the port to connect to If O the port of the local Data Server will be used lin apiLevel Specifies the ziAP compatibility level to use for this connection 1 or 4 lin implementation Specifies implementation to use for a connection must be one of the returned by ziAPIListImplementations or NULL to select default implementation Returns ZI INFO SUCCESS on success Z _ERROR_HOSTNAME if the given host name could not be found Z _FRROR_SOCKET_CONNECT if no connection could be established Z _FRROR_OVERFLOW when a FIFO overflow occurred ZI _FRROR_SOCKET_INIT if initialization of the socket failed Z ERROR CONNECTION when the Data Server didn t return the correct answer or requested implementation is not found or doesn t support requested ziAPI level 7 _ERROR_TIMEOUT when initial communication timed out See Also ziAPlListImplementations ziAPIConnect ziAPIDiscon
35. const char path Z DoubleData value gets the double type value of the specified node This function retrieves the numerical value of the specified node as an double type value The value first found is returned if more than one value is available a wildcard is used in the path Parameters in conn Pointer to ZIConnection with which the value should be retrieved lin path Path to the node holding the value out value Pointer to a double in which the value should be written Returns 7Z _INFO_SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred Z ERROR LENGTH if the path s length exceeds MAX_PATH_LEN Z _FRROR_OVERFLOW when a FIFO overflow occurred Z _FRROR COMMAND on an incorrect answer of the server 7 _ERROR_SERVER_INTERNAL if an internal error occurred in Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved or no value is attached to the node Z ERROR TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIDoubleData ValueD if RetVal ziAPISetValuel Conn LabOne Programming Manual Revision 31421 Zurich Instruments 305 6 4 File Documentation DEV1046 demods rate 100 ZI INFO SUCCESS ziAPIGetError RetVal amp Err
36. handle Stop the sweep The sweep may be restarted by calling execute again ziDAQ clear handle handle Handle of the sweep session Stop the current sweep LabOne Programming Manual Revision 31421 Zurich Instruments 61 3 5 LabOne Matlab API ziDAQ Command Reference ZiDAQ save handle Save the measured data to a file handle Handle of the sweep session filename File in which to store the data Zoom FFT Module Zoom FFT Parameters zoomFFT device string Device that should be used for the zoom FFT e g dev99 zoomFFT bit int Number of FFT points 2 bit zoomFFT mode int Zoom FFT mode 0 Perform FFT on X iY 1 Perform FFT on R 2 Perform FFT on Phase zoomFFT loopcount int Number of zoom FFT loops default 1 zoomFFT endless int Perform endless zoom FFT default 0 0 Use loopcount value 1 Endless zoom FFT enabled ignore loopcount zoomFFT overlap double FFT overlap 0 none 0 1 zoomFFT settling time double Settling time before measurement is performed zoomFFT settling tc double Settling time in time constant units before the FFT recording is started 5 low precision 15 medium precision 50 high precision de de dE AP AP AP AP P AP AP AP P CP AO DO AP AP OO zoomFFT window int FFT window default 1 Hann 0 Rectangular 1 Hann 2 Hamming 3 Blackman Harris 4 term zoomFFT absolute bool Shifts the frequencies so that the center frequency b
37. is accessed as following x data device 0 0 demods 0 1 sample 0 0 x 0 load_settings daq device filename Load a LabOne settings file to the specified device This function is synchronous it will block until loading the settings has finished Arguments daq instance of ziDAQServer A ziPython API session device str The device ID specifying where to load the settings e g dev123 filename str The filename of the xml settings file to load The filename can include a relative or full path Raises RunTimeError If loading the settings times out Examples import zhinst utils as utils daq utils autoConnect dev utils autoDetect daq Then e g load settings from a file in the current directory LabOne Programming Manual Revision 31421 Zurich Instruments 84 4 4 LabOne Python API ziPython Command Reference utils load_settings daq dev my_settings xml Then e g load settings from the default LabOne settings path filename default_ui xml path utils get default settings path daq utils load_settings daq dev path os sep filename load zicontrol csv filename column_names t x y freq dio auxinO auxinl Load a CSV file containing demodulator samples as saved by the ziControl User Interface into a numpy structured array Arguments filename str The file or filename of the CSV file to load column names list or tuple of st
38. scopeWaveOld when valueType ZILVALUE_TYPE_SCOPE_WAVE_OLD ZIPWAWave pwaWave when valueType ZILVALUE_TYPE_PWA_WAVE union ZlEvent 1 value Convenience pointer to allow for access to the first entry in Data using the correct type according to ZlEvent valueType field uint8_t data The raw value data Detailed Description ZIEvent is used to give out events like value changes or errors to the user Event handling functionality is provided by ziAPISubscribe and ziAPlUnSubscribe as well as ziAPIPollDataEx include lt stdio h gt include ziAPI h void ProcessEvent zIEvent Event unsigned int j switch Event gt valueType LabOne Programming Manual Revision 31421 Zurich Instruments 182 6 2 Module Documentation case ZI VALUE TYPE DOUBLE DATA printf Su elements of double data s n Event gt count Event gt path for j 0 j lt Event gt count 7 jtt printf Sf n Event gt value doubleData 3 break case ZI VALUE TYPE INTEGER DATA printf Su elements of integer data s n Event gt count Event gt path for j 0 j lt Event gt count 7 tt printf f n float Event gt value integerData 1319 break case ZI VALUE TYPE DEMOD SAMPLE printf Su elements of sample data s n Event gt count r Event gt path 7 for j 0 j lt Event gt count jtt printf
39. value synchronously sets an integer type value to one or more nodes specified in a path ZiResult_enum ziAPISyncSetValueB ZIConnection conn const char path uint8_t buffer uint32_t length uint32_t bufferSize Synchronously sets the binary type value of one ore more nodes specified in the path ziResult_enum ziAPISync ZIConnection conn Synchronizes the session by dropping all pending data 7l Result_enum ziAPlEchoDevice ZIConnection conn const char deviceSerial Sends an echo command to a device and blocks until answer is received zlResult_enum ziAPlAsyncSetDoubleData ZIConnection conn const char path ZIDoubleData value 7 Result_enum ziAPlAsyncSetintegerData ZIConnection conn const char path ZlintegerData value zlResult_enum ziAPlAsyncSetByteArray ZIConnection conn const char path uint8_t buffer uint32_t length 7l Event ziAPIAllocateEventEx Allocates ZlEvent structure and returns the pointer to it Attention It is the client code responsibility to deallocate the structure by calling ziAPIDeallocateEventEx void ziAP DeallocateEventEx ZlEvent ev Deallocates ZIEvent structure created with ziAPlAllocateEventEx 7 Result_enum ziAPISubscribe ZIConnection conn const char path subscribes the nodes given by path for ziAPIPollDataEx LabOne Programming Manual Revision 31421 Zurich Instruments 242 6 4 File Documentation 7l Result_enum ziAPlUnSu
40. y break case ZI VALUE TYPE TREE CHANGE DATA printf Su elements of tree changed data s n Event gt count Event gt path for j 0 j lt Event gt count a jtt switch Event gt value treeChangeDataold j Action case ZI_TREE_ACTION_REMOV GI printf Tree removed s n Event gt value treeChangeDataold jd Name break case ZI_TREE_ACTION_ADD printf treeChangeDataOld added s n Event gt value treeChangeData0ld j LabOne Programming Manual Revision 31421 Zurich Instruments 227 6 3 Data Structure Documentation Name break case ZI TREE ACTION CHANGE printf treeChangeDataOld changed s n Event gt value treeChangeDataold jl Name break break default printf Unexpected event value type d n Event gt valueType break See Also ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx LabOne Programming Manual Revision 31421 Zurich Instruments 228 6 3 Data Structure Documentation 6 3 16 struct ZllntegerDataTS The structure used to hold a single 64bit signed integer value Same as ZllntegerData but with timestamp include ziAPI h typedef struct ZIIntegerDataTS ZITimeStamp timeStamp ZIIntegerData value ZIIntegerDataTS Data Fields 7 TimeStamp timeStamp Time stamp at which the value has changed ZilntegerData value LabOne Programming Manual Re
41. 2 Module Documentation ziAPlAsyncSetDoubleData ZIResult_enum ziAPlAsyncSetDoubleData ZIConnection conn const char path ZIDoubleData value LabOne Programming Manual Revision 31421 Zurich Instruments 170 6 2 Module Documentation ziAPlAsyncSetintegerData ZIResult_enum ziAPlAsyncSetIntegerData ZIConnection conn const char path ZiintegerData value LabOne Programming Manual Revision 31421 Zurich Instruments 171 6 2 Module Documentation ziAPlAsyncSetByteArray ZIResult_enum ziAPlAsyncSetByteArray ZIConnection conn const char path uint8_t buffer uint32_t length LabOne Programming Manual Revision 31421 Zurich Instruments 172 6 2 Module Documentation ziAPIGetValueS ZlResult_enum ziAPIGetValueS ZIConnection conn char path DemodSample value LabOne Programming Manual Revision 31421 Zurich Instruments 173 6 2 Module Documentation ziAPIGetValueDIO ZlResult_enum ziAPIGetValueDIO ZIConnection conn char path DIOSample value LabOne Programming Manual Revision 31421 Zurich Instruments 174 6 2 Module Documentation ziAPIGetValueAuxIn ZlResult_enum ziAPIGetValueAuxin ZIConnection conn char path AuxlnSample value LabOne Programming Manual Revision 31421 Zurich Instruments 175 6 2 Module Documentation 6 2 4 Data Streaming This section describes how to perform data streaming It allows for recording at high data rates without sample loss Da
42. 3 3 LabOne Matlab API Tips and Tricks 3 3 LabOne Matlab API Tips and Tricks In this section some tips and tricks for working with the LabOne Matlab API are provided The structure of ziDAQ commands All LabOne Matlab API commands are based on a call to the Matlab function ziDAQ The first argument to ziDAQ specifies the API command to be executed and is an obligatory argument For example a session is instantiated between the API and the Data Server with the Matlab command ziDAQ connect Depending on the type of command specified optional arguments may be required For example to obtain an integer node value the node path must be specified as a second argument to the getInt command s ziDAQ getInt dev123 sigouts 0 on where the output argument contains the current value of the specified node To set an integer node value both the node path and the value to be set must be specified as the second and third arguments ziDAQ setInt dev123 sigouts 0 on 1 See the LabOne Matlab API ziDAQ Command Reference for a list of all available commands Data Structures returned by ziDAQ The output arguments that ziDAQ returns are designed to use the native data structures that Matlab users are familiar with and that reflect the data s location in the instruments node hierarchy For example when the poll command returns data from the instruments fourth demodulator located in the node hierarchy as dev123 demods 3 s
43. 4 File Documentation void PrintVersion ZIConnection Conn ZIResult enum RetVal char ErrBuffer const char Path ZI ABOUT VERSION unsigned char Buffer Oxff unsigned int Length if RetVal ziAPIGetValueB Conn Path Buffer amp Length sizeof Buffer 1 ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get value s n ErrBuffer else Buffer Length 0 printf Ss Ss n Path Buffer See Also ziAPISetValueB ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 316 6 4 File Documentation ziAPISetValueD ZlResult_enum ziAPISetValueD ZIConnection conn const char path ZIDoubleData value Paramet Returns asynchronously sets a double type value to one or more nodes specified in the path This function sets the values of the nodes specified in path to Value More than one value can be set if a wildcard is used The function sets the value asynchronously which means that after the function returns you have no security to which value it is finally set nor at what point in time it is set ers lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set to Value lin value the double type value that will be written to the node s m Zl SUCCESS on success Z CONNECTION when the co
44. 6 4 File Documentation ziAPISubscribe ZlResult_enum ziAPISubscribe ZIConnection conn const char path subscribes the nodes given by path for ziAPIPollDataEx This function subscribes to nodes so that whenever the value of the node changes the new value can be polled using ziAPIPollDataEx By using wildcards or by using a path that is not a leaf node but contains sub nodes more than one leaf can be subscribed to with one function call Parameters lin conn Pointer to the ziConnection for which to subscribe for lin path Path to the nodes to subscribe Returns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values Zl TIMEOUT when communication timed out See Data Handling for an example See Also ziAPIUnSubscribe ziAPIPollDataEx ziAPlGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 333 6 4 File Documentation ziAPIUnSubscribe ZlResult_enum ziAPIUnSubscribe ZIConnection conn const char path unsubscribes to the nodes given by path This function is the complement to ziAPIS
45. Direct Digital Synthesis Dynamic Host Configuration Protocol Digital Input Output Domain Name Server Digital Signal Processor Device Under Test The measure of a lock in amplifier s capability to withstand the disturbing signals and noise at non reference frequencies while maintaining the specified measurement accuracy within the signal bandwidth Extensible Markup Language See Also XML Fast Fourier Transform First In First Out Frequency Modulation Measure of an instrument s ability to faithfully indicate the correct frequency versus a traceable standard AFM mode where the frequency change between drive and measured signal encodes the topography or the measured AFM variable See Also Atomic Force Microscope LabOne Programming Manual Revision 31421 Zurich Instruments 347 Frequency Response Analyzer FRA Frequency Sweeper G Gain Phase Meter GPIB GUI I O Impedance Spectroscope IS Input Amplitude Accuracy IAA Input voltage noise IVN IP L LAN LED Lock in Amplifier LI LIA M Media Access Control address MAC address Multi frequency MF Instrument capable to stimulate a device under test and plot the frequency response over a selectable frequency range with a fine granularity See Also Frequency Response Analyzer See Also Vector Network Analyzer General Purpose Interface Bus Graphical User Interface Input Output Instrument suited to stimulate a dev
46. Matlab API Section 3 2 for help Getting Started with the LabOne Matlab API and Running the Examples Section 3 3 for some LabOne Matlab API Tips and Tricks Section 3 4 for help Troubleshooting the LabOne Matlab API Section 3 5 for LabOne Matlab API ziDAQ Command Reference Note This section and the provided examples are no substitute for a Matlab tutorial See either Mathworks online Documentation Center or one of the many online resources for example the Matlab Programming wikibook for help to get started programming with Matlab LabOne Programming Manual Revision 31421 Zurich Instruments 42 3 1 Installing the LabOne Matlab API 3 1 Installing the LabOne Matlab API 3 1 1 Requirements To use LabOne s Matlab API ziDAQ a Matlab 7 R2009b installation or higher and license on Windows or Linux is required No additional Matlab Toolboxes are required for zi DAQ Both 32 bit and 64 bit platforms are supported on both Windows and Linux On Linux version 6 0 11 or higher of libstdct so is required by ziDAQ see Section 3 1 3 for more details The LabOne Matlab API ziDAQ is included in a standard LabOne installation Some configuration is required however inorder to use ziDAQin Matlab The LabOne installer is available from Zurich Instruments download page login required 3 1 2 Windows or Linux Technically no installation is required to use ziDAQ on either Windows or Linux it s only necessary to add t
47. The utilities package zhinst utils contains several routines to help loading csv or mat files saved from either the LabOne User Interface or ziControl into Python These functions are generally minimal wrappers around NumPy genfromtxt or SciPy loadmat routines However the function load labone demod_csv is optimized to load demodulator data saved in csv format by the LabOne UI since it specifies the csv columns dtypes explicitly and the function load zicontrol zibin can directly load data saved in binary format from ziControl See Section 4 4 2 for reference documentation on these commands LabOne Programming Manual Revision 31421 Zurich Instruments 79 4 4 LabOne Python API ziPython Command Reference 4 4 LabOne Python API ziPython Command Reference 4 4 1 4 4 2 The following reference documentation for ziPython is available in from within a python session using python s help see Section 4 2 2 command It is included here for convenience The documentation is grouped by module and class as following Help forthe zhinst Python Package Help for zhinst s Utility Functions Help for ziPython s ziDAQServer class Help for ziPython s ziDeviceSettings class Help for ziPython s ziDAQSweeper class Help for ziPython s ziDAQZoomFFT class Help for ziPython s ziDAQRecorder class Help for ziPython s ziPllAdvisor class Help for ziPython s ziPidAdvisor class Help for the zhinst Pytho
48. Unit Description pllAdvisor bode struct S Output parameter Contains the resulting bode plot of the PLL simulation pllAdvisor uint64 Issues a command for the PLL Advisor to calculate calculate values Set the value to 1 to start the calculation pllAdvisor center double Hz Center frequency of the PLL oscillator The PLL frequency shift is relative to this center frequency pllAdvisor d double Hz degs The PID differential gain pllAdvisor demodbw double Hz The demodulator bandwidth to use for the PLL loop filter pllAdvisor i double Hz deg s The PID integral gain pllAdvisor mode uint64 Sets the PLL operating mode Currently only open loop mode is supported pllAdvisor order uint64 z Demodulator filter order to use for the PLL loop filter pllAdvisor p double Hz deg The PID proportional gain pllAdvisor pllbw double Hz The demodulator bandwidth to use for the PLL loop filter pllAdvisor pm double deg Output parameter Simulated phase margin of the PLL with the current settings The phase margin should be greater than 45 deg and preferably greater than 65 deg for stable conditions pllAdvisor pmfreg double Output parameter Simulated phase margin frequency pllAdvisor q double 7 Quality factor Currently not used pllAdvisor rate double Hz PLL Advisor sampling rate of the PLL control loop pllAdvisor stable boo Output parameter When 1 the PLL Advisor found a stable solution with the given settings When O revis
49. Val Val unsigned char Dat fed Detailed Description LabOne Programming Manual Revision 31421 Zurich Instruments 217 6 3 Data Structure Documentation ziEvent is used to give out events like value changes or errors to the user Event handling functionality is provided by ziAPISubscribe and ziAPIUnSubscribe as well as ziAPIPollDataEx See Also ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx include lt stdio h gt include ZiAPI h void ProcessEvent zIEvent Event unsigned int j switch Event gt valueType case ZI VALUE TYPE DOUBLE DATA printf Su elements of double data s n Event gt count Event gt path for j 0 j lt Event gt count jtt printf Sf n Event gt value doubleData ID break case ZI VALUE TYPE INTEGER DATA printf Su elements of integer data s n Event gt count Event gt path for j 0 j lt Event gt count p jtt printf Sf n float Event gt value integerData LabOne Programming Manual Revision 31421 Zurich Instruments 218 6 3 Data Structure Documentation break case ZI VALUE TYPE DEMOD SAMPLE printf Su elements of sample data s n Event gt count r Event gt path for j 0 j lt Event gt count jt printf TS f X f Y f n float Event gt value demodSample j timeStamp value demodSample value demodSa
50. Zurich Instruments 319 6 4 File Documentation if RetVal ziAPISetValuel Conn DEV1046 demods rate 100 ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValueD Conn DEV1046 demods 0 rate amp ValueD ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n ValueD See Also ziAPIGetValuel ziAPISyncSetValuel LabOne Programming Manual Revision 31421 Zurich Instruments 320 6 4 File Documentation ziAPISetValueB ZIResult_enum ziAPISetValueB ZIConnection conn const char path unsigned char buffer unsigned int length asynchronously sets the binary type value of one ore more nodes specified in the path This function sets the values at the nodes specified in a path More than one value can be set ifa wildcard is used The function sets the value asynchronously which means that after the function returns you have no security to which value it is finally set nor at what point in time it is set Parameters lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set lin buffer Pointer to the byte array with the data lin length Length of the data in the buffer Returns m Z SUCCESS on s
51. a ziModFinish vi ziModUnSub ziModStatus vi ziModGetNe a3 FHS 2 ziModClear vi ziModGetDat Zurich Instruments LabOne vproy My Computer Figure 5 1 Locatingthe LabOne LabVIEW Palette 9 2 2 LabOne LabVIEW Programming Concepts As described in Section 1 1 a LabVIEW program communicates to a Zurich Instrument device via a software program running on the PC called the data server In general the outline of the instruction flow for a LabVIEW virtual instrument is as following 1 Initialization Open a connection from the API to the data server program 2 Configuration Perform the instrument s settings For example using the virtual instrument ziSetValueDouble vi 3 Data Read data from the instrument 4 Utility Perform data analysis on the read data potentially repeating Step 2 and or Step 3 5 Close Terminate the API s connection to the data server program The VI Tree vi included the LabOne LabVIEW API demonstrates this flow and lists common VIs used for working with a Zurich Instruments device see Figure 5 2 The VI Tree vicanbefound either via the LabOne VI palette see Section 5 2 1 or by opening the file in the Public folder of your LabOne LabVIEW installation typically located at LabOne Programming Manual Revision 31421 Zurich Instruments 116 5 2 Getting Started C Program Files National Instruments LabVIEW 2012 instr lib Zurich Instruments LabO
52. a device to the server This function connects a device with deviceSerial via the specified devicelnterface for use with the server Parameters Returns See Also lin conn Pointer to the ZIConnection with which the connection should be established in deviceSerial The serial of the device to connect to e g dev2100 in devicelnterface The interface to use for the connection e g USBI1 GbE in interfaceParams Parameters for interface configuration Z _INFO_SUCCESS on success Z _ERROR_TIMEOUT when communication timed out ziAPIDisconnectDevice ziAPIConnect ziAPIDisconnect ziAPIInit LabOne Programming Manual Revision 31421 Zurich Instruments 303 6 4 File Documentation ziAPIDisconnectDevice ZlResult_enum ziAPIDisconnectDevice ZIConnection conn const char deviceSerial Disconnect a device from the server This function disconnects a device specified by deviceSerial from the server Parameters lin conn Pointer to the ZIConnection with which the connection should be established in deviceSerial The serial of the device to connect to e g dev2100 Returns Z _INFO_SUCCESS on success Z ERROR TIMEOUT when communication timed out See Also ziAPIConnectDevice ziAPIConnect ziAPIDisconnect ziAPIInit LabOne Programming Manual Revision 31421 Zurich Instruments 304 6 4 File Documentation ziAPIGetValueD ZlResult_enum ziAPIGetValueD ZIConnection conn
53. an analog input signal providing just the amplitude gain information See Also Spectrum Analyzer Vector Network Analyzer Sample Loss loss of samples between the instrument and the host computer Instrument that measures the voltage of an analog input signal providing just the amplitude gain information over a defined spectrum See Also Scalar Network Analyzer Secure Shell Time Constant Transmission Control Protocol Internet Protocol An independent sequence of instructions to be executed by a processor Measure of the non linearity of signal channels input and output Transistor to Transistor Logic level Ultra High Frequency Ultra High Stability Universal Serial Bus Voltage Controlled Oscillator Instrument that measures the network parameters of electrical networks commonly expressed as s parameters For this purpose it measures the voltage of an input signal providing both amplitude gain and phase information For this characteristic an older name was gain phase meter See Also Gain Phase Meter Scalar Network Analyzer Extensible Markup Language Markup language that defines a set of rules for encoding documents in a format that is both human readable and machine readable LabOne Programming Manual Revision 31421 Zurich Instruments 350 Z ZCtrl ZOOMFFT ZSync Zurich Instruments Control bus This technique performs FFT processing on demodulated samples for instance after a lock in amplifie
54. as setting ZI_LIST_NONE Default return a simple listing of the given node immediate descendants m ZI LIST RECURSIVE List the nodes recursively ZI LIST ABSOLUTE Return absolute paths ZI LIST _LEAFSONLY Return only leaf nodes which means the nodes at the outermost level of the tree ZI_LIST_SETTINGSONLY Return only nodes which are marked as setting LabOne Programming Manual Revision 31421 Zurich Instruments 289 6 4 File Documentation enum TREE_ACTION TREE_ACTION defines the values for the TreeChange Action Variable Enumerator TREE_ACTION_REMOVE a tree has been removed TREE ACTION ADD a tree has been added TREE_ACTION CHANGE a tree has changed LabOne Programming Manual Revision 31421 Zurich Instruments 290 6 4 File Documentation Function Documentation ZiIAPIInit ZilResult_enum ziAPIInit ZIConnection conn Initializes a ZIConnection structure This function initializes the structure so that it is ready to connect to Data Server It allocates memory and sets up the infrastructure needed Parameters out conn Pointer to ZIConnection that is to be initialized Returns 7 _INFO_SUCGESS on success 7 _ERROR_MALLOC on memory allocation failure See Also ziAP Destroy ziAPlConnect ziAPIDisconnect See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 291 6 4 File Documentation zi
55. blockMarker see ZIScopeWave blockNumber see ZIScopeWave BWLimit see ScopeWave byteArray see ZIEvent ByteArray see ziEvent Val byteArrayTS see ZlEvent Bytes see ByteArrayData bytes see ZIByteArray see ZIByteArrayTS ChO see AuxlnSample chO see ZlAuxInSample Ch1 see AuxlnSample ch1 see ZlAuxInSample channelBWLimit see ZIScopeWave channelEnable see ZIScopeWave channellnput see ZIScopeWave channelMath see ZIScopeWave channelScaling see ZIScopeWave commensurable see ZIPWAWave count see ZIEvent Count see ScopeWave see ziEvent countBin see ZIPWASample doubleDataTS see ZIEvent dt see ScopeWave see ZIScopeWave flags see ZIScopeWave Frequency see DemodSample frequency see ZlDemodSample see ZIPWAWave harmonic see ZIPWAWave inputSelect see ZIPWAWave Integer see ziEvent Val integerData see ZIEvent integerDataTS see ZlEvent Len see ByteArrayData length see ZIByteArray see ZIByteArrayTS MAX_EVENT_SIZE 238 MAX_PATH_LEN 238 mode see ZIPWAWave Name see TreeChange name see ZIT reeChangeData oscSelect see ZIPWAWave overflow see ZIPWAWave path see ZlEvent Path see ziEvent Phase see DemodSample phase see ZIDemodSample pwaType see ZIPWAWave pwaWave see ZIEvent ReadMEMFile 338 Reserved see DemodSample see DIOSample reserved see ZIDIOSample see ZIPWASample reserved0 see ZIScopeWave reservedUInt see ZIPWAWave
56. buffers between API and device to enforce that further code is only executed after the device executed a previous command argl Reference to the ziDAQServer class arg2 Device string e g dev100 flush flush ziDAQServer argl gt None Flush all data in the socket connection and API buffers Call this function before a subscribe with subsequent poll to get rid of old streaming data that might still be in the buffers argl Reference to the ziDAQServer class get get ziDAQServer argl str arg2 bool arg3 gt object LabOne Programming Manual Revision 31421 Zurich Instruments 87 4 4 LabOne Python API ziPython Command Reference Return a dict with all nodes from the specified sub tree High speed streaming nodes e g devN demods 0 sample are not returned Wildcards may be used in which case read only nodes are ignored argl Reference to the ziDAQServer class arg2 Path string of the node Use wild card to select all arg3 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False get ziDAQServer argl str arg2 gt object getAsEvent getAsEvent ziDAQServer argl str arg2 gt None Trigger an event on the specified node The node data is returned by a subsequent poll command argl Reference to the ziDAQServer class arg2 Path string of the node getAuxInSample getAuxInSample z
57. computer program that runs on the host computer and manages settings on and data transfer to and from instruments by receiving commands from clients It always has the most up to date configuration of the device and ensures that the configuration is synchronized between different clients Web Server Layer Data Server Layer Devices m ziServer exe The Data Server that handles communication with HF2 Instruments LabOne Programming Manual Revision 31421 Zurich Instruments 1 1 LabOne Software Architecture m 2ziDataServer exe The Data Server that handles communication with UHFLI and MFLI Instruments Note in the case of MFLI Instruments the Data Server runs on the instrument itself m Remote computer A computer available on the same network as the host computer that can communicate with an instrument via the Data Server program running on the host Client Acomputer program that communicates with an instrument via the Data Server The client can be running either on the host or the remote computer m API Application Programming Interface a collection of functions and data structures which enable communication between software components In our case the various APIs e g LabVIEW Matlab provide functions to configure instruments and receive measured experimental data Interface Either a client or an API GUI Graphical User Interface A computer program that the user can operate via images as opposed t
58. ddan ele ed ee 4 Ve a A ore UKR OTE 5 1 1 LabOne Software Architecture 22uanssesssenenssnnnnsnennennennnnnnnnn nenn nnnen nn 6 2 Comparison of the LabOne Interfaces 2222422200nsnnenrnennenennenennnne nennen 9 1 3 LabOne APl Levels una dues geeneen esdek ananda ideen 10 1 4 Finding settings The Node Hierarchy un anneer ee renenn eere nnen ener een eneen 12 1 5 Obtaining Data from the Instrument cee ce eee cence ee eeeeceeeee ae eneen enseneennnn 14 1 6 INSTRUMENT SPECI TIC Consideratii S x da sicsuiccneswiaae ster tienen dns ter dense raadde beits 16 2 ZIGOFE PrOSrFaMMINE Overview a ee ee ee ne na cee 17 2 1 An Introduction to ziCore based APIS 222224ss2snesssnnnsnnnennnnne nennen 18 2 2 Sweeper Module a ln nn sro 21 2 33 ZOOM ET MOG UNC re rn acs ae eneen 30 2 4 Software Trigger Recorder Module nnnnnnnn een ennneneneer enen enennenenenr eneen 32 2 5 Device settings MOGUL sirar a iint en ea EAA ARAARA EA EAEAN AAKER TEA E 37 2 6 PLE Advisor Module nsi er Er ae eine 38 Ze MMOS QMO AWGICKS Nr EINES vee A aen ed reese 40 Il LabOne APls 0 rare isi ur rar see ee ae enden raden 41 3 Moab Program NE oepa en TAAA AA A ERr E anne Eng RR IHRER ER a ee 42 3 1 Installing the LabOne Matlab API nnn nennen eneenenneneeneeneneeneen ener en ia 43 3 2 Getting Started with the LabOne Matlab API nnnonnenn eneen eneen eneen 46 3
59. demodSample when valueType ZI_VALUE_TYPE_DEMOD_SAMPLE ZlAuxInSample auxInSample when valueType ZILVALUE_TYPE_AUXIN_SAMPLE z DIOSample dioSample when valueType ZI_LVALUE_TYPE_DIO_SAMPLE 7 ScopeWave scopeWave when valueType ZILVALUE_TYPE_SCOPE_WAVE ScopeWave scopeWaveOld when valueType ZILVALUE_TYPE_SCOPE_WAVE_OLD ZIPWAWave pwaWave when valueType ZILVALUE_TYPE_PWA_WAVE union ZlEvent 1 value Convenience pointer to allow for access to the first entry in Data using the correct type according to ZlEvent valueType field uint8_t data The raw value data Detailed Description ZIEvent is used to give out events like value changes or errors to the user Event handling functionality is provided by ziAPISubscribe and ziAPIUnSubscribe as well as ziAPIPollDataEx include lt stdio h gt include ZiAPI h void ProcessEvent zIEvent Event unsigned int j switch Event gt valueType case LabOne Programming Manual Revision 31421 Zurich Instruments 264 6 4 File Documentation ZI VALUE TYPE DOUBLE DATA printf Su elements of double data s n Event gt count Event gt path for j 0 j lt Event gt count 7 jtt printf Sf n Event gt value doubleData 3 break case ZI VALUE TYPE INTEGER DATA printf Su elements of integer data s n Event gt count Event gt p
60. earlier than the call to ziAPISync This ensures in particular that any settings made prior to the call to ziAPISync have been propagated to the device and the data retrieved afterwards is produced with the new settings already set to the hardware Note however that this does not include any required settling time Parameters lin conn Pointer to the ZIConnection that is to be synchronized Returns Z _INFO_SUCCESS on success Zl ERROR TIMEOUT when communication timed out LabOne Programming Manual Revision 31421 Zurich Instruments 326 6 4 File Documentation ziAPlEchoDevice ZIResult_enum ziAPlEchoDevice ZIConnection conn const char deviceSerial Sends an echo command to a device and blocks until answer is received This is useful to flush all buffers between API and device to enforce that further code is only executed after the device executed a previous command Per device echo is only implemented for HF2 For other device types it is a synonym to ziAPISync and deviceSerial parameter is ignored Parameters lin conn Pointer to the ZIConnection that is to be synchronized in deviceSerial The serial of the device to get the echo from e g dev2100 Returns Z _INFO_SUCCESS on success Z ERROR TIMEOUT when communication timed out LabOne Programming Manual Revision 31421 Zurich Instruments 327 6 4 File Documentation ziAPlAsyncSetDoubleData ZIResult_enum ziAPlAsyncSetDoubleData ZIConnec
61. ee ds 352 LabOne Programming Manual Revision 31421 Zurich Instruments 3 Part LabOne Programming Concepts This introduction gives an overview of LabOne programming and deals with generic concepts applicable to any of Zurich Instruments APIs It also helps guide the user to an appropriate choice of API Refer to Section 1 1 for an overview of the LabOne Software Architecture m Section 1 2 fora Comparison of the LabOne Interfaces Section 1 3 for an explanation of LabOne API Levels m Section 1 4 for Finding settings The Node Hierarchy Section 1 5 for Obtaining Data from the Instrument Section 1 6 for Instrument Specific Considerations m Chapter 2 for an overview to working with ziCore based APIs and Modules Chapter 1 Introduction This chapter briefly describes the different possibilities to interface with a Zurich Instruments device other than via the LabOne User Interface or ziControl HF2 Series only Zurich Instruments devices are designed with the concept that the computer is the cockpit there are no controls on the front panel of the instrument instead the user can configure their instrument from and stream data directly to their computer The aim of this approach is to give the user the freedom to choose where they connect to and how they control their instrument As an example the user can either work on a computer directly connected to the instrument via USB or remotely from a diff
62. in Volts double sample time dataloss Indicator of sample loss including block loss bool sample time blockloss Indication of data block loss over the socket connection This may be the result of a too long break between subsequent poll commands bool LabOne Programming Manual Revision 31421 Zurich Instruments 14 1 5 Obtaining Data from the Instrument sample time invalidtimestampication of invalid time stamp data as a result of a sampling rate change during the measurement bool Note Chapter 6 contains some details of other data structures LabOne Programming Manual Revision 31421 Zurich Instruments 15 1 6 Instrument Specific Considerations 1 6 Instrument Specific Considerations 1 6 1 This section describes some instrument specific considerations when programming with the LabOne APIs UHF Specific Considerations UHF Lock in Amplifiers perform an automatic calibration 10 minutes after power up of the Instrument This internal calibration is necessary to achieve the specifications of the system However if necessary itcan be ran manually by setting the device node devN system calib calibrate to 1 and then disabled using the devN system calib auto node The calibration routine takes about 200 ms and during that time the transfer of measurement data will be stopped on the Data Server level If a ziAPI LabOne C API or LabVIEW client is polling data during this time the user will experience data
63. is experienced in the LabOne User Interface see Figure 2 1 Demodulator 1 R Amplitude mV Frequency Hz Phase deg 1 Frequency Hz Frequency Hz Figure 2 1 The same results and behavior can be obtained from Modules in any ziCore based interface Sweeper Module results from the LabOne Matlab API left and the LabOne User Interface right using the same Sweeper and instrument settings The modules currently available in ziCore are The Sweeper Module for obtaining data whilst performing a sweep of one of the instrument s setting e g measuring a frequency response The zoomFFT Module for calculating the FFT of demodulator output LabOne Programming Manual Revision 31421 Zurich Instruments 18 2 1 An Introduction to ziCore based APIs 2 1 3 m The Software Trigger Recorder Module for recording instrument data asynchronously based upon user defined triggers m The Device Settings Module for saving and loading instrument settings to and from XML files The PLL Advisor Module for modelling simulating the PLL phase locked loop incorporated in the instrument available for UHF Lock in Amplifiers only In addition to providing a unified interface between APIs modules also provide a uniform work flow regardless of the functionality the module performs e g sweeping recording data see Section 2 1 3 An important difference to low level ziCore API com
64. localhost 8005 8005 for HF2 Series m gt gt ziDAQ connect localhost 8004 8004 for UHFLI m gt gt ziDAQ connect mf hostname 8004 8004 for MFLI see below Note using localhost above assumes that the Data Server is running on the same computer from which you are using Matlab See Section 1 1 1 forinformation about port choice and connecting to the Data Server For MFLl instruments the hostname IP address of the MFLI instrument must be provided the value of mf hostname see Section 1 1 1 and the Getting Started chapter of the MFLI User Manual for more information 3 If no error is reported then Matlab is correctly configured to use ziDAQ congratulations Otherwise please try the steps listed in Troubleshooting the LabOne Matlab API LabOne Programming Manual Revision 31421 Zurich Instruments 45 3 2 Getting Started with the LabOne Matlab API 3 2 Getting Started with the LabOne Matlab API This section introduces the user to the LabOne Matlab API 3 2 1 Contents of the LabOne Matlab API Alongside the driver for interfacing with your Zurich Instruments device the LabOne Matlab API includes many files for documentation utility functions and examples See the Contents m file located in a LabOne Matlab API directory see Step 1 in Section 3 1 2 for its typical location for a description of the API s sub folders and files Run the command gt gt doc Contents in the Matlab Command Window in the L
65. loss ziAPI has no functionality to deal with such a streaming interrupt Clients polling data from ziCore based APIs i e Matlab or Python APIs will be informed of dataloss which allows the user to ignore this data Please see the UHF User Manual for more information about device calibration LabOne Programming Manual Revision 31421 Zurich Instruments 16 Chapter 2 ziCore Programming Overview The LabOne Matlab and Python APIs provide interfaces to configure acquire data from and run integral functionality of your Zurich Instruments device in powerful high level programming environments These high level interfaces are however just thin application layers based on a shared coreAPI ziCore This chapter aims to describe the common functionality that s available to any of the interfaces based on ziCore Refer to Section 2 1 for An Introduction to ziCore based APIs m Section 2 2 forthe Sweeper Module Section 2 3 forthe zoomFFT Module m Section 2 4 forthe Software Trigger Recorder Module m Section 2 5 forthe Device Settings Module Section 2 6 forthe PLL Advisor Module Section 2 7 for some ziCore programming Tips and Tricks LabOne Programming Manual Revision 31421 Zurich Instruments 17 2 1 An Introduction to ziCore based APIs 2 1 An Introduction to ziCore based APIs Zin Vn Ns 2 12 All the ziCore based APIs share a common structure which provides a uniform interface for programming Zuric
66. not available to the general public Note The HF2 Series only supports API Level 1 Note New UHFLI and MFLI API users are recommended to use API Level 5 1 3 1 API Level 4 Features The new features in API Level 4 are m Timestamps are available for any settings or data node m Greatly improved Scope data transfer rates and new Scope data structure Greatly improved UHF Boxcar and PWA support 1 3 2 API Level 5 Features API Level 5 was introduced in LabOne Release 15 01 to accommodate a necessary change in the Scope data structure TheScope data structure was extended with the new field channeloffset which contains the offset value that must be added to the scaled wave value in order to obtain the physical value LabOne Programming Manual Revision 31421 Zurich Instruments 10 1 3 LabOne API Levels recorded by the scope For previous hardware scope inputselects there is essentially no change since their offset is always zero However for the extended values of inputselects such as PID Out value available with the DIG option the offset is determined by the values of limitlower and limitupper configured by the user LabOne Programming Manual Revision 31421 Zurich Instruments 1 4 Finding settings The Node Hierarchy 1 4 Finding settings The Node Hierarchy In order to communicate with an Zurich Instruments device via text based commands in an API it is necessary to understand how the
67. occurred Z _OVERFLOW when a FIFO overflow occurred See Data Handling for an example See Also ziAPISubscribe ziAPIUnSubscribe ziAPlGetValueAsPollData ziEvent LabOne Programming Manual Revision 31421 Zurich Instruments 198 6 2 Module Documentation 6 2 5 Error Handling all functions return ZlResult_enum To retrieve a full text description of such a status one function is provided ziAPIGetError Functions 7l Result_enum ziAPIGetError ZlResult_enum result char buffer int base returns a description and the severity for a ZiResult_enum LabOne Programming Manual Revision 31421 Zurich Instruments 199 6 2 Module Documentation Function Documentation ziAPIGetError ZIResult_enum ziAPIGetError ZIResult enum result char buffer int base Paramet Returns returns a description and the severity fora ZIResult_enum This function returns a static char pointer to a description string for the given ZlResult_enum error code It also provides a parameter returning the severity info warning error If the given error code does not exist a description for an unknown error and the base for an error will be returned If a description or the base is not needed NULL may be passed ers lin result A ZIResult_enum for which the description or base will be returned out buffer A pointer to a char array to return the description May be NULL if no description is needed out base The severit
68. or higher The Matlab interface allows the user to directly obtain measurement data within the Matlab programming environment where they can make use of the many built in functions available The user can utilize high level functionality provided by ziCore s Modules to perform common measurement tasks This interface requires a Mathworks Matlab license but no additional Matlab Toolboxes The Python interface allows the user to directly obtain measurement data within python The user can utilize high level functionality provided by ziCore s Modules to perform common measurement tasks Python is available as free and open source software no license is required to use it The C API ziAPI is a very versatile interface that will run on most platforms However since Cis a low level programming language the development cycle is slower than with the other programming environments and high level functionality provided by ziCore s Modules is not available The text based interface HF2 Series only allows the user to manually connect to the HF2 Data Server in a console via telnet While this interface is a very useful tool for HF2 programmers to verify instrument configuration set by other interfaces it is limited in terms of performance and maximum demodulator sample rate See the HF2 User Manual for more details LabOne Programming Manual Revision 31421 Zurich Instruments 9 1 3 LabOne API Levels 1 3 LabOne API Levels All of t
69. recording use subscribe and poll methods argl Reference to the ziDAQServer class LabOne Programming Manual Revision 31421 Zurich Instruments 88 4 4 LabOne Python API ziPython Command Reference arg2 Path string listNodes listNodes ziDAQServer argl str arg2 int arg3 gt list This function returns a list of node names found at the specified path argl Reference to the ziDAQRecorder class arg2 Path for which the nodes should be listed The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents arg3 Enum that specifies how the selected nodes are listed ziPython ziListEnum none gt 0x00 The default flag returning a simple listing if the given node ziPython ziListEnum recursive gt 0x01 Returns the nodes recursively ziPython ziListEnum absolute gt 0x02 Returns absolute paths ziPython ziListEnum leafsonly gt 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree ziPython ziListEnum settingsonly gt 0x08 Returns only nodes which are marked as setting Or combinations of flags can be used logOff logOff ziDAQServer argl gt None Disables logging of commands sent to a server argl Reference to the ziDAQServer class Logon IS ss logOn ziDAQServer argl int arg2 str arg3 int arg4 gt None Enables logging of commands sent to a server argl Reference to the ziDAQ
70. should be used for loading saving device settings e g dev99 devicesettings path string Directory where settings files should be located If not set the default settings location of the LabOne software is used devicesettings filename string Name of settings file to use devicesettings command string The command to execute save Read device settings and save to file load Load settings from file and write to device read Read device settings only no save set ziDeviceSettings argl str arg2 int arg3 gt None set ziDeviceSettings argl str arg2 str arg3 gt None set ziDeviceSettings argl object arg2 gt None argl Reference to the pyDeviceSettings class arg2 A list of path value pairs subscribe subscribe ziDeviceSettings argl str arg2 gt None Not relevant for the deviceSettings module trigger trigger ziDeviceSettings argl gt None Not applicable to this module unsubscribe unsubscribe ziDeviceSettings argl str arg2 gt None Not relevant for the deviceSettings module LabOne Programming Manual Revision 31421 Zurich Instruments 94 4 4 LabOne Python API ziPython Command Reference Data and other attributes defined here _ init lt built in function init gt Raises an exception This class cannot be instantiated from Python Data descriptors inherited from Boost Python instance ret _ weakref _ Data and other attribute
71. string of the node syncSetInt syncSetInt ziDAQServer argl str arg2 int arg3 gt int argl Reference to the ziDAQServer class arg2 Path string of the node unsubscribe unsubscribe ziDAQServer argl object arg2 gt None LabOne Programming Manual Revision 31421 Zurich Instruments 91 4 4 LabOne Python API ziPython Command Reference Unsubscribe data streams Use this command after recording to avoid buffer overflows that may increase the latency of other command argl Reference to the ziDAQServer class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified update update ziDAQServer argl gt None Check if additional devices are attached This function is not needed for servers running under windows as devices will be detected automatically argl Reference to the ziDAQServer class version version ziDAQServer argl gt str Get version string of the Python interface of Zurich Instruments argl Reference to the ziDAQServer class writeDebugLog writeDebugLog ziDAQServer argl int arg2 str arg3 gt None Outputs message to the debug log if enabled argl Reference to the ziDAQServer class arg2 Severity trace 0 info 1 debug 2 warning 3 error 4 fatal 5 status 6 arg3 Message to output to the log ZOOMFFT zoomFFT ziDAQServer argl long arg2 gt ziDAQZoomFFT Create a zoomFFT c
72. sweep gridnode value before recording measurement data This corresponds to the settling time required by the lock in amplifier to measure the response in the system The sweep settling time parameter specifies the minimum number of seconds to wait before taking the measurement data which corresponds to the settling time required by the user s experimental setup before measuring the response in the system The actual time that the Sweeper waits before recording data is defined in Equation 2 1 t max sweep settling tc x tc sweep_ settling time Equation 2 1 The settling time used by the Sweeper for each measurement point the amount of time between setting the sweep parameter and recording measurement data is determined by the parameters sweep settling tc and sweep settling time Note the Sweeper may change the value of the demodulator filter s bandwidth equivalently time constant depending on the value of sweep bandwidthcontrol and this will effect the settling time as specified by sweep settling tc see above Controlling how the Sweeper sets the Demodulator s Time Constant For a frequency sweep the sweep settling tc parameter will tend to influence the settling time at lower frequencies whereas sweep averaging sample will influence the settling time at higher frequencies The recommended value for the sweep settling tc setting is 15 For noise measurements a higher value should be used e g 50 Specifying which Data to Meas
73. t List Nodes s n ErrBuffer else char Ptr NodesBuffer char LastPtr Ptr print out each node on a separate line with dash as prefix for Ptr 0 Ptr if Ptr n Ptr 0 printf s n LastPtr LastPtr Ptr 1 print out the last node if Ptr LastPtr printf s n LastPtr LabOne Programming Manual Revision 31421 Zurich Instruments 138 6 2 Module Documentation Enumeration Type Documentation enum ZIListNodes_enum Defines the values of the flags used in ziAPIListNodes Enumerator ZI_LIST NODES_NONE Default return a simple listing of the given node immediate descendants 7 _LIST_NODES_RECURSIVE List the nodes recursively ZI_LIST_NODES_ABSOLUTE Return absolute paths Z I_LIST_ NODES_LEAFSONLY Return only leaf nodes which means the nodes at the outermost level of the tree Z _LIST NODES_SETTINGSONLY Return only nodes which are marked as setting ZI_LIST_NONE Default return a simple listing of the given node immediate descendants m Z _LIST_RECURSIVE List the nodes recursively ZI LIST ABSOLUTE Return absolute paths ZI_LIST_LEAFSONLY Return only leaf nodes which means the nodes at the outermost level of the tree ZI_LIST_SETTINGSONLY Return only nodes which are marked as setting LabOne Programming Manual Revision 31421 Zurich Instruments 139 6 2 Mo
74. that no data is lost between poll commands it s possible to record for longer periods of time by using the poll command inside a loop In order to check that no data has been lost during a poll the demodulator sample s time flags can be checked see Section 1 5 1 If no data was stored in the Data Server s data buffer after issuing a poll the command will wait for the data until the timeout time If the buffer is empty after timeout time passed poll will throw an error Note If Matlab or Python are available one of the LabOne ziCore Modules could be a more efficient choice for data retrieval than the comparably low level pol 1 command see the Section ziCore Modules in Part Il 1 5 1 Demodulator Sample Data Structure An instrument s demodulator data is returned as a data structure typically a struct with the following fields regardless of which API Level is used sample timestam The instrument s timestamp of the measured demodulator pP pP p data uint 64 Divide by the instrument s clockbase dev123 clockbase to obtain the time in seconds sample x The demodulator x value in Volts double sample y The demodulator y value in Volts double sample frequency The current frequency used by the demodulator in Hertz double sample phase The oscillator s phase in Radians not the demodulator phase double sample auxin0 Auxiliary input channel O value in Volts double sample auxinl Auxiliary input channel 1 value
75. the auxin data embedded in the demodulator sample result ziDAQ getDIO path path Path string Returns a single DIO sample result ziDAQ getDouble path path Path string result ziDAQ getInt path path Path string result ziDAQ getByte path path Path string ziDAQ setDouble path value double path Path string value Setting value ziDAQ syncSetDouble path value double path Path string value Setting value ziDAQ setInt path value int64 path Path string value Setting value ziDAQ syncSetInt path value int64 path Path string value Setting value ziDAQ setByte path value uint8 path Path string value Setting value ziDAQ subscribe path path Path string Subscribe to the specified path to receive streaming data or setting data if changed over the poll or pollEvent commands ziDAQ unsubscribe path path Path string ziDAQ getAsEvent path path Path string LabOne Programming Manual Revision 31421 Zurich Instruments 55 3 5 LabOne Matlab API ziDAQ Command Reference Triggers a single event on the path to return the current value The result can be fetched with the poll or pollEvent command ziDAQ update Detect HF2 devices connected to the USB On Windows this update is performed automatically
76. the bitmask used with trigger N bits The trigger value is bits AND bit mask bitwise trigger N bits uint64 Only for Digital triggers Specify the bits used for the Digital trigger value The trigger value is bits AND bit mask bitwise trigger N count uint64 The number of triggers to save trigger N delay uint64 Seconds The amount of time to record data before the trigger was activated Delay Time delay of trigger frame position left side relative to the trigger edge For delays smaller than 0 trigger edge inside trigger frame pre trigger For delays greater than 0 trigger edge before trigger frame post trigger see Figure 2 8 trigger N duration double Seconds The length of time to record data for see Figure 2 8 trigger N edge uint64 Define on which signal edge to trigger Triggers when the trigger input signal crosses the trigger level from either low to high edge 1 high to low edge 2 or both edge 3 Used for Trigger Type edge pulse tracking edge and tracking pulse In the case of pulse trigger the value specifies a positive edge 1 or negative edge 2 pulse relative to the trigger level edge 3 specifies either positive or negative trigger N findlevel uint64 Automatically find the value of trigger N level based on the current signal value trigger N level uint64 Many Specify the main trigger level value trigger N holdoff uint64 The holdoff count the number of skipped count triggers unti
77. the other See Also Multi harmonic LabOne Programming Manual Revision 31421 Zurich Instruments 348 Multi harmonic MH N Noise Equivalent Power Bandwidth NEPBW Nyquist Frequency NF O Output Amplitude Accuracy OAA OV P PC PD Phase locked Loop PLL Phase modulation AFM PM AFM PID PL R RISC Root Mean Square RMS Refers to the simultaneous measurement of modulated signals at various harmonic frequencies The objective of multi frequency is to increase the information that can be derived from a measurement which is particularly important for one time non repeating events and to increase the speed of a measurement since different frequencies do not have to be applied one after the other See Also Multi frequency Effective bandwidth considering the area below the transfer function of a low pass filter in the frequency spectrum NEPBW is used when the amount of power within a certain bandwidth is important such as noise measurements This unit corresponds to a perfect filter with infinite steepness at the equivalent frequency See Also Bandwidth For sampled analog signals the Nyquist frequency corresponds to two times the highest frequency component that is being correctly represented after the signal conversion Measure of aninstrument s ability to faithfully output a set voltage at a given frequency versus a traceable standard Over Volt signal input saturation and clippin
78. ticks to seconds via the device s clockbase the ADC s sampling rate specify reference start time via t0 clockbase double ziDAQ getInt device clockbase t double sample timestamp double sample timestamp 1 clockbase Use the utility function ziCheckPathInData Checking that a sub structure in the nested data structure returned by poll actually exists can be cumbersome and can require multiple nested if statements this can be avoided by using the utility function ziCheckPathInData For example the code data ziDAQ poll poll length poll timeout if isfield data device if isfield data device demods if length data device demods gt channel if isempty data device demods channel sample o do something with the demodulator sample can be replaced by data ziDAQ poll poll length poll timeout if ziCheckPathInData data device demods demod c sample do something with the demodulator sample LabOne Programming Manual Revision 31421 Zurich Instruments 51 3 4 Troubleshooting the LabOne Matlab API 3 4 Troubleshooting the LabOne Matlab API This section intends to solve possible error messages than can occur when using ziDAQin Matlab Error message Undefined function or method ziDAQ for input arguments of type Matlab can not find the LabOne Matlab API library Check whether the MATLAB2012 Driver subfolder of your LabOne install
79. unbound zhinst ziPython ziDAQServer method record ziDAQServer argl float arg2 long arg3 int arg4 gt ziDAQRecorder Create a recording class This will start a thread for asynchronous recording argl Reference to the ziDAQServer class arg2 Maximum recording time for single triggers in s arg3 Timeout in ms Recommended value is 500ms arg4 optional Record flags FILL 0x0001 Fill holes ALIGN 0x0002 Align data that contains a timestamp THROW 0x0004 Throw EOFError exception if sample loss is detected record ziDAQServer argl float arg2 long arg3 gt ziDAQRecorder Reference help for the ziDAQRecorder class gt gt gt help zhinst ziPython ziDAQRecorder Help on class ziDAQRecorder in zhinst ziPython zhinst ziPython ziDAQRecorder class ziDAQRecorder Boost Python instance Method resolution order ziDAQRecorder Boost Python instance __builtin__ object Methods defined here _ reduce _ lt unnamed Boost Python function gt clear clear ziDAQRecorder argl gt None End the recording thread execute execute ziDAQRecorder argl gt None LabOne Programming Manual Revision 31421 Zurich Instruments 102 4 4 LabOne Python API ziPython Command Reference Start the recorder After that command any trigger will start the measurement Subscription or unsubscription is no more possible until the recording is finished finishes finish ziDAQReco
80. ziAPI h LabOne Programming Manual Revision 31421 Zurich Instruments 157 6 2 Module Documentation void PrintVersion ZIConnection Conn ZIResult enum RetVal char ErrBuffer const char Path ZI ABOUT VERSION unsigned char Buffer Oxff unsigned int Length if RetVal ziAPIGetValueB Conn Path Buffer amp Length sizeof Buffer 1 ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get value s n ErrBuffer else Buffer Length 0 printf Ss Ss n Path Buffer See Also ziAPISetValueB ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 158 6 2 Module Documentation ziAPISetValueD ZlResult_enum ziAPISetValueD ZIConnection conn const char path ZIDoubleData value Paramet Returns asynchronously sets a double type value to one or more nodes specified in the path This function sets the values of the nodes specified in path to Value More than one value can be set if a wildcard is used The function sets the value asynchronously which means that after the function returns you have no security to which value it is finally set nor at what point in time it is set ers lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set to Value lin value the double type value that w
81. ziDAQ subscribe handle path Subscribe to one or several nodes After subscription the recording process can be started with the execute command During the recording process paths can not be subscribed or unsubscribed handle Reference to the ziDAQRecorder class path Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified ziDAQ unsubscribe handle path Unsubscribe from one or several nodes During the recording process paths can not be subscribed or unsubscribed handle Reference to the ziDAQRecorder class path Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified ziDAQ get handle path handle Reference to the ziDAQRecorder class path Path string of the node ziDAQ set handle path value handle Reference to the ziDAQRecorder class LabOne Programming Manual Revision 31421 Zurich Instruments 58 3 5 LabOne Matlab API ziDAQ Command Reference path Path string of the node ziDAQ set handle path value handle Reference to the ziDAQRecorder class Path string of the node handle Reference to the ziDAQRecorder class path Path string of the node ziDAQ set handle path value ZiDAQ execute handle Start the recorder After that command any trigger will start the me
82. 00000 0x00200000 0x00400000 Oxffffffff default bled This is useful warning 3 warning 3 LabOne Programming Manual Revision 31421 Zurich Instruments 68 3 5 LabOne Matlab API ziDAQ Command Reference oo do oe ZiDAQ logOff Turn of message logging LabOne Programming Manual Revision 31421 Zurich Instruments 69 Chapter 4 Python Programming Python is open source software freely available for download from Python s official website Python is a high level programming language with an extensive standard library renowned for its batteries included approach Combined with the NumPy package for scientific computing Python is a powerful computational tool for scientists that does not require expensive software licenses The Zurich Instruments LabOne Python API also known as ziPython enables the user to configure and stream data from their instrument directly into Python This chapter aims to help you get started using the Zurich Instruments LabOne Python API ziPython to control your instrument please refer to Section 4 1 for help Installing the LabOne Python API Section 4 2 forhelp Getting Started with the LabOne Python API and Running the Examples Section 4 3 for LabOne Python API Tips and Tricks m Section 4 4 for the LabOne Python API ziPython Command Reference Note This chapter and the provided examples are not intended to be a Python tutorial For help getti
83. 1 Zurich Instruments 233 6 3 Data Structure Documentation sampleCount int16 t datalntl6 int32_t datalnt32 float dataFloat union ZIScopeWave 0 data r ZIScopeWave Data Fields _7 TimeStamp timeStamp Time stamp of the first sample in this data block __ ZITimeStamp triggerTimeStamp Time stamp of the trigger may also fall between samples double dt Time difference between samples in seconds uint8_t channelEnable Up to four channels if channel is enabled corresponding element is non zero uint8_t channellnput Specifies the input source for each of the scope four channels 0 Signal Input 1 1 Signal Input 2 2 Trigger Input 1 3 Trigger Input 2 4 Aux Output 1 5 Aux Output 2 6 Aux Output 3 7 Aux Output 4 8 Aux Input 1 9 Aux Input 2 uint8_t triggerEnable Non zero if trigger is enabled Bit 0 rising edge trigger off 0 on 1 Bit 1 falling edge trigger off 0 on 1 uint _ttriggerinput Trigger source same values as for channel input j nt8_t reservedO uint8_t channelBWLimit Bandwidth limit flag per channel Bit 0 off 0 on 1 Bit 7 1 Reserved uint8_t channelMath Math Operation e g averaging Bit 7 0 Reserved float channelScaling Data scaling factors for up to 4 channels LabOne Programming Manual Revision 31421 Zurich Instruments 234 6 3 Data Structure Documentation
84. 195 334 ziAPlUpdateDevices 142 302 ZIAPIVersion_enum 288 ZIConnection 125 238 ZiListNodes_enum 139 289 ZlResult_enum 281 Z TreeAction_enum 287 Z ValueType_enum 285 ZI_API_VERSION_1 see ZIAPIVersion_enum ZI_API_VERSION_4 see ZIAPIVersion_enum ZI_COMMAND see ZIResult_enum ZI_CONNECTION see ZIResult_enum ZI_DATA_AUXINSAMPLE see ZIValueType_enum ZI_DATA_BYTEARRAY see ZIValueType_enum Z _DATA_DEMODSAMPLE see Z ValueType_enum ZI_DATA_DIOSAMPLE see ZIValueType_enum ZI_DATA_DOUBLE see ZIValueType_enum ZI_DATA_INTEGER see ZlValueType_enum ZI_DATA_NONE see ZIValueType_enum ZI_DATA_SCOPEWAVE see ZlValueType_enum ZI_DATA_TREE_CHANGED see Z ValueType_enum ZI_DUPLICATE see ZIResult_enum ZI_ERROR see ZIResult_enum ZI_ERROR_BASE see ZIResult_enum ZI_ERROR_COMMAND see ZIResult_enum ZI_ERROR_CONNECTION see ZIResult_enum ZI_ERROR_DEVICE_CONNECTION_TIMEOUT see Z Result_enum ZI_ERROR_DEVICE_DIFFERENT_INTERFACE see Z Result_enum ZI_ERROR_DEVICE_INTERFACE see Z Result_enum Z _ERROR_DEVICE_IN_USE see ZIResult_enum ZI_ERROR_DEVICE_NEEDS_FW_UPGRADE see ZIResult_enum ZI_ERROR_DEVICE_NOT_VISIBLE see Z Result_enum ZI_ERROR_DUPLICATE see ZIResult_enum Z _ERROR_FILE see ZIResult_enum ZI_ERROR_GENERAL see ZIResult_enum ZI_ERROR_HOSTNAME see ZlResult enum ZI_ERROR_LENGTH see ZIResult_enum Z _ERROR_MALLOC see ZIResult_enum Z _ERROR_MAX s
85. 3 LabOne Matlab API Tips and Tricks annen erneer ereennennn eneen ereen nennen 50 3 4 Troubleshooting the LabOne Matlab API nennen eren enenenensennenen enn 52 3 5 LabOne Matlab API ziDAQ Command Reference neenen 54 23 Python Programming san etende trente tin gean ia eesti teas 70 4 1 Installing the LabOne Python API uenssseneennssennnnnssennnnnnsennnnnnen nenn ns 71 4 2 Getting Started with the LabOne Python API nonnen ereen ener eennen erven en 75 4 3 LabOne Python API Tips and Tricks 22sessssennssnenssnennnnennnnnnnnennnn nn 79 4 4 LabOne Python API ziPython Command Reference nnen nennen 80 5 LabVIEW Programming en seeens en nn nn EERTE EES 13 5 1 Installing the LabOne LabVIEW API nnee eneen eenen ennn en eenneene anne 14 5 2 Getting Started u rn ae armen nn ul 16 5 3 LabVIEW Programming Tips and Tricks eeesssssenensssnennnnnenennnnnnee nn 21 6 C Programming au ee en en ee re a ee die dineke dkar dd 22 6 1 Gatne Starton a oiera lines degene eandranevend daneen an eneacedanade lends Cbecenateandeanaudaeds 23 6 2 M dule Document ati n u a el eee Dan 25 6 3 Data Structure Documentation nmr erdee abeel under eel 201 6 4 File Documentation aas svenn arden ead vennen bede eene ede 237 GI SSANY E EE TEERSTTERTTEITLERERTEIDERUEERTELLRTTETTERREEITEERERTEITESTENTELRERTTLERRREFEIERTERTEIUETUEERTERTRR 346 Index zene tete Laren Le LE ae atau
86. 4 t uint8 t uint8 t uint8 t uint8 t uint32 t timeStamp triggerTimeStamp dt channelEnable 4 channelInput 4 triggerEnable triggerInput reserved0 21 channelBWLimit 4 channelMath 4 channelScaling 4 sequenceNumber segmentNumber blockNumber totalSamples dataTransferMode blockMarker flags sampleFormat LabOne Programming Manual Revision 31421 Zurich Instruments 256 6 4 File Documentation sampleCount int16 t dataInt16 0 int32 t datalnt32 0 float dataFloat 0 union ZIScopeWave 0 data ZIScopeWave Data Fields ZlTimeStamp timeStamp Time stamp of the first sample in this data block ZITimeStamp triggerTimeStamp Time stamp of the trigger may also fall between samples double dt Time difference between samples in seconds uint8_t channelEnable Up to four channels if channel is enabled corresponding element is non zero uint8_t channellnput Specifies the input source for each of the scope four channels 0 Signal Input 1 1 Signal Input 2 2 Trigger Input 1 3 Trigger Input 2 4 Aux Output 1 5 Aux Output 2 6 Aux Output 3 7 Aux Output 4 8 Aux Input 1 9 Aux Input 2 uint8_t triggerEnable Non zero if trigger is enabled Bit O rising edge trigger off 0 on 1 Bit 1 falling edge trigger off 0 on 1 uint8_t triggerlnput Trigger source same val
87. 6 uint32_t sampleCount Number of samples in one channel in the current block same for all channels int16_t datalnt16 int32_t datalnt32 float dataFloat union ZIScopeWave 0 data First wave data LabOne Programming Manual Revision 31421 Zurich Instruments 258 6 4 File Documentation struct ZIPWASample Single PWA sample value include ziAPI h typedef struct ZIPWASample double binPhase double x double y uint32 t countBin uint32 t reserved ZIPWASample Data Fields double binPhase Phase position of each bin double x Real PWA result or X component of a demod PWA double y Y component of the demod PWA uint32_t countBin Number of events per bin uint32_t reserved Reserved LabOne Programming Manual Revision 31421 Zurich Instruments 259 6 4 File Documentation struct ZIPWAWave PWA Wave include ziAPI h typedef struct ZIPWAWave ZITimeStamp timeStamp uint64 t sampleCount uint32 t inputSelect uint32 t oscSelect uint32 t harmonic uint32 t binCount double frequency uint8 t pwaType uint8 t mode uint8 t overflow uint8 t commensurable uint32 t reservedUInt ZIPWASample data 0 ZIPWAWave Data Fields ZlTimeStamp timeStamp Time stamp at which the data was updated uin uin Inp uin t64_t sampleCount t32_t inputSelect t32_t oscSelect Tot
88. 6 2 Module Documentation ziAPISetValuel ZIResult_enum ziAPISetValuel ZIConnection conn const char path ZllntegerData value Paramet Returns asynchronously sets an integer type value to one or more nodes specified in a path This function sets the values of the nodes specified in path to Value More than one value can be set if a wildcard is used The function sets the value asynchronously which means that after the function returns you have no security to which value it is finally set nor at what point in time it is set ers lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set lin value the int type value that will be written to the node s m Zl SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z READONLY on attempt to set a read only node Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values 7 _TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum Ret
89. A list of path value pairs subscribe subscribe ziPidAdvisor argl str arg2 gt None Subscribe to one or several nodes trigger trigger ziPidAdvisor argl gt None Not applicable to this module unsubscribe unsubscribe ziPidAdvisor argl str arg2 gt None Unsubscribe from one or several nodes Data and other attributes defined here _ init lt built in function init gt Raises an exception This class cannot be instantiated from Python Data descriptors inherited from Boost Python instance 201 Gt lt _ weakref _ Data and other attributes inherited from Boost Python instance new lt built in method new of Boost Python class object gt T new S gt a new object with type S a subtype of T LabOne Programming Manual Revision 31421 Zurich Instruments 112 Chapter 5 LabVIEW Programming Interfacing with your Zurich Instruments device via National Instruments LabVIEW is an efficient choice in terms of development time and run time performance LabVIEW is a graphical programming language designed to interface with laboratory equipment via so called VIs virtual instruments whose key strength is the ease of displaying dynamic signals obtained from your instrument This chapter aims to help you get started using the Zurich Instruments LabOne LabVIEW API to control your instrument please refer to Section 5 1 for help Installing the LabOne LabVIEW API Section 5 2 2
90. A y AI VAR N Wi NY uiu 2 Bandwidth trigger 0 bandwidth 500 l 0 30 40 50 60 70 80 90 Time ms Figure 2 8 Explanation of the Software Trigger Module s parameters for an Edge Trigger trigger O duration 0 018 Duration 100 100 12 T to L N Dela Signal trigger O delay 0 011 a L m Filtered cut off 500H2 trigger 0 pulse max 0 010 e WIN trigger O path dev42 demods 0 sample PulseWidth wri 6 r trigger 0 source 2 trigger 0 pulse min 0 04 N F j Path amp Source j Edge gt trigger O edge 1 E 4 H a trigger O level 2 l 5 2 L coke I Trigger Level A En oe _ x en Mt EN _ _ _ _ A m o IM IM _ _ I ALM D UN HM AUF a un MM LAN _ _ _ N AM NT UM NM N ysteresigl IND KNN Al ii i nw un tal l i Wil k N Wey hi I 2 tfigger O hysteresis N Mi Bandwidth 4 trigger 0 bandwidth 500 i 0 10 20 30 40 50 60 70 80 90 Time ms Figure 2 9 Explanation of the Software Trigger Module s parameters for a positive Pulse Trigger LabOne Programming Manual Revision 31421 Zurich Instruments 33 2 4 Software Trigger Recorder Module trigger O duration 0 018 Duration 12 T to L N Dela Signal trigger O delay 0 011 f 8 L Filtered cut off 500H2 trigger 0 pulse max 0 010 trigger 0 path dev42 demods 0 sample Pulse
91. APIDestroy ZIResult_enum ziAPIDestroy ZIConnection conn Destroys a ZIConnection structure This function frees all memory that has been allocated by ziAPlInit If it is called with an uninitialized ZIConnection struct it may result in segmentation faults as well when it is called with a struct for which ZIAPIDestroy already has been called Parameters lin conn Pointerto ZIConnection struct that has to be destroyed Returns Z _INFO_SUCCESS See Also ziAPlInit ziAPIConnect ziAPIDisconnect See Connection foran example LabOne Programming Manual Revision 31421 Zurich Instruments 292 6 4 File Documentation ziAPICon nect ZlResult_enum ziAPIConnect ZIConnection conn const char hostname uint16_t port Paramet Returns Connects the ZIConnection to Data Server Connects to Data Server using a ZlConnection and prepares for data exchange For most cases it is enough to just give a reference to the connection and give NULL for hostname and 0 for the port so it connects to localhost on the default port ers lin conn Pointer to ZIConnection with which the connection should be established in hostname Name of the Host to which it should be connected if NULL localhost will be used as default lin port The Number of the port to connect to If 0 default port of the local Data Server will be used 8005 ZI INFO SUCCESS on success ZI_ERROR_HOSTNAME if the given host name could
92. Boost Python function gt clear clear ziDAQZoomFFT argl gt None End the zoom FFT thread execute execute ziDAQZoomFFT argl gt None Start the zoom FFT Subscription or unsubscription is no more possible until the zoom FFT is finished finish finish ziDAQZoomFFT argl gt None LabOne Programming Manual Revision 31421 Zurich Instruments 99 4 4 LabOne Python API ziPython Command Reference Stop the zoom FFT The zoom FFT may be restarted by calling execute again finished finished ziDAQZoomFFT argl gt bool Check if the zoom FFT has finished Returns True if finished Gete get ziDAQZoomFFT argl str arg2 bool arg3 gt object Return a dict with all nodes from the specified sub tree argl Reference to the ziDAQZoomFFT class arg2 Path string of the node Use wild card to select all arg3 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False get ziDAQZoomFFT argl str arg2 gt object listNodes listNodes ziDAQZoomFFT argl str arg2 int arg3 gt list This function returns a list of node names found at the specified path argl Reference to the pyDAQZoomFFT class arg2 Path for which the nodes should be listed The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents arg3 Enum that speci
93. Buffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValueD Conn DEV1046 demods 0 rate amp ValueD ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n ValueD See Also ziAPISetValueD ziAPlGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 306 6 4 File Documentation ziAPIGetValuel ZIResult_enum ziAPIGetValuel ZIConnection conn const char path ZllntegerData value gets the integer type value ofthe specified node This function retrieves the numerical value of the specified node as an integer type value The value first found is returned if more than one value is available a wildcard is used in the path Parameters in conn Pointer to ZIConnection with which the value should be retrieved lin path Path to the node holding the value out value Pointer to an 64bit integer in which the value should be written Returns 7Z _INFO_SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred Z ERROR LENGTH if the path s length exceeds MAX_PATH_LEN Z _FRROR_OVERFLOW when a FIFO overflow occurred Z _FRROR COMMAND on an incorrect answer of the server 7 _ERROR_SERVER_INTERNAL if an internal error occurred in Data Server ZI_ER
94. CCESS no error handling is required ziAPIDestroy Conn return 0 LabOne Programming Manual Revision 31421 Zurich Instruments 126 6 2 Module Documentation LabOne Programming Manual Revision 31421 Zurich Instruments 127 6 2 Module Documentation Function Documentation ZiIAPIInit ZilResult_enum ziAPIInit ZIConnection conn Initializes a ZIConnection structure This function initializes the structure so that it is ready to connect to Data Server It allocates memory and sets up the infrastructure needed Parameters out conn Pointer to ZIConnection that is to be initialized Returns 7 _INFO_SUCGESS on success 7 _ERROR_MALLOC on memory allocation failure See Also ziAP Destroy ziAPlConnect ziAPIDisconnect See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 128 6 2 Module Documentation ziAPIDestroy ZIResult_enum ziAPIDestroy ZIConnection conn Destroys a ZIConnection structure This function frees all memory that has been allocated by ziAPlInit If it is called with an uninitialized ZIConnection struct it may result in segmentation faults as well when it is called with a struct for which ZIAPIDestroy already has been called Parameters lin conn Pointerto ZIConnection struct that has to be destroyed Returns Z _INFO_SUCCESS See Also ziAPlInit ziAPIConnect ziAPIDisconnect See Connection foran ex
95. Description zoomFFT device string Device that should be used for the zoom FFT e g dev99 zoomFFT bit int Number of FFT points 2 bit zoomFFT mode int Zoom FFT mode 0 Perform FFT on X iY 1 Perform FFT on R 2 Perform FFT on Phase zoomFFT loopcount int Number of zoomFFT loops default 1 zoomFFT endless int Perform endless zoomFFT default 0 0 endless off use loopcount 1 endless on ignore loopcount zoomFFT overlap double FFT overlap 0 none 0 1 zoomFFT settling time double Settling time before measurement is performed zoomFFT settling tc double Settling time in time constant units before the FFT recording is started 5 low precision 15 medium precision 50 high precision zoomFFT window int FFT window default 1 Hann 0 Rectangular 1 Hann 2 Hamming 3 Blackman Harris 4 term zoomFFT absolute bool Shifts the frequencies so that the center frequency becomes the demodulation frequency rather than 0 Hz set ziDAQZoomFFT argl str arg2 int arg3 gt None set ziDAQZoomFFT argl str arg2 str arg3 gt None set ziDAQZoomFFT argl object arg2 gt None argl Reference to the ziDAQZoomFFT class arg2 A list of path value pairs subscribe subscribe ziDAQZoomFFT argl str arg2 gt None Subscribe to one or several nodes After subscription the zoom FFT process can be started with the execute command During the zoom FFT process paths can not be subscribe
96. ERROR_DEVICE_CONNECTION_TIMEOUT ZI_LERROR_DEVICE_DIFFERENT_INTERFACE ZI_LERROR_DEVICE_NEEDS_FW_UPGRADE ZI_LERROR_ZIEVENT_DATATYPE_MISMATCH ZI_LERROR_MAX ZI_SUCCESS ZILMAX_INFO ZILWARNING ZI_LUNDERRUN ZILOVERFLOW ZILNOTFOUND ZI MAX WARNING ZILERROR ZI_USB ZI_MALLOC ZI_MUTEX_INIT ZILMUTEX_DESTROY ZILMUTEX_LOCK ZI_LMUTEX_UNLOCK ZI_LTHREAD_START ZI_THREAD_JOIN ZI_SOCKET_INIT ZILSOCKET_CONNECT ZILHOSTNAME ZI_CONNECTION ZI_TIMEOUT ZILCOMMAND ZI_SERVER_INTERNAL ZI LENGTH ZI_FILE ZILDUPLICATE ZI_READONLY ZILMAX_ERROR Defines return value for all ziAPI functions Divided into 3 regions info warning and error enum ZIValueType_enum ZI_VALUE_TYPE_NONE ZI_VALUE_TYPE_DOUBLE_DATA Z VALUE_TYPE_DOUBLE_DATA_TS ZI_VALUE_TYPE_INTEGER_DATA ZI_VALUE_TYPE_INTEGER_DATA_TS ZI_VALUE_TYPE_DEMOD_SAMPLE ZI_VALUE_TYPE_AUXIN_SAMPLE ZI_VALU DIO_SAMPLE ZI_VALUE_TYPE_BYTE_ARRAY ZI_VALUE_TYPE_BYTE_ARRAY_TS ZI_VALUE_TYPE_TREE_CHANGE_DATA ZI_VALUE_TYPE_TREE_CHANGE_DATA_OLD ZI_VALUE_TYPE_SCOPE_WAVE ZI_VALUE_TYPE_SCOPE_WAVE_OLD mnnnmnmmnmmmmmmmm U m LabOne Programming Manual Revision 31421 Zurich Instruments 239 6 4 File Documentation Functions Z _VALUE_TYPE_PWA_WAVE ZI_DATA_NONE ZI_DATA_DOUBLE ZI_DATA_INTEGER Z _DATA_DEMODSAMPLE ZI_DATA_SCOPEWAVE Z _DATA_AUXINSAMP
97. Enum leafsonly gt 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree ziPython ziListEnum settingsonly gt 0x08 Returns only nodes which are marked as setting Or combinations of flags can be used progress progress ziPllAdvisor argl gt object Reports the progress of the command with a number between 0 and 1 read read ziPllAdvisor argl bool arg2 gt object Read pllAdvisor data If the simulation is still ongoing only a subset of the data is returned argl optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False read ziPllAdvisor argl gt object save save ziPllAdvisor argl str arg2 gt None Save PLL advisor data to file argl Reference to the ziPllAdvisor class arg2 File name string without extension sekilde set ziPllAdvisor argl str arg2 float arg3 gt None PLL Advisor Parameters Path name Type Description pllAdvisor bode struct Output parameter Contains the resulting bode plot of the PLL simulation pllAdvisor calculate int Command to calculate values Set to 1 to start the calculation pllAdvisor center double Center frequency of the PLL oscillator The PLL frequency shift is relative to this center frequency pllAdvisor d double Differential gain pllAdvisor demodbw double Demodulator band
98. Event programRT progress read 5 record setByte setDouble syncSetDouble setInt syncSetInt subscribe 5 sweep trigger unsubscribe update zoomFFT deviceSettings Preconditions ZI Server must be running check task manager 5 ziDAQ connect host 127 0 0 1 port 8005 apiLevel 11 host Server host string default is the localhost 5 port Port number double 5 Use port 8005 to connect to the HF2 Data Server 5 Use port 8004 to connect to the UHF Data Server apiLevel Compatibility mode of the API interface 5 Use API level 1 to use code written for HF2 5 Higher API levels are currently only supported 5 for UHF devices To get full functionality for 5 an UHF device use API level 5 5 To disconnect use clear ziDAQ result ziDAQ getConnectionAPILevel 5 Returns ziAPI level used for the active connection ZiDAQ connectDevice device interface 5 device Device serial string to connect e g DEV2000 5 interface Interface string e g USB 1GbE 1OGbE 5 Connect with the data server to a specified device over the specified interface The device must be visible to the server 5 If the device is already connected the call will be ignored 5 The function will block until the device is connected and 5 the device is ready to use This method is useful for UHF 5 devices offering several communication interfaces ZiDAQ disconne
99. IO ziDoubleType Double ziiIntegerType Integer TreeChange m ree ByteArrayData ByteArray ScopeWave Wave ziEvent Val Data Fields void Void DemodSample SampleDemod AuxInSample SampleAuxin DlOSample SampleDIO ziDoubleType Double zilntegerType Integer LabOne Programming Manual Revision 31421 Zurich Instruments 190 6 2 Module Documentation TreeChange Tree ByteArrayData ByteArray ScopeWave Wave LabOne Programming Manual Revision 31421 Zurich Instruments 191 6 2 Module Documentation Function Documentation ZiAPIAllocateEventEx ZlEvent ziAPlAllocateEventEx Allocates ZlEvent structure and returns the pointer to it Attention It is the client code responsibility to deallocate the structure by calling ziAPIDeallocateEventEx This function allocates a ZlEvent structure and returns the pointer to it Free the memory using ziAPIDeallocateEventEx See Also ziAPIDeallocateEventEx LabOne Programming Manual Revision 31421 Zurich Instruments 192 6 2 Module Documentation ziAPIDeallocateEventEx void ziAPIDeallocateEventEx ZlEvent ev Deallocates ZlEvent structure created with ziAPlAllocateEventEx Parameters in ev Pointer to ZlEvent structure to be deallocated See Also ziAPlAllocateEventEx This function is the compliment to ziAPlAllocateEventEx LabOne Programming Manual Revision 31421 Zurich Instrum
100. LE ZI_DATA_DIOSAMPLE ZI_DATA_BYTEARRAY ZILDATA_TREE_CHANGED Enumerates all types that data in a ZlEvent may have enum ZITreeAction_enum ZI_TREE_ACTION_REMOVE ZI_TREE_ACTION_ADD ZILTREE_ACTION_CHANGE Defines the actions that are performed on a tree as returned inthe ZlTreeChangeData action or Z lTreeChangeDataOld action enum ZIAPIVersion_enum ZI_API_VERSION_1 ZI_API_VERSION_4 enum ZlListNodes_enum ZI_LIST NODES_NONE ZI_LIST_NODES_RECURSIVE ZI_LIST_NODES_ABSOLUTE ZI_LIST_NODES_LEAFSONLY ZI_LIST_NODES_SETTINGSONLY ZI_LIST_NONE ZI_LIST_RECURSIVE ZI_LIST_ABSOLUTE ZI_LIST_LEAFSONLY ZI_LIST_SETTINGSONLY Defines the values of the flags used in ziAPIListNodes enum TREE_ACTION TREE_ACTION_REMOVE TREE_ACTION_ADD TREE_ACTION_CHANGE TREE_ACTION defines the values for the TreeChange Action Variable ZlResult_enum ziAPlIInit ZIConnection conn Initializes a ZIConnection structure ZlResult_enum ziAPIDestroy ZIConnection conn Destroys a ZIConnection structure ZlResult_enum ziAPIConnect ZIConnection conn const char hostname uint16_t port Connects the ZIConnection to Data Server ZlResult_enum ziAPIDisconnect ZIConnection conn Disconnects an established connection ZlResult_enum ziAPlListImplementations char implementations uint32_t bufferSize Returns the list of supported implementations ZlResult_enum ziAPIConnectEx ZIC
101. LabOne Programming Manual 1177 N Zurich Instruments LabOne Programming Manual Zurich Instruments AG Publication date Revision 31421 Copyright 2008 2015 Zurich Instruments AG The contents of this document are provided by Zurich Instruments AG ZI as is ZI makes no representations or warranties with respect to the accuracy or completeness of the contents of this publication and reserves the right to make changes to specifications and product descriptions at any time without notice LabVIEW is a registered trademark of National Instruments Inc All other trademarks are the property of their respective owners Revision History Revision 31421 8 Jul 2015 Update of the LabOne Programming Manual for LabOne Release 15 05 TheLabOne LabVIEW and C ziAPI APIs are now ziCore based m Additions and modifications for MFLI support Revision 28870 18 Mar 2015 Update of the LabOne Programming Manual for LabOne Release 15 01 m Added description of API Level 5 Revision 26206 01 Oct 2014 Update of the LabOne Programming Manual for LabOne Release 14 08 m Added PLL Advisor Module section to ziCore Modules Consistency update of ziCore Module parameters Improvements to plots in Software Trigger ziCore Module section Revision 23212 23 Apr 2014 First release of the LabOne Programming Manual Table of Contents LabOn Programming CONCEPTS a arretieren shelve enten wate eel de
102. NNECTION when the connection is invalid not connected or when a communication error occurred ZI_LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no value is attached to the node Zl TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void GetSample ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIAuxInSample LabOne Programming Manual Revision 31421 Zurich Instruments 313 6 4 File Documentation AuxInSample if RetVal ziAPIGetAuxInSample Conn DEV1046 auxins 0 sample amp AuxInSample ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf TS ch0 f chl f n float AuxInSample timeStamp AuxInSample cho AuxInSample chi See Also ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 314 6 4 File Documentation ziAPIGetValueB ZIResult_enum ziAPIGetValueB ZIConnection conn const char path unsigned ch
103. NROOT lib site packages zhinst JE Python ziPython 14 08 25901 Setup al Select Python Installations Select the Python locations where ziPython 14 08 25901 should be in EM Python 2 7 from registry z Python from another location Baci Figure 4 2 Windows ziPython installation Step 2 LabOne Programming Manual Revision 31421 Zurich Instruments 72 4 1 Installing the LabOne Python API J Python ziPython 14 08 25901 Setup es Install Python ziPython 14 08 25901 Please wait while the Installer installs Python ziPython 14 08 25901 This may take several minutes Status Validating install a Back _Next Figure 4 3 Windows ziPython installation Step 3 4 1 4 Linux Installation In addition to the requirements above and selecting the correct version of ziPython for your Python distribution 2 6 or 2 7 and platform 32 bit or 64 bit on Linux the correct Unicode version must also be installed This is because some Python distributions on Linux are compiled to use UCS 2 character encoding whereas some use UCS 4 Determining the correct Unicode version of ziPython for your Python distribution In order to determine which version of Unicode your Python distribution uses please type the following commands in the interactive shell of your target Python distribution gt gt gt import sys gt gt gt print sys maxunicode If the last command prints 65535 use the UCS 2
104. ONE amp amp Event gt count gt 0 process the received event here or else no more data is available so go on break Lif ziAPIUnSubscribe Conn J ZI INFO SUCCESS LabOne Programming Manual Revision 31421 Zurich Instruments 1 8 6 2 Module Documentation ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t unsubscribe s n ErrBuffer ZiAPIDeallocateEventEx Event LabOne Programming Manual Revision 31421 Zurich Instruments 179 6 2 Module Documentation Data Structure Documentation struct ZlEvent This struct holds event data forwarded by the Data Server include ziAPI h typedef struct ZIEvent uint32_t uint8 t void ZIDoubleData ZIIntegerData ZIValueType enum valueType count path 256 untyped doubleData ZIDoubleDataTS doubleDataTs integerData ZIIntegerDataTS integerDataTS ZIByteArray byteArray ZIByteArrayTS byteArrayTS ZITreeChangeData treeChangeData TreeChange treeChangeDataold ZIDemodSample demodSample LabOne Programming Manual Revision 31421 Zurich Instruments 180 6 2 Module Documentation Data Fields ZIAuxInSample auxInSample ZIDIOSample dioSample ZIScopeWave scopeWave ScopeWave scopeWaveOld ZIPWAWave pwaWave union ZIEvent 1 uint8 t zIEvent value data 0x400000 Z ValueType_enum valueType S
105. One User Interface UI is a Matlab V5 0 data file The LabOne UI saves the specified data using native Matlab data structures in the same format as are returned by commands in the LabOne Matlab API More specifically these data structures are nested Matlab structs the nested structure of which correspond to the location of the data in the instrument s node hierarchy Matlab structs are returned by scipy io loadmat as dictionaries the name of the struct becomes a key in the dictionary However as for all objects in MATLAB structs are in fact arrays of structs where a single struct is an array of shape 1 1 This means that each nested dictionary that is returned corresponding to a node in node hierarchy is loaded by scipy io loadmat as a 1 by 1 array and must be indexed as such See the Example section below For more information please refer to the following link http docs scipy org doc scipy reference tutorial io html matlab structs Example device dev88 See Further explanation above for a comment on the indexing timestamp data device 0 0 demods 0 0 sample 0 0 timestamp 0 x data device 0 0 demods 0 0 sample 0 0 x 0 y data device 0 0 demods 0 0 sample 0 0 y 0 import matplotlib pyplot as plt import numpy as np plt plot timestamp np abs x 1j y If multiple demodulator s are saved data from the second demodulator e g
106. PI includes utility functions and examples See Section 4 4 1 to see which examples are available in ziPython Section 4 4 2 to see which utility functions are available in ziPython Using the Built in Documentation ziPython s built in documentation can be accessed using the help command in a python interactive shell On module level gt gt gt import zhinst ziPython as ziPython gt gt gt help ziPython On class level for example for the Sweeper Module gt gt gt import zhinst ziPython as ziPython gt gt gt help ziPython ziDAOSweeper On function level for example for the ziDAQServer poll method gt gt gt import zhinst ziPython as ziPython gt gt gt help ziPython ziDAQServer poll See Section 4 4 LabOne Python API ziPython Command Reference fora printer friendly version of the built in documentation Running the Examples Prerequisites for running the Python examples 1 The zhinst package is installed as described above in Section 4 1 2 The Data Server program is running and the instrument is connected to the Data Server See Section 1 1 1 and the User Manual specific to the instrument for more help connecting 3 Signal Output 1 of the instrument is connected to Signal Input 1 via a BNC cable many of the Python examples measure on this hardware channel It s also recommended to install the Matplotlio Python package in order to plot the data obtained in many of the examples se
107. Programming Manual Revision 31421 Zurich Instruments 47 3 2 Getting Started with the LabOne Matlab API 3 Signal Output 1 of the instrument is connected to Signal Input 1 via a BNC cable many of the Matlab examples measure on this hardware channel See Section 3 2 1 fora list of available examples bundled with the LabOne Matlab API All the examples follow the same structure and take one input argument the device ID of the instrument they are to be ran with For example gt gt example sweeper dev123 The example should produce some output in the Matlab Command Window such as ziDAQ version Jul 7 2015 accessing server localhost 8005 Will run the example on dev123 an HF2LI with options MFK PLL MOD RTK PID Sweep progress 9 Sweep progress 19 Sweep progress 30 Sweep progress 42 Sweep progress 52 Sweep progress 58 Sweep progress 68 Sweep progress 79 Sweep progress 91 Sweep progress 100 ZiDAQ AtExit called Most examples will also plot some data in a Matlab figure see Figure 3 1 for an example If you encounter an error message please ensure that the above prerequisites are fulfilled and see Section 3 4 for help troubleshooting the error 0 5 T a T I EET Amplitude dBV ae ae ee EEE RTE Frequency Hz Phase deg Frequency Hz Figure 3 1 The plot produced by the LabOne Matlab API example example sweeper m the plots show the instruments demo
108. ROR_NOTFOUND if the given path could not be resolved or no value is attached to the node Z ERROR TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIIntegerData Valuel if RetVal ziAPISetValueD Conn LabOne Programming Manual Revision 31421 Zurich Instruments 307 6 4 File Documentation DEV1046 demods rate 5 53 I ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValuel Conn DEV1046 demods 0 rate amp Valuel ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n float Valuel See Also ziAPISetValuel ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 308 6 4 File Documentation ziAPIGetDemodSample ZIResult_enum ziAPIGetDemodSample ZIConnection conn const char path ZIDemodSample value Paramet Returns Gets the demodulator sample value of the specified node This function retrieves the value of the specified node as an DemodSample struct The value first found is returned if more than one value is available a wildcard is used in the path This function is onl
109. Result_enum ziAPIDisconnect ZIConnection conn Disconnects an established connection Disconnects from Data Server If the connection has not been established and the function is called it returns without doing anything Parameters lin conn Pointer to ZIConnection to be disconnected Returns Z _INFO_SUCCESS See Also ziAPIConnect ziAPlInit ziAPIDestroy See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 131 6 2 Module Documentation ziAPlListImplementations ZIResult_enum ziAPIListlmplementations char implementations uint32_t bufferSize Returns the list of supported implementations Returned names are defined by implementations in the linked library and may change depending on software version Parameters out implementations Pointerto a buffer receiving a newline delimited listofthenames of all the supported ziAPI implementations The string is zero terminated lin bufferSize The size of the buffer assigned to the implementations parameter Returns ZI INFO SUCCESS on success Z ERROR LENGTH if the length of the char buffer given by MaxLen is too small for all elements See Also ziAPIConnectEx LabOne Programming Manual Revision 31421 Zurich Instruments 132 6 2 Module Documentation ziAPICon nectEx ZIResult_enum ziAPIConnectEx ZIConnection conn const char hostname uint16_t port ZIA Paramet PlVersion_enum apiLevel
110. SUCCESS on success Z _ERROR_HOSTNAME if the given host name could not be found Z _FRROR_SOCKET_CONNECT if no connection could be established Z _FRROR_OVERFLOW when a FIFO overflow occurred ZI _FRROR_SOCKET_INIT if initialization of the socket failed Z ERROR CONNECTION when the Data Server didn t return the correct answer or requested implementation is not found or doesn t support requested ziAPI level 7 _ERROR_TIMEOUT when initial communication timed out See Also ziAPlListImplementations ziAPIConnect ziAPIDisconnect ziAPlInit ziAPIDestroy ziAPIGetConnectionVersion LabOne Programming Manual Revision 31421 Zurich Instruments 296 6 4 File Documentation See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 297 6 4 File Documentation ziAPlGetConnectionAPlLevel ZIResult_enum ziAPIGetConnectionAPlLevel ZIConnection conn ZIAPIVersion_enum apiLevel Returns ziAPI level used for the connection conn Parameters lin conn Pointer to ZIConnection out apiLevel Pointer to preallocated ZIAPIVersion_enum receiving the ziAPI level Returns 7Z _INFO_SUCCESS on success Z ERROR CONNECTION if level can not be determined due to conn is not connected See Also ziAPIConnectEx ziAPIGetVersion LabOne Programming Manual Revision 31421 Zurich Instruments 298 6 4 File Documentation ziAPIGetRevision ZIResult_enum ziAPIGetRevision unsigned int revisi
111. Server class arg2 Flags LOG_NONE 0x00000000 LOG SET DOUBLE 0x00000001 LOG SET INT 0x00000002 LOG SET BYTE 0x00000004 LOG SYNC SET DOUBLE 0x00000010 LOG SYNC SET INT 0x00000020 LOG SYNC SET BYTE 0x00000040 LOG_GET DOUBLE 0x00000100 LOG GET INT 0x00000200 LOG_GET BYTE 0x00000400 LOG GET DEMOD 0x00001000 LOG GET DIO 0x00002000 LOG GET AUXIN 0x00004000 LOG LISTNODES 0x00010000 LOG SUBSCRIBE 0x00020000 LOG UNSUBSCRIBE 0x00040000 LOG GET AS EVENT 0x00080000 LOG_UPDATE 0x00100000 LOG POLL EVENT 0x00200000 LOG POLL 0x00400000 LOG ALL Oxffffffff arg3 Log file name arg4 Log style LOG STYLE TELNET 0 default LOG_STYLE MATLAB Ly LOG_STYLE_PYTHON 2yrs logOn ziDAQServer argl int arg2 str arg3 gt None pidAdvisor pidAdvisor ziDAQServer argl long arg2 gt ziPidAdvisor Create a pidAdvisor class This will start a thread for running an asynchronous pidAdvisor argl Reference to the ziDAQServer class LabOne Programming Manual Revision 31421 Zurich Instruments 89 4 4 LabOne Python API ziPython Command Reference arg2 Timeout in ms Recommended value is 500ms pllAdvisor pllAdvisor ziDAQServer argl long arg2 gt ziPllAdvisor Create a pllAdvisor class This will start a thread for running an asynchronous pllAdvisor argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms
112. T see ZIResult_enum ZI_MUTEX_LOCK see ZIResult_enum ZI_MUTEX_UNLOCK see ZIResult_enum ZI_NOTFOUND see ZIResult_enum Z _OVERFLOW see ZIResult_enum Z _READONLY see ZIResult_enum ZI SERVER INTERNAL see ZIResult_enum ZI SOCKET CONNECT see ZIResult_enum Z _SOCKET_INIT see ZIResult_enum ZI_SUCCESS see ZIResult_enum ZI_THREAD_JOIN see ZIResult_enum ZI_THREAD_START see ZIResult_enum ZI_TIMEOUT see ZIResult_enum ZI TREE ACTION ADD see ZITreeAction_enum ZI_ TREE ACTION CHANGE see Z TreeAction_enum see see see see ZI_TREE_ACTION_REMOVE see Z TreeAction_enum Z _UNDERRUN see ZIResult_enum ZI_USB see ZIResult_enum ZI_VALUE_TYPE_AUXIN_SAMPLE see Z ValueType_enum ZI_VALU E_TYPE BYTE_ARRAY Z lValue ZI_VALU um BYTE_ARRAY_TS ZIVa ZI_VALU uel um DEMOD_SAMPLE ZIVa ZI_VALU uel um DIO_SAMPLE ZIVa ZI_VALU uel um DOUBLE_DATA ZIVa ZI_VALU uel um DOUBLE_DATA_TS Z Va ZI_VALU uel um INTEGER_DATA ZIVa ZI_VALU uel um INTEGER_DATA_TS ZIVa ZI_VALU uel um ZI_VALU PWA_WAVE ZlValue ZI_VALU Type_en E_TYPE um SCOPE_WAVE ZlValue ZI_VALU Type_en E_TYPE um SCOPE_WAVE_OLD Z lValue ZI_VALU Type_en E_TYPE um TREE_CHANGE_DATA Z lValue ZI_VALU Type_en E_TYPE um TREE_CHANGE_DATA_OLD
113. TS f X f Y f n float Event gt value LabOne Programming Manual Revision 31421 Zurich Instruments 183 6 2 Module Documentation demodSample j timeStamp Event gt value demodSample j x Event gt value demodSample j y break case ZI VALUE TYPE TREE CHANGE DATA printf Su elements of tree changed data s n Event gt count Event gt path for j 0 j lt Event gt count 7 j switch Event gt value treeChangeDataold le Action case ZI_TREE ACTION REMOV en printf Tree removed s n Event gt value treeChangeDataold jl Name break case ZI TREE ACTION ADD printf treeChangeDataOld added s n Event gt value treeChangeDataold LabOne Programming Manual Revision 31421 Zurich Instruments 184 6 2 Module Documentation break case ZI TREE ACTION CHANGE printf treeChangeDataOld changed s n Event gt value treeChangeDataold Jls Name break break default printf Unexpected event value type d n Event gt valueType break See Also ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx LabOne Programming Manual Revision 31421 Zurich Instruments 185 6 2 Module Documentation struct ziEvent This struct holds event data forwarded by the Data Server Deprecated See ZlEvent include ziAPI h typedef struct ziEvent
114. Val char ErrBuffer ZIDoubleData ValueD LabOne Programming Manual Revision 31421 Zurich Instruments 161 6 2 Module Documentation if RetVal ziAPISetValuel Conn DEV1046 demods rate 100 ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValueD Conn DEV1046 demods 0 rate amp ValueD ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n ValueD See Also ziAPIGetValuel ziAPISyncSetValuel LabOne Programming Manual Revision 31421 Zurich Instruments 162 6 2 Module Documentation ziAPISetVal ueB ZIResult_enum ziAPISetValueB ZIConnection conn const char path unsigned char buffe asy r unsigned int length nchronously sets the binary type value of one ore more nodes specified in the path This function sets the values at the nodes specified in a path More than one value can be set ifa wildcard is used The function sets the value asynchronously which means that after the function returns you have no security to which value it is finally set nor at what point in time it is set Parameters lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set lin buffer Pointer to the b
115. Width il 6 PH trigger O spurce 2 tfigger 0 pulse min 0 00 Ni t j trigger O highlevel 2 Path amp Source Edge 2 trigger 0 edge 3 Hysteresis l TA penn a O Tu Peine m 5 trigger O level 2 DD TriggerLevel TW za ee ET OL on Ws Ta OR Or AK 0 MA _ _ I ALLE vi NE LAT hd MN En In Wy N NN i N WEIN PAN VY ij IM I l Hysteresidt If l i IHN Vy u j 2 b vi Bandwidth 4 trigger 0 bandwidth 500 0 10 20 30 40 50 60 70 80 90 100 Time ms ze ee Figure 2 10 Explanation of the Software Trigger parameters for a positive or negative Pulse Trigger rigger O duration 0 018Dyration trigger 0 holdoff count 0 Duration oo Hold off Count Hold off Time 18 nd trigger O holdoff time 0 035 16 E Delay 44 figger Ofdelay 0 011 Signal Filtered cut off 10Hz 12 gt 17 ooe Hysteresis 2 5 a ur 510 Wh Hysteresis gagger ypath Idev42 demods 0 sample m trigger 0 source wg L 1 Path amp Source T gt g EL an D T N en Min IN rt gt i I on C l Bandwidth 2 trigger 0 bandwidth 10 0 10 20 30 40 50 60 70 80 90 100 Time ms Figure 2 11 Explanation of the Software Trigger Module s parameters for a Tracking Trigger Table 2 6 Software Trigger Input Parameters Setting Path Type Unit D
116. X demods 0 adeselect is the leaf that controls the setting corresponding to the choice of signal input for the first demodulator To set the index of the signal input the user writes to this node The leaf devX demods 0 sample is the leaf where the demodulator s output timestamp demodulated x value demodulated y value are written at the frequency specified by devX demods 0 rate In order to obtain the demodulator output you read the values from this node by polling this node Polling a node sends a request from the client to ziServer to obtain the data from the node at that particular point in time Note The numbering on the front panel of the UHFI MFLI and HF2 Instruments and the block numbering in the graphical user interfaces generally start with 1 1 based indexing Note that when accessing settings and data via a software interface the numbering starting with O O based indexing Note Auseful method to learn about the nodes of your instrument is to look at the output of the history in the bottom of the graphical user interface The status line always shows the last applied command and you can view the entire history by clicking the Show Log or Show History button You will find paths like LabOne Programming Manual Revision 31421 Zurich Instruments 12 1 4 Finding settings The Node Hierarchy devx sigins 0 ac 1 after you switched on the AC mode for signal input 1 or devx demods 1 rate 7200 000000 afte
117. Z ByteArray struct ziEvent This struct holds event data forwarded by the Data Server Deprecated See ZlEvent union ziEvent Val define MAX_PATH_LEN 256 The maximum length that has to be used for passing paths to functions including terminating zero define MAX_EVENT_SIZE 0x400000 The maximum size of an event s data block typedef ZIConnection LabOne Programming Manual Revision 31421 Zurich Instruments 238 6 4 File Documentation The ZIConnection is a connection reference it holds information and helper variables about a connection to the Data Server There is nothing in this reference which the user user may use so it is hidden and instead a dummy pointer is used See ziAPIInit for how to create a ZIConnection Enumerations enum ZlResult_enum ZI_INFO_BASE ZI_INFO_SUCCESS ZI_INFO_MAX ZILWARNING_BASE Zl WARNING GENERAL ZI_WARNING_UNDERRUN ZI WARNING _OVERFLOW Zl WARNING _NOTFOUND ZI_WARNING_MAX ZI_ERROR_BASE ZILERROR_GENERAL ZILERROR_USB ZI_LERROR_MALLOG ZI_ERROR_MUTEX_INIT ZI_LERROR_MUTEX_DESTROY ZILERROR_MUTEX_LOCK ZI_LERROR_MUTEX_UNLOCK ZILERROR_THREAD_START ZI_LERROR_THREAD_JOIN ZILERROR_SOCKET_INIT ZI_LERROR_SOCKET_CONNECGT ZILERROR_HOSTNAME ZI_LERROR_CONNECTION ZILERROR_TIMEOUT ZI_LERROR_COMMAND ZI_LERROR_SERVER_INTERNAL ZI_LERROR_LENGTH ZI_ERROR_FILE ZILERROR_DUPLICATE ZI_LERROR_READONLY ZILERROR_DEVICE_NOT_VISIBLE ZI_ERROR_DEVICE_IN_USE ZILERROR_DEVICE_INTERFACE ZI_L
118. ZI LIST LEAFSONLY 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree int64 8 gt ZI LIST SETTINGSONLY 0x08 Returns only nodes which are marked as setting Or combinations of flags might be used ziDAQ subscribe handle path Subscribe to one or several nodes After subscription the recording process can be started with the execute command During the recording process paths can not be subscribed or unsubscribed handle Reference to the ziDAQSweeper class path Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified ziDAQ unsubscribe handle path Unsubscribe from one or several nodes During the recording process paths can not be subscribed or unsubscribed handle Reference to the ziDAQSweeper class path Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified ZiDAQ execute handle Start the sweep Subscription or unsubscription is no more possible until the sweep is finished ZiDAQ finished handle handle Handle of the sweep session Returns 1 if the sweep is finished otherwise 0 ZiDAQ read handle handle Handle of the sweep session Transfer the sweep data to Matlab ziDAQ progress handle Report the progress of the measurement with a number between 0 and 1 ZiDAQ finish
119. abOne Matlab API directory to access the following contents interactively in Matlab oe ziDAQ The LabOne Matlab API for interfacing with Zurich Instruments Devices oo de FILES ziAddPath add the LabOne Matlab drivers utilities and examples to Matlab s Search Path for the current session README txt a README briefly describing how to get started with ziDAQ de do oo de DIRECTORIES 5 Driver contains Matlab driver for interfacing with Zurich Instruments devices 5 Utils contains some utility functions for common tasks Examples contains examples for performing measurements on Zurich 5 Instruments devices DRIVER Driver ziDAQ m ziDAQ command reference documentation Driver ziDAQ mex ziDAQ API driver UTILS 5 Utils ziAutoConnect create a connection to a Zurich Instruments 5 server 5 Utils ziAutoDetect return the ID of a connected device if only one device is connected Utils ziDevices return a cell array of connected Zurich Instruments devices 5 Utils ziCheckPathInData check whether a node is present in data and non empty EXAMPLES COMMON Examples that will run on any Zurich Instruments Device oo le example connect A simple example to demonstrate how to connect to a Zurich Instruments device example connect config Connect to and configure a Zurich Instruments device example poll Record demodulator data using ziDAQServer s synchronous p
120. al sample count considered for PWA ut selection used for the PWA Oscillator used for the PWA LabOne Programm ing Manual Revision 31421 Zurich Instruments 260 6 4 File Documentation uint32_t harmonic Harmonic setting uint32_t binCount Bin count of the PWA double frequency Frequency during PWA accumulation uint8_t pwalype Type of the PWA uint8_t mode PWA Mode 0 zoom PWA 1 harmonic PWA uint8_t overflow Overflow indicators overflow 0 Data accumulator overflow overflow 1 Counter at limit overflow 6 2 Reserved overflow 7 Invalid missing frames uint8_t commensurable Commensurability of the data uint32_t reservedUInt Reserved unsigned int Z IPWASample data PWA data vector LabOne Programming Manual Revision 31421 Zurich Instruments 261 6 4 File Documentation struct ZlEvent This struct holds event data forwarded by the Data Server include ziAPI h typedef struct ZIEvent uint32_t uint8 t void ZIDoubleData ZIIntegerData ZIValueType enum valueType count path 256 untyped doubleData ZIDoubleDataTS doubleDataTS integerData ZIIntegerDataTS integerDataTS AlByteArray byteArray ZIByteArrayTS byteArrayTS ZITreeChangeData treeChangeData TreeChange treeChangeDataold ZIDemodSample demodSample ZIAuxInSample auxInSample LabOne P
121. alues at the nodes specified in a path More than one value can be set if a wildcard is used This function sets the value synchronously After returning you know that it is set and to which value it is set ers lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set lin buffer Pointer to the byte array with the data in length Length of the data in the buffer lin bufferSize Length of the data in the buffer Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z READONLY on attempt to set a read only node Z COMMAND on an incorrect answer of the server ZI SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values Z _TIMEOUT when communication timed out See Also ziAPIGetValueB ziAPISetValueB LabOne Programming Manual Revision 31421 Zurich Instruments 325 6 4 File Documentation ziAPISync ZlResult_enum ziAPISync ZIConnection conn Synchronizes the session by dropping all pending data This function drops any data that is pending for transfer Any data including poll data retrieved afterwards is guaranteed to be produced not
122. alues for the Sweep Parameter The Sweeper will change the sweep parameter s value sweep samplecount times within the range of values specified by sweep start and sweep stop The sweep xmapping parameter specifies whether the spacing between two sequential values in the range is linear 0 or logarithmic 1 Controlling the Scan mode The Selection of Range Values The sweep scan parameter defines the order that the values in the specified range are written to the sweep parameter In sequential scan mode 0 the sweep parameter s values change incrementally from smaller to larger values see Figure 2 3 In binary scan mode 1 the first sweep parameter s value is taken as the value in the middle of the range then the range is split into two halves and the next two values for the sweeper parameter are the values in the middle of those halves This process continues until all the values in the range were assigned to the sweeper parameter see Figure 2 5 Binary scan mode ensures that the sweep parameter uses values from the entire range near the beginning of ameasurement which allows the user to get feedback quickly about the measurement s entire range Since the Sweeper Module is an asynchronous interface it s possible to continuously read and plot data whilst the sweep measurement is ongoing and update points in a graph dynamically In bidirectional scan mode 2 the sweeper parameter s values are first set from smaller to larger values as
123. ample LabOne Programming Manual Revision 31421 Zurich Instruments 129 6 2 Module Documentation ziAPICon nect ZlResult_enum ziAPIConnect ZIConnection conn const char hostname uint16_t port Paramet Returns Connects the ZIConnection to Data Server Connects to Data Server using a ZlConnection and prepares for data exchange For most cases it is enough to just give a reference to the connection and give NULL for hostname and 0 for the port so it connects to localhost on the default port ers lin conn Pointer to ZIConnection with which the connection should be established in hostname Name of the Host to which it should be connected if NULL localhost will be used as default lin port The Number of the port to connect to If 0 default port of the local Data Server will be used 8005 ZI INFO SUCCESS on success ZI_ERROR_HOSTNAME if the given host name could not be found ZI ERROR SOCKET_CONNECT if no connection could be established 7 _ERROR_OVERFLOW when a FIFO overflow occurred Z FRROR_SOCKET_INIT if initialization of the socket failed 7 _ERROR_CONNECTION when the Data Server didn t return the correct answer 7 _ERROR_TIMEOUT when initial communication timed out See Also ziAPlDisconnect ziAPIInit ziAPIDestroy See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 130 6 2 Module Documentation ziAPIDisconnect Zl
124. ample the output argument contains a nested struct in which the data can be accessed by data ziDAQ poll poll length poll timeout x data dev123 demods 4 sample x y data dev123 demods 4 sample y The instrument s node tree uses zero based indexing Matlab uses one based indexing See the tip Data Structures returned by ziDAQ The fourth demodulator sample located at dev123 demods 3 sample is indexed in the data structure returned by poll as data dev123 demods 4 sample Explicitly convert uint 64 data types to double Matlab s native data type is double precision floating point and doesn t support performing calculations with with other data types such as 64 bit unsigned integers for example gt gt a uint64 2 b uint64 1 a b Undefined function or method minus for input arguments of type uint64 Due to this limitation be sure to convert demodulator timestamps to double before performing calculations For example in the following both clockbase and timestamp both 64 bit unsigned LabOne Programming Manual Revision 31421 Zurich Instruments 50 3 3 LabOne Matlab API Tips and Tricks integers need to be converted to double before converting the timestamps from the instrument s native ticks to seconds via the instrument s clockbase oe data ziDAQ poll 1 0 500 poll data sample data device demods 0 sample get the sample from the zeroth demod convert timestamps from
125. ance of ziPython ziDAQServer Example import zhinst utils dag zhinst utils autoConnect autoConnect not supported for MFLI devices device zhinst utils autoDetect daq get default settings path dag Return the default path used for settings by the ziDeviceSettings module Arguments LabOne Programming Manual Revision 31421 Zurich Instruments 82 4 4 LabOne Python API ziPython Command Reference daq instance of ziDAQServer A ziPython API session Returns settings path str The default ziDeviceSettings path load labone csv fname Load a CSV file containing generic data as saved by the LabOne User Interface into a numpy structured array Arguments filename str The filename of the CSV file to load Returns sample numpy ndarray A numpy structured array of shape num points whose field names correspond to the column names in the first line of the CSV file num points is the number of lines in the CSV file 1 Example import zhinst utils Load the CSV file of PID error data node dev2004 pids 0 error data zhinst utils load labone _csv dev2004 pids 0 error _00000 csv import matplotlib pyplot as plt Plot the error plt plot data timestamp data value load labone demod_csv fname column names chunk timestamp x y freq phase dio trigger auxin0 auxinl Load a CSV file containing demodulator samples as saved by the LabOne User Interface into a n
126. ar buffer unsigned int length unsigned int bufferSize gets the Bytearray value of the specified node This function retrieves the newest available DIO sample from the specified node The value first found is returned if more than one value is available a wildcard is used in the path Parameters Returns in conn Pointer to the ziConnection with which the value should be retrieved lin path Path to the Node holding the value out buffer Pointer to a buffer to store the retrieved data in out length Pointer to an unsigned int to store the length of data in if an error ocurred or the length of the passed buffer dosn t reach a zero will be returned lin bufferSize The length of the passed buffer m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no value is attached to the node 7 _TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h LabOne Programming Manual Revision 31421 Zurich Instruments 315 6
127. asurement Subscription or unsubscription is no more possible until the recording is finished ziDAQ trigger handle handle Handle of the recording session riggers the measurement recording de de dE AP AP AP AP P AP AP AP CP OP P DO AP AP OO m result ziDAQ finished handle handle Handle of the recording session Returns 1 if the recording is finished otherwise 0 result ziDAQ read handle handle Handle of the recording session Transfer the recorded data to Matlab ZiDAQ finish handle Stop recording The recording may be restarted by calling execute again result ziDAQ progress handle Report the progress of the measurement with a number between 0 and 1 ZiDAQ clear handle handle Handle of the recording session Stop recording Sweep Module de de dE AP AP AP AP AP AP AP AP OP OP AP dE AP AP OP OP AP AP P P de Sweep Parameters used for sweeping For frequency sweep applications this will be e g oscs 0 freq The device name of the path can be omitted and is given by sweep device sweep loopcount int Number of sweep loops default 1 sweep endless int Endless sweeping default 0 0 Use loopcount value 1 Endless sweeping enabled ignore sweep device string Device that should be used for 5 the parameter sweep e g dev99 sweep start double Sweep start frequency Hz sweep stop double Sweep stop frequency Hz sweep gridno
128. ated in the instr lib directory that are named either m Zurich Instruments HF2 or m Zurich Instruments LabOne These folders may simply be deleted administrator rights required 2 On Windows navigate to the API LabVIEW subdirectory of your LabOne installation typically found at C Program Files Zurich Instruments LabOne API LabVIEW and copy the subdirectory located there Zurich Instruments LabOne to the instr 1ib directory in your LabVIEW installation as located in Step 1 Note you will need administrator rights to copy to this directory 3 Restart LabVIEW and verify your installation as described in Section 5 1 4 5 1 3 Linux 1 Locate the instr 1lib directory in your LabVIEW installation and remove any previous Zurich Instruments API installations The instr lib directory is typically located at usr local natinst LabVIEW 201x instr lib Previous Zurich Instruments installations will be folders located in the instr 1lib directory that are named either LabOne Programming Manual Revision 31421 Zurich Instruments 114 5 1 Installing the LabOne LabVIEW API m Zurich Instruments HF2 or m Zurich Instruments LabOne These folders may simply be deleted administrator rights required 2 Navigate to the path where you unpacked LabOne and locate the subdirectory PATH LabOneLinux64 API LabVIEW 3 Copy the directory PATH LabOneLinux64 API LabVIEW Zurich Instruments LabOne
129. ated in the node hierarchy as dev123 demods 3 sample the output argument contains a tree of nested dictionaries in which the data can be accessed by data dag poll poll length poll timeout x data dev123 demods 4 sample x y data dev123 demods 4 sample y Tell poll to return a flat dictionary By default the data returned by poll is contained in a tree of nested dictionaries that closely mimics the tree structure of the instrument node hierarchy By setting the optional fifth argument of poll to True the data will be a flat dictionary This can help avoid many nested if statements in order to check that the expected data was returned by poll For example daq subscribe dev123 demods 0 sample flat dictionary key False data dag poll 0 1 200 1 flat dictionary key if dev123 in data if demods in data device if 0 in data device demods access the demodulator data x data dev123 demods 0 sample y data dev123 demods 0 sample Could be rewritten more concisely as daq subscribe dev123 demods 0 sample flat_dictionary key True data dag poll 0 1 200 1 flat dictionary key if dev123 demods 0 sample in data access the demodulator data x data dev123 demods 0 sample y data dev123 demods 0 sample 1 al x y Use the Utility Routines to load Data saved from the LabOne UI and ziControl in Python
130. ath for j 0 j lt Event gt count 7 j printf Sf n float Event gt value integerData 1319 break case ZI VALUE TYPE DEMOD SAMPLE printf u elements of sample data s n Event gt count Event gt path 7 for j 0 j lt Event gt count 7 J printf TS f X f Y f n float Event gt value demodSample j timeStamp LabOne Programming Manual Revision 31421 Zurich Instruments 265 6 4 File Documentation Event gt value demodSample j x Event gt value demodSample j Y break case ZI VALUE TYPE TREE CHANGE DATA printf u elements of tree changed data s n Event gt count Event gt path for j 0 j lt Event gt count 7 j switch Event gt value treeChangeDataold jl Action case ZI TREE ACTION REMOVE E printf Tree removed s n Event gt value treeChangeDataold j1 Name break case ZI_TREE_ACTION_ADD printf treeChangeDataOld added s n Event gt value treeChangeDataold jl Name i break LabOne Programming Manual Revision 31421 Zurich Instruments 266 6 4 File Documentation case ZI TREE ACTION CHANGE printf treeChangeDataOld changed s n Event gt value treeChangeDataold BIE Name break break default printf Unexpected event value type d n Event gt valueType break See Also
131. ation union ziEvent Val typedef union ziEvent Val void Void DemodSample SampleDemod AuxInSample SampleAuxIn DIOSample SampleDIO ziDoubleType Double ziIntegerType Integer TreeChange m Bee ByteArrayData ByteArray ScopeWave Wave ziEvent Val Data Fields void Void DemodSample SampleDemod AuxlnSample SampleAuxin D OSample SampleDIO z iDoubleType Double zilntegerType Integer LabOne Programming Manual Revision 31421 Zurich Instruments 279 6 4 File Documentation TreeChange Tree ByteArrayData ByteArray ScopeWave Wave LabOne Programming Manual Revision 31421 Zurich Instruments 280 6 4 File Documentation Enumeration Type Documentation enum ZlResult_enum Defines return value for all ziAPI functions Divided into 3 regions info warning and error Enumerator ZI_INFO_BASE ZI_INFO_SUCCESS Success no error Z _INFO_MAX Zl WARNING BASE Z WARNING GENERAL Warning general Z WARNING _UNDERRUN FIFO Underrun Z WARNING OVERFLOW FIFO Overflow Z WARNING NOTFOUND Value or Node not found ZI_WARNING_MAX ZI ERROR BASE ZI ERROR_GENERAL Error general Z ERROR USB USB Communication failed ZI ERROR_MALLOC Memory allocation failed ZI ERROR_MUTEX_INIT Unable to initisalize mutex ZI ERROR MUTEX_DESTROY Unable to destroy mutex
132. ation is in the Matlab Search Path by using the command gt gt path and repeating the steps to configure Matlab s search path in Section 3 1 2 Error message Undefined function or method example_sweeper Matlab can not find the example Check whether the MATLAB2012 Examples Common subfolder respectively MATLAB2012 Examples UHF or MATLAB2012 Examples HF2 of your LabOne installation are in the Matlab Search Path by using the command gt gt path and repeating the steps to configure Matlab s search path in Section 3 1 2 Error message Error using zIDAQ ZIAPIException with status code 32870 Connection invalid The Matlab API can not connect to the Data Server Please check that the correct port was used that the correct server is running for your device and that the device is connected to the server see Section 1 1 1 Error Message Error using ziAutoConnect at 63 ziAutoConnect failed to find a running server or failed to find a connected a device The utility function ziAutoConnect located inMATLAB2012 Utils tries to determine which Data Server is running and whether any devices are connected to that Data Server It is only supported by UHFLI and HF2 Series instruments MFLI instruments are not supported Some suggestions to verify the problem m Please verify in the User Interface whether a device is connected to the Data Server running on your computer Ifthe Data Server is ru
133. ation of some files For help locating PYTHONROOT lib site packages zhinst on your system please see the section called Locating the zhinst Installation Folder and Examples Recommended Python Packages The following Python packages can additionally be useful for programming with the LabOne Python API 1 Matplotlib recommended to plot the output from many of ziPython s examples 2 SciPy recommended to load data saved from the LabOne UI in binary Matlab format mat Note Unofficial pre compiled 32 bit and 64 bit Windows binaries of NumPy SciPy and matplotlib are available from Christoph Gohlke s pythonlibs page LabOne Programming Manual Revision 31421 Zurich Instruments 71 4 1 Installing the LabOne Python API 4 1 3 Windows Installation To install zi Python on Windows execute the msi installer available from the Zurich Instruments download page login required It will guide you through the installation process as displayed in the following screenshots 15 Python ziPython 14 08 25901 Setup Es Select whether to install Python ziPython 14 08 25901 for all users of this computer Install just for me Baci Figure 4 1 Windows ziPython installation Step 1 If multiple Python Installations are available on your system the installer will ask which Python version the ziPython package should be installed The ziPython package will be installed in selected versions in the folder PYTHO
134. ble LabOne Programming Manual Revision 31421 Zurich Instruments 221 6 3 Data Structure Documentation zilntegerType Integer TreeChange Tree ByteArrayData ByteArray ScopeWave Wave LabOne Programming Manual Revision 31421 Zurich Instruments 222 6 3 Data Structure Documentation 6 3 15 struct ZlEvent This struct holds event data forwarded by the Data Server include ziAPI h typedef struct ZIEvent ZIValueType enum valueType uint32 t count uint8 t path 256 void untyped ZIDoubleData doubleData ZIDoubleDataTs doubleDataTS ZIIntegerData integerData ZIIntegerDataTS integerDataTS ZIByteArray byteArray ZIByteArrayTS byteArrayTS ZITreeChangeData treeChangeData TreeChange treeChangeDataOld ZIDemodSample demodSample ZIAuxInSample LabOne Programming Manual Revision 31421 Zurich Instruments 223 6 3 Data Structure Documentation auxInSample ZIDIOSample dioSample ZIScopeWave scopeWave ScopeWave scopeWaveOld ZIPWAWave pwaWave r union ZIEvent 1 uint8 t ZIEvent Data Fields value data 0x400000 Z ValueType_enum valueType Specifiesth e type of the data held by the ZlEvent uint32_t count Number of values available in this event uint8_t path The path to the node from which the event originates void untyped For convenience The void field doesn t have a corr
135. bscribe ZIConnection conn const char path unsubscribes to the nodes given by path 7Z Result enum ziAPIPollDataEx ZIConnection conn ZlEvent ev uint32_t timeOutMilliseconds checks if an event is available to read 7l Result_enum ziAPIGetValueAsPollData ZIConnection conn const char path triggers a value request which will be given back on the poll event queue 7Z Result enum ziAPIGetError ZlResult_enum result char buffer int base returns a description and the severity for a ZiResult_enum 7 Result_enum ReadMEMFile const char filename char buffer int32_t bufferSize int32_t bytesUsed ziEvent ziAPlAllocateEvent Deprecated See ziAPlAllocateEventEx void ziAPIDeallocateEvent ziEvent ev Deprecated See ziAPIDeallocateEventEx 7l Result_enum ziAPIPollData ZIConnection conn ziEvent ev int timeOut Checks if an event is available to read Deprecated See ziAPIPollDataEx 7Z Result enum ziAPIGetValueS ZIConnection conn char path DemodSample value 7l Result_enum ziAPIGetValueDIO ZIConnection conn char path DIOSample value 7l Result_enum ziAPlGetValueAuxln ZIConnection conn char path AuxInSample value double ziAPlSecondsTimeStamp ziTimeStampType TS Detailed Description ziAPI provides all functionality to establish a connection with the Data Server and to communicate with it It has functions for setting and getting parameters i
136. c behavior of a signal is important or separation of different signals is required In the context of a open loop or closed loop system the bandwidth can be used to indicate the fastest speed of the system or the highest signal update change rate that is possible with the system Sometimes the term bandwidth is erroneously used as synonym of frequency range See Also Noise Equivalent Power Bandwidth Bayonet Neill Concelman Connector LabOne Programming Manual Revision 31421 Zurich Instruments 346 CF Common Mode Rejection Ratio CMRR CSV D A DAC DC DDS DHCP DIO DNS DSP DUT Dynamic Reserve DR XML FFT FIFO FM Frequency Accuracy FA Frequency Modulated AFM FM AFM Clock Fail internal processor clock missing Specification of a differential amplifier or other device indicating the ability of an amplifier to obtain the difference between two inputs while rejecting the components that do not differ from the signal common mode A high CMRR is important in applications where the signal of interest is represented by a small voltage fluctuation superimposed on a possibly large voltage offset or when relevant information is contained in the voltage difference between two signals The simplest mathematical definition of common mode rejection ratio is CMRR 20 log differential gain common mode gain Comma Separated Values Digital to Analog Digital to Analog Converter Direct Current
137. ch Instruments 81 4 4 LabOne Python API ziPython Command Reference Returns A string specifying the first device ID not in exclude Raises RunTimeError If no device was found RunTimeError If daq is not an instance of ziPython ziDAQServer Example zhinst utils daq zhinst utils autoConnect device zhinst utils autoDetect daq check_for_sampleloss timestamps Check whether timestamps are equidistantly spaced it not it is an indication that sampleloss has occurred whilst recording the demodulator data This function assumes that the timestamps originate from continuously saved demodulator data during which the demodulator sampling rate was not changed Arguments timestamp numpy array a l dimensional array containing demodulator timestamps Returns idx numpy array a 1 dimensional array indicating the indices in timestamp where sampleloss has occurred An empty array is returned in no sampleloss was present devices daq Return a list of strings containing the device IDs that are attached to the Data Server connected via daq an instance of the ziPython ziDAQServer class Returns an empty list if no devices are found Args daq ziDAQServer An instance of the ziPython ziDAQServer class representing an API session connected to a Data Server Returns A list of strings of connected device IDs The list is empty if no devices are detected Raises RunTimeError If daq is not an inst
138. computer program called a server the Data Server The Data Server recognizes available instruments and manages all communication between the instrument and the host computer on one side and communication to all the connected clients on the other side This allows for A multi client configuration Multiple interfaces even from multiple computers on the network can access the settings and data on an instrument Settings are synchronized between all interfaces by the single instance of the Data Server A multi device setup Any of the Data Server s clients can access multiple devices simultaneously This software architecture is organized in layers see Figure 1 1 for a schematic of the software layers Matlab Python LabView FA e V7 5 pit ziDAQ API NZ eo API 8006 8006 Z Application Layer API Layer DLL Session Session N 4 LabOne Web Server N TCP 8004 TCP 8004 TCP 8004 8004 a API Session API Session API Session API Session ot eects Figure 1 1 Software architecture First we briefly explain some terminology that is used throughout this manual Hostcomputer The computer where the Data Server is running and that is directly connected to the instrument Multiple remote computers on a local area network can access the instrument by creating an API connection to the Data Server running on the host computer Data Server A
139. conds i trigger delay en Po ee trigger level Amplitude Vays 0 05 0 00 0 05 0 10 0 15 0 20 Time s Figure 2 7 The plot produced by example record edge trigger py an example distributed with the LabOne Python API The plot shows 10 bursts of data from a single demodulator each burst was recorded when the demodulator s R value exceeded a specified threshold using a positive edge trigger See Section 4 2 3 for help getting started with the Python examples LabOne Programming Manual Revision 31421 Zurich Instruments 32 2 4 Software Trigger Recorder Module See Table 2 6 for the input parameters to configure the Software Trigger s Module Note that some parameters effect all triggers e g trigger endless whereas some are configured on a per trigger basis e g trigger N duration where N is the index of the trigger starting at zero The data output when using the Software Trigger s read command has the same format as returned by ziCore s poll command trigger O duration 01Ruration trigger 0 holdoff count 0 Hold off Count Duration Hold off Time 12 trigger 0 holdoff time 0 035 10 fi t Signal 8 Filtered cut off 500Hz trigger 0 path dev42 demods 0 sample 6 trigger 0 source 2 gt trigger O hysteresis 2 Path amp Source Hysteresis C4 enen Meen a eenen en KK 5 trigger O level 2 no N 0 Nun HN AR Veal N rl y I
140. conn const char path ZllntegerData value Paramet Returns asynchronously sets an integer type value to one or more nodes specified in a path This function sets the values of the nodes specified in path to Value More than one value can be set if a wildcard is used The function sets the value asynchronously which means that after the function returns you have no security to which value it is finally set nor at what point in time it is set ers lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set lin value the int type value that will be written to the node s m Zl SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z READONLY on attempt to set a read only node Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values 7 _TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIDoubleData ValueD LabOne Programming Manual Revision 31421
141. ct a LabOne Programming Manual Revision 31421 Zurich Instruments 105 4 4 LabOne Python API ziPython Command Reference Data and other attributes inherited from Boost Python instance new lt built in method new __ of Boost Python class object gt Te new Sp gt a new object with type S a subtype of T 4 4 8 Help for ziPython s ziPllAdvisor class An instance of ziPllAdvisor is initialized using the pllAdvisor method from ziDAQServer gt gt gt help zhinst ziPython ziDAQServer pllAdvisor Help on method pllAdvisor in zhinst ziPython ziDAQServer zhinst ziPython ziDAQServer pllAdvisor pllAdvisor unbound zhinst ziPython ziDAQServer method pllAdvisor ziDAQServer argl long arg2 gt ziPllAdvisor Create a pllAdvisor class This will start a thread for running an asynchronous pllAdvisor argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms Reference help for the ziPllAdvisor class gt gt gt help zhinst ziPython ziPllAdvisor Help on class ziPllAdvisor in zhinst ziPython zhinst ziPython ziPllAdvisor class ziPllAdvisor Boost Python instance Method resolution order ziPllAdvisor Boost Python instance _ builtin_ object Methods defined here _ reduce__ lt unnamed Boost Python function gt clear clear ziPllAdvisor argl gt None End the pllAdvisor thread execute execute ziPllAdvisor argl gt None Starts the p
142. ct in which the value should be written Zl SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred ZI_LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no value is attached to the node 7 _TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void GetSample ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIAuxInSample LabOne Programming Manual Revision 31421 Zurich Instruments 155 6 2 Module Documentation AuxInSample if RetVal ziAPIGetAuxInSample Conn DEV1046 auxins 0 sample amp AuxInSample ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf TS ch0 f chl f n float AuxInSample timeStamp AuxInSample cho AuxInSample chi See Also ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 156 6 2 Module Documentation ziAPIGetValueB
143. ct type according to ZlEvent valueType field uint8_t data The raw value data Detailed Description ZIEvent is used to give out events like value changes or errors to the user Event handling functionality is provided by ziAPISubscribe and ziAPIUnSubscribe as well as ziAPIPollDataEx include lt stdio h gt include ziAPI h void ProcessEvent zIEvent Event unsigned int j switch Event gt valueType LabOne Programming Manual Revision 31421 Zurich Instruments 225 6 3 Data Structure Documentation case ZI VALUE TYPE DOUBLE DATA printf Su elements of double data s n Event gt count Event gt path for j 0 j lt Event gt count 7 jtt printf Sf n Event gt value doubleData ID break case ZI VALUE TYPE INTEGER DATA printf Su elements of integer data s n Event gt count Event gt path for j 0 j lt Event gt count 7 jtt printf Sf n float Event gt value integerData j break case ZI VALUE TYPE DEMOD SAMPLE printf Su elements of sample data s n Event gt count Event gt path for j 0 j lt Event gt count z J printf TS f X f Y f n float Event gt value LabOne Programming Manual Revision 31421 Zurich Instruments 226 6 3 Data Structure Documentation demodSample timeStamp value demodSample value demodSample j
144. ctDevice device device Device serial string of device to disconnect This function will return immediately The disconnection of 5 the device may not yet finished 5 result ziDAQ listNodes path flags int64 01 5 path Path string flags int64 0 gt ZI_LIST_NONE 0x00 5 The default flag returning a simple 5 listing if the given node int64 1 gt ZI LIST RECURSIVE 0x01 Returns the nodes recursively LabOne Programming Manual Revision 31421 Zurich Instruments 54 3 5 LabOne Matlab API ziDAQ Command Reference AP de AP dE dE AP AO AP AP AP AP AP AP OP AP AP AP OP CP DO DO AP AP P P AP AP OP P AP AP CP CP DO dE AP AP P P AP AP P P AP AP CP OP X X AP AP P oo Ale ao AP de AP oP cP AP AP oP oo Ale oe int64 2 gt ZI LIST ABSOLUTE 0x02 Returns absolute paths int64 4 gt ZI LIST LEAFSONLY 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree int64 8 gt ZI LIST SETTINGSONLY 0x08 Returns only nodes which are marked as setting Or combinations of flags might be used result ziDAQ getSample path path Path string Returns a single demodulator sample including DIO and AuxIn For more efficient data recording use subscribe and poll functions result ziDAQ getAuxInSample path path Path string Returns a single auxin sample The auxin data is averaged in contrast to
145. culates best bandwidth value Equivalent to the obsolete bandwidth 0 setting sweep order int Defines the filter roll off to use in Fixed bandwidth selection Valid values are between 1 6 dB octave and 8 48 dB octave An order of 0 triggers a read out of the order from the selected demodulator sweep maxbandwidth double Maximal bandwidth used in auto bandwidth mode in Hz The default is 1 25MHz sweep omegasuppression double Damping in dB of omega and 2omega components Default is 40dB in favor of sweep speed Use higher value for strong offset values or 30mega measurement methods sweep averaging tc double Min averaging time tc 0 no averaging see also time 5 low precision 15 medium precision 50 high precision de de dE AP AP AP AP AP AP AP AP OP OP AP AP AP AP OP P AP AP P P de is below 50 Hz This will improve the sweep speed at low frequencies as omega components do not need to be suppressed by the normal low pass filter sweep filename string This parameter is deprecated If specified i e not empty it enables automatic saving of data in single sweep mode sweep endless 0 5 sweep averaging sample int in samples to average 1 no averaging if averaging tc 0 sweep phaseunwrap bool Enable unwrapping of slowly changing phase evolutions around the 180 degree boundary sweep sincfilter bool Enables the sinc filter if the sweep frequency AP de dE AP AP AP AP OO sweep
146. d is returned if more than one value is available a wildcard is used in the path This function is only applicable to paths matching DEMODS 0 9 SAMPLE ers in conn Pointer to ZIConnection with which the value should be retrieved lin path Path to the node holding the value out value Pointer toa ZiIDemodSample struct in which the value should be written 7Z _INFO_SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred Z ERROR LENGTH if the path s length exceeds MAX_PATH_LEN Z _FRROR_OVERFLOW when a FIFO overflow occurred 7 _ERROR_COMMAND on an incorrect answer of the server Z _FRROR_SERVER_INTERNAL if an internal error occurred in Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved or no value is attached to the node Z _ERROR_TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void GetSample ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIDemodSample LabOne Programming Manual Revision 31421 Zurich Instruments 151 6 2 Module Documentation DemodSample if RetVal ziAPIGetDemodSample Conn DEV1046 demods 0 sample amp DemodSample ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf TS
147. d or unsubscribed argl Reference to the ziDAQZoomFFT class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified trigger trigger ziDAQZoomFFT argl gt None Execute a manual trigger unsubscribe unsubscribe ziDAQZoomFFT argl str arg2 gt None Unsubscribe from one or several nodes During the zoom FFT process paths can not be subscribed or unsubscribed argl Reference to the ziDAQZoomFFT class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified Data and other attributes defined here _ init lt built in function init gt Raises an exception This class cannot be instantiated from Python LabOne Programming Manual Revision 31421 Zurich Instruments 101 4 4 LabOne Python API ziPython Command Reference Data descriptors inherited from Boost Python instance dict _ weakref _ Data and other attributes inherited from Boost Python instance new lt built in method new of Boost Python class object gt T new S gt a new object with type S a subtype of T 4 4 7 Help for ziPython s ziDAQRecorder class An instance of ziDAQRecorder is initialized using the record method from ziDAQServer gt gt gt help zhinst ziPython ziDAQServer record Help on method record in zhinst ziPython ziDAQServer zhinst ziPython ziDAQServer record record
148. de ziAPI h typedef struct ZIByteArrayTS ZITimeStamp timeStamp uint32 t length uint8 t bytes 0 ZIByteArrayTS Data Fields ZITimeStamp timeStamp Time stamp at which the data was updated uint32_t length length of the data readable from the bytes field uint8_t bytes the data itself The array has the size given in length LabOne Programming Manual Revision 31421 Zurich Instruments 212 6 3 Data Structure Documentation 6 3 11 struct ZIDemodSample The structure used to hold data for a single demodulator sample include ziAPI h typedef struct ZIDemodSample ZITimeStamp timeStamp double x double y double frequency double phase uint32 t dioBits uint32 t trigger double auxInO double auxInl ZIDemodSample Data Fields 7 TimeStamp timeStamp The timestamp at which the sample has been measured double x X part of the sample double y Y part of the sample double frequency Frequency at that sample double phase Phase at that sample uint32_t dioBits the current bits of the DIO uint32_t trigger trigger bits double auxln0 LabOne Programming Manual Revision 31421 Zurich Instruments 213 6 3 Data Structure Documentati O 3 value of Aux input double auxln1 value of Aux input 1 LabOne Programming Manual Revision 31421 Zurich Instruments 214 6 3 Data Structure Documentation 6 3 12 struct ZIDIOSa
149. de string Path of the node that should be de dE dE AP X AP AP loopcount sweep samplecount int Number of samples per sweep sweep settling time double Settling time before measurement is performed in s sweep settling tc double Settling precision 5 low precision 15 medium precision 50 high precision sweep settling inaccuracy int Demodulator filter settling inaccuracy defining the wait time between a sweep parameter change and recording of the next sweep point Typical AP do AP AP oP oP AP dE LabOne Programming Manual Revision 31421 Zurich Instruments 59 3 5 LabOne Matlab API ziDAQ Command Reference inaccuracy values 10m for highest sweep speed for large signals 100u for precise amplitude measurements 100n for precise noise measurements Depending on the order the settling accuracy will define the number of filter time constants the sweeper has to wait The maximum between this value and the settling time is taken as wait time until the next sweep point is recorded de de dE W AP AP AP P P AP AP P OP P DO AP AP OO sweep xmapping int Sweep mode 0 linear 1 logarithmic sweep scan int Scan type 0 sequential 1 binary 2 bidirectional 3 reverse sweep bandwidth double Fixed bandwidth Hz 0 Automatic calculation obsolete sweep bandwidthcontrol int Sets the bandwidth control mode default 2 0 Manual user sets bandwidth and order 1 Fixed uses fixed bandwidth value 2 Auto cal
150. der to convert timestamps to seconds divide the timestamps by the value instrument s clockbase device node e g dev99 clockbase Converts a timestamp vector of uint64 ticks into a double vector of timestamps in seconds HF2 Series Synchronous Interface ZiDAQ poll duration double timeout int64 flags uint32 duration Recording time in s timeout Poll timeout in ms flags Flags that specify data polling properties de de dE AP AP AP AP P P AP AP OP P AP AO OP Bit 0 FILL Fill data loss holes Bit 1 ALIGN Align data of several demodulators Bit 2 THROW Throw if data loss is detected Records data for the specified time This function call is blocking Use the asynchronous interface for long recording durations result ziDAQ pollEvent timeout int64 timeout Poll timeout in ms Just execute a single poll command This is a low level AP do AP AP oP oP AP oO LabOne Programming Manual Revision 31421 Zurich Instruments 56 3 5 LabOne Matlab API ziDAQ Command Reference function The poll function is better suited for most cases a do de do Asynchronous Interface oo Jo Trigger Parameters trigger buffersize double Overwrite the buffersize s of the trigger object set when it was instantiated The recommended buffer size is 2 trigger 0 duration ao oe oo o 5 trigger device string The device ID to execute the software trigger 5 e g dev
151. device ID to perform the sweep on e g dev123 compulsory parameter sweep gridnode byte array Node The device parameter specified by node to be swept e g oscs 0 freq sweep start double Many The start value of the sweep parameter sweep stop double Many The stop value of the sweep parameter sweep samplecount uint64 Many The number of measurement points to set the sweep on sweep endless bool 7 Enable Endless mode run the sweeper continuously sweep averaging uint64 Samples Sets the number of data samples per sample sweeper parameter point that is considered inthe measurement The maximum of this value and sweep averaging tc is taken as the effective calculation time See Figure 2 2 sweep averaging tc double Seconds Sets the effective measurement time per sweeper parameter point that is considered inthe measurement The maximum between of this value and sweep averaging sample is taken as the effective calculation time See Figure 2 2 sweep uint64 Specify how the sweeper should specify bandwidthcontrol the bandwidth of each measurement point Automatic is recommended in particular for LabOne Programming Manual Revision 31421 Zurich Instruments 24 2 2 Sweeper Module Setting Path Type Unit Description logarithmic sweeps and assures the whole spectrum is covered 0 Manual the sweeper module leaves the demodulator bandwidth settings entirely untouched 1 Fixed
152. dulator output when performing a frequency sweep over a simple feedback cable LabOne Programming Manual Revision 31421 Zurich Instruments 48 3 2 Getting Started with the LabOne Matlab API 3 2 4 Note The examples serve as a Starting point for your own measurement needs However before editing the m files be sure to copy them to your own user space they could be overwritten upon updating your LabOne installation and give them a unique name to avoid name conflicts in Matlab Using ziCore Modules in the LabOne Matlab API In the LabOne Matlab API ziCore Modules are configured and controlled via Matlab handles For example in order to use the Sweeper Module a handle is created via gt gt timeout milliseconds 500 gt gt h ziDAQ sweep timeout milliseconds and the Module s parameters are configured using the set command and specifying the Module s handle with a path value pair for example gt gt ziDAQ set h sweep start 1 2e5 The parameters can be read back using the get command which supports wildcards for example gt gt sweep params ziDAQ get h sweep The variable sweep params now contains a struct of all the Sweeper s parameters The other main Module commands are used similarly e g ziDAQ execute h to start the sweeper See Section 2 1 2 for more help with Modules and a description of their parameters LabOne Programming Manual Revision 31421 Zurich Instruments 49
153. dule Documentation Function Documentation ziAPIList Nodes ZlResult_enum ziAPIListNodes ZIConnection conn const char path char nodes int buffe Paramet Returns rSize int flags Returns all child nodes found at the specified path This function returns a list of node names found at the specified path The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents The list is returned in a null terminated char buffer each element delimited by a newline If the maximum length of the buffer bufferSize is not sufficient for all elements nothing will be returned and the return value willbe ZI_LENGTH ers lin conn Pointer to the ZIConnection for which the node names should be retrieved lin path Path for which all children will be returned The path may contain wildcard characters out nodes Upon call filled with newline delimited list of the names of all the children found The string is zero terminated lin bufferSize The length of the buffer used for the nodes output parameter lin flags A combination of flags applied bitwise Jas defined in ZlListNodes_enum Z INFO SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred Z ERROR LENGTH if the path s length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by bufferSize is too small for all
154. e Figure 2 3 1 Binary Non sequential sweep continues increase of resolution over entire range see Figure 2 5 2 Bidirectional Sequential sweep from Start to Stop value and back to Start again Figure 2 4 sweep settling tc double TC Minimum wait time in factors of the time constant TC between setting the new sweep parameter value and the start of the measurement The maximum between this value and sweep settling time is taken as effective settling time See Figure 2 2 LabOne Programming Manual Revision 31421 Zurich Instruments 25 2 2 Sweeper Module Setting Path Type Unit Description sweep settling time double Seconds Minimum wait time in seconds between setting the new sweep parameter value and the start of the measurement The maximum between this value and sweep settling tc is taken as effective settling time See Figure 2 2 sweep settling inaccuracy double Demodulator filter settling inaccuracy defining the wait time between a sweep parameter change and recording of the next sweep point Typical inaccuracy values 10m for highest sweep speed for large signals 100u for precise amplitude measurements 100n for precise noise measurements Depending on the order the settling accuracy will define the number of filter time constants the sweeper has to wait The maximum between this value and the settling time is taken as wait time until the ne
155. e Section 4 1 2 The API examples are available in the module zhinst examples which is organized into sub modules according to the target Instrument class zhinst examples common examples compatible with with any class of instrument LabOne Programming Manual Revision 31421 Zurich Instruments 75 4 2 Getting Started with the LabOne Python API zhinst examples uhf examples only compatible with the UHF Lock in Amplifier zhinst examples hf2 examples only compatible with HF2 Series Instruments All the examples follow the same structure and take one input argument The device ID of the instrument to run the example with The recommended way to run a ziPython example is to import the example s module in an interactive shell and call the run_example function For example to run the zoomFFT Module example gt gt gt import zhinst examples gt gt gt Use do plot False if matplotlib is unavailable gt gt gt zhinst examples common example zoomfft run example dev123 do_plot True The example should produce some output in the Python shell such as Will perform 1 zoomFFTs Individual zoomFFT 100 00 complete sample contains 1 zoomFFTs Number of lines in first zoomFFT 65535 Most examples will also plot the retrieved data using matplotlib see Figure 4 4 for an example If you encounter an error message please ensure that the above prerequisites are fulfilled Results of zoomFFT Amplitude dBV An oO
156. e identifier e g dev99 arg2 File name of the RT program record record ziDAQServer argl float arg2 long arg3 int arg4 gt ziDAQRecorder Create a recording class This will start a thread for asynchronous recording argl Reference to the ziDAQServer class arg2 Maximum recording time for single triggers in s arg3 Timeout in ms Recommended value is 500ms arg4 optional Record flags FILL 0x0001 Fill holes ALIGN 0x0002 Align data that contains a timestamp THROW 0x0004 Throw EOFError exception if sample loss is detected record ziDAQServer argl float arg2 long arg3 gt ziDAQRecorder revision revision ziDAQServer argl gt int Get the revision number of the Python interface of Zurich Instruments LabOne Programming Manual Revision 31421 Zurich Instruments 90 4 4 LabOne Python API ziPython Command Reference argl Reference to the ziDAQServer class Seti set ziDAQServer argl object arg2 gt None argl Reference to the ziDAQServer class arg2 A list of path value pairs setByte setByte ziDAQServer argl str arg2 object arg3 gt None argl Reference to the ziDAQServer class arg2 Path string of the node setDebugLevel setDebugLevel ziDAQServer argl int arg2 gt None Enables debug log and sets the debug level argl Reference to the ziDAQServer class arg2 Debug level trace 0 info 1 debug 2 warning 3 error 4 fata
157. e returned out buffer A pointer to a char array to return the description May be NULL if no description is needed out base The severity for the provided Status parameter ZI INFO BASE for infos Z WARNING BASE for warnings ZI_ERROR_BASE for errors ZI_SUCCESS LabOne Programming Manual Revision 31421 Zurich Instruments 337 6 4 File Documentation ReadMEMFile ZlResult_enum ReadMEMFile const char filename char buffer int32_t bufferSize int32_t bytesUsed LabOne Programming Manual Revision 31421 Zurich Instruments 338 6 4 File Documentation ZiAPIAllocateEvent ziEvent ziAPlAllocateEvent Deprecated See ziAPlAllocateEventEx LabOne Programming Manual Revision 31421 Zurich Instruments 339 6 4 File Documentation ziAPIDeallocateEvent void ziAPIDeallocateEvent ziEvent ev Deprecated See ziAPIDeallocateEventEx LabOne Programming Manual Revision 31421 Zurich Instruments 340 6 4 File Documentation ziAPIPollData ZIResult_enum ziAPIPollData ZIConnection conn ziEvent ev int timeOut Checks if an event is available to read Deprecated See ziAPIPollDataEx Parameters lin conn Pointer to the ZIConnection for which events should be received out ev Pointer to a ziEvent struct in which the received event will be written in timeOut Time to wait for an event in milliseconds If 1 it will wait forever if O the function returns immediately R
158. e than one value can be set itis if a wildcard is used The function sets the value synchronously After returning you know that set and to which value it is set Parameters in Poi conn nter to the ziConnection for which the value s will be set in path Pa th to the Node s for which the value s will be set to value lin value Pointer to a double type containing the value to be written When the function returns value holds the effectively written value Returns See Also ziA ZI SUCCESS on success ZI_CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN Z _OVERFLOW when a FIFO overflow occurred ZI_READONLY on attempt to set a read only node ZI_LCOMMAND on an incorrect answer of the server ZI_SERVER_INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no node given by path is able to hold values ZI_TIMEOUT when communication timed out PlGetValueD ziAPISetValueD LabOne Progr amming Manual Revision 31421 Zurich Instruments 323 6 4 File Documentation ziAPISyncSetValuel ZIResult_enum ziAPISyncSetValuel ZIConnection conn const char path ZiintegerData value syn chronously sets an integer type value to one or more nodes specified ina path This function sets the values of the nodes specified in path to value More t
159. e your settings and rerun the PLL Advisor LabOne Programming Manual Revision 31421 Zurich Instruments 38 2 6 PLL Advisor Module Setting Path Type Unit Description pllAdvisor targetbw double Requested PLL bandwidth Higher frequencies may need manual tuning pllAdvisor targetfail bool Output parameter 1 indicates the simulated PLL BW is smaller than the Target BW LabOne Programming Manual Revision 31421 Zurich Instruments 39 2 7 Tips and Tricks 2 7 Tips and Tricks Use the LabOne User Interface s Command Log to start programming If you use the LabOne User Interface to perform a measurement you can obtain the commands sent to your instrument in the Command Log by clicking the Show Log button inthe status bar at the bottom of the User Interface Be sure to set the Log Format of the Command Log in the User Interface section of the Config Tab first The log is available in Matlab and Python formats and can be used as a starting point for your own custom program Use the included examples to get started programming Both the LabOne Matlab API and the LabOne Python API come with examples to help you get started programming In particular both APIs have at least one example for each of the ziCore modules Load LabOne User Interface settings files from the APIs The XML files used for device settings can be loaded and saved from the LabOne User Interface or fr
160. eArray The structure used to hold an arbitrary array of bytes This is the version without timestamp used in API Level 1 compatibility mode struct ZIByteArrayTS The structure used to hold an arbitrary array of bytes This is the same as ZlByteArray but with timestamp struct ScopeWave The structure used to hold a single scope shot API Level 1 If the client is connected to the Data Server using API Level 4 recommended if supported by your device class please see ZIScopeWave instead struct ZIScopeWave The structure used to hold scope data The data may be formatted differently depending on settings See the description of the structure members for details LabOne Programming Manual Revision 31421 Zurich Instruments 237 6 4 File Documentation Defines Typedefs truct ZIPWASample ingle PWA sample value an Oo truct ZIPWAWave WA Wave uo struct ZlEvent This struct holds event data forwarded by the Data Server struct DemodSample The DemodSample struct holds data for the ZI_DATA_DEMODSAMPLE data type Deprecated See ZIDemodSample struct AuxlnSample The AuxlnSample struct holds data for the ZI_DATA_AUXINSAMPLE data type Deprecated See ZlAuxInSample struct DIOSample The DIOSample struct holds data for the ZI_DATA_DIOSAMPLE data type Deprecated See ZIDIOSample struct ByteArrayData The ByteArrayData struct holds data for the ZI_DATA_BYTEARRAY data type Deprecated See
161. ecomes the demodulation frequency rather than 0 Hz handle ziDAQ zoomFFT timeout int64 timeout Poll timeout in ms Creates a zoom FFT class The thread is not yet started Before the thread start subscribe and set command have to be called To start the real measurement use the execute function AP de dE AP AP AP AP AP AP AP AP OP OP AP AP AP AP P P AP AP P OP de result ziDAQ listNodes handle path flags int64 0 path Path string flags int64 0 gt ZI LIST NONE 0x00 The default flag returning a simple listing if the given node int64 1 gt ZI LIST RECURSIVE 0x01 Returns the nodes recursively int64 2 gt ZI LIST ABSOLUTE 0x02 Returns absolute paths int64 4 gt ZI LIST LEAFSONLY 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree int64 8 gt ZI LIST SETTINGSONLY 0x08 Returns only nodes which are marked as setting Or combinations of flags might be used AP de dE AP AP AP AP AP de dE AP AO AAP AP ziDAQ subscribe handle path Subscribe to one or several nodes After subscription the recording process can be started with the execute command During the recording process paths can not be subscribed or unsubscribed handle Reference to the ziDAQZoomFFT class AP do AP AP oP cP AP oP LabOne Programming Manual Revision 31421 Zurich Instruments 62 3 5 LabOne Matlab API ziDAQ Comma
162. ed to the node Z _ERROR_TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void GetSample ZIConnection Conn ZIResult_enum RetVal char ErrBuffer LabOne Programming Manual Revision 31421 Zurich Instruments 153 6 2 Module Documentation ZIDIOSample DIOSample if RetVal ziAPIGetDIOSample Conn DEV1046 dios 0 output amp DIOSample ZI_INFO_SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf TS Sf bits 08x n float DIOSample timeStamp Jy DIOSample bits See Also ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 154 6 2 Module Documentation ziAPIGetAuxInSample ZIResult_enum ziAPIGetAuxInSample ZIConnection conn const char path ZlAuxinSample value Paramet Returns gets the Auxln sample of the specified node This function retrieves the newest available AuxIn sample from the specified node The value first found is returned if more than one value is available a wildcard is used in the path This function is only applicable to nodes ending in AUXINS O 9 SAMPLE ers in conn Pointer to the ziConnection with which the Value should be retrieved lin path Path to the Node holding the value out value Pointer to an ZlAuxlnSample stru
163. ee ZIResult_enum ZI_ERROR_MUTEX_DESTROY see Z Result_enum Z _ERROR_MUTEX_INIT see ZlResult_enum Z _ERROR_MUTEX_LOCK see ZIResult_enum ZI_ERROR_MUTEX_UNLOCK see ZlResult_ enum Z _ERROR_READONLY see ZIResult_enum ZI_ERROR_SERVER_INTERNAL see Z Result_enum LabOne Programming Manual Revision 31421 Zurich Instruments 354 ZILERROR_SOCKET_CONNECT Z Result_enum Z _ERROR_SOCKET_INIT see ZIResult_enum ZI_ERROR_THREAD_JOIN see ZIResult_enum ZI_ERROR_THREAD_START see ZIResult_enum ZI_ERROR_TIMEOUT see ZIResult_enum ZI_ERROR_USB see ZIResult_enum ZI_ERROR_ZIEVENT_DATATYPE_MISMATCH see ZlResult enum ZI_FILE see ZIResult_enum ZI_HOSTNAME see ZIResult_enum ZI_INFO_BASE see ZIResult_enum ZI_INFO_MAX see ZIResult_enum Z _INFO_SUCCESS see ZIResult_enum ZI_LENGTH see ZIResult_enum Z _LIST_ABSOLUTE see ZIListNodes_enum Z _LIST_LEAFSONLY see ZIListNodes_enum ZI_LIST_NODES_ ABSOLUTE ZlListNodes_enum ZI_LIST_NODES_LEAFSONLY ZlListNodes_enum ZI LIST _NODES NONE see ZIListNodes_enum ZI_LIST_NODES_ RECURSIVE see ZlListNodes_enum ZI_LIST_NODES_SETTINGSONLY ZlListNodes_enum ZI LIST _NONE see ZIListNodes_enum ZI LIST RECURSIVE see ZIListNodes_enum ZI LIST _SETTINGSONLY see ZIListNodes_enum Z _MALLOC see ZIResult_enum Z _MAX_ERROR see ZIResult_enum ZI_MAX_INFO see ZIResult_enum ZI_MAX_WARNING see ZIResult_enum ZI_MUTEX_DESTROY see ZIResult_enum Z _MUTEX_INI
164. elements ZI ERROR OVERFLOW when a FIFO overflow occurred Z _ERROR COMMAND on an incorrect answer of the server _ZI_ERROR SERVER INTERNAL if an internal error occurred in Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved 7 _ERROR_TIMEOUT when communication timed out LabOne Programming Manual Revision 31421 Zurich Instruments 140 6 2 Module Documentation See Tree Listing for an example See Also ziAPlUpdate LabOne Programming Manual Revision 31421 Zurich Instruments 141 6 2 Module Documentation ziAPlUpdateDevices ZIResult_enum ziAPlUpdateDevices ZIConnection conn Search for the newly connected devices and update the tree This function forces the Data Server to search for newly connected devices and to connect to run them Parameters lin conn Pointer to ZIConnection Returns Z _INFO_SUCCESS See Also ziAPIListNodes LabOne Programming Manual Revision 31421 Zurich Instruments 142 6 2 Modul e Documentation ziAPIConnectDevice ZIResult_enum ziAPIConnectDevice ZIConnection conn const char deviceSerial const char devicelnterface const char interfaceParams Connect a device to the server This function connects a device with deviceSerial via the specified devicelnterface for use with the server Parameters Returns See Also lin conn Pointer to the ZIConnection with which the connection should be established in deviceS
165. emod vi ziGetValueDemodSample vi x amp D 2 E IN Aux In Sample 7 EiSweepGeneratorlzisweepUnitConvizisweeper vi ziCpuProgramvi ziGetValueDIO vi ziGetValueAsPoll vi Table wi Swee 4 r ziBW2TC vi ZiT C2BW vi ziAutoRange vi Loir a ziGetValueString vi BW2TC TC2BW 7 ziTicks2S vi ziZoomFFT vi abe a Tick Er A Modules ziModStart vi ziModSetValue vi ziModSubscribe vi ziModExecute vi ziModGetNextNode vi ziModGetData vi ziModUnSubscribe vi ziModClear vi MoD MOD MoD Mop MoD Moo MOD Moo ee El EXE b xe as Xom String 7 ziModRead vi Route ziModFinish vi MoD moo k ziModStatus vi Hop Context Help C 009 instr lib Zurich Instruments LabOne Public Configure ziGetValueDouble vi 3 Handle ten Handle out Path Value error in Een out This vi retrieves the numerical value of the specified node as an double type value The vi returns the value first found that matches Path if more than one value is available a wildcard is used in the Path 4 S r Figure 5 2 An overview of the LabOne LabVIEW VIs is given in VI Tree vi Press Ctrl h after selecting one of the VIs to obtain help 5 2 3 Finding help for the LabOne VIs from within LabVIEW LabOne Programming Manual Revision 31421 Zurich Instruments 117 5 2 Getting Started 0 2 4 0 2 0 As is customary for LabVIEW built in help for LabOne s Vis can be obtained by selecting the VI with the mouse in a block diagram and pressing Ctrl h to view the VI s cont
166. ence to the ziPllAdvisor class arg2 A list of path value pairs subscribe subscribe ziPllAdvisor argl str arg2 gt None Subscribe to one or several nodes trigger trigger ziPllAdvisor argl gt None Not applicable to this module unsubscribe unsubscribe ziPllAdvisor argl str arg2 gt None Unsubscribe from one or several nodes Data and other attributes defined here _ init lt built in function init gt Raises an exception This class cannot be instantiated from Python Data descriptors inherited from Boost Python instance dict _ weakref _ Data and other attributes inherited from Boost Python instance new lt built in method _ new of Boost Python class object gt Ts Mew Sy mib IA new object with type S a subtype of T LabOne Programming Manual Revision 31421 Zurich Instruments 108 4 4 LabOne Python API ziPython Command Reference 4 4 9 Help for ziPython s ziPidAdvisor class An instance of ziPidAdvisor is initialized using the pidAdvisor method from ziDAQServer gt gt gt help zhinst ziPython ziDAQServer pidAdvisor Help on method pidAdvisor in zhinst ziPython ziDAQServer zhinst ziPython ziDAQServer pidAdvisor pidAdvisor unbound zhinst ziPython ziDAQServer method pidAdvisor ziDAQServer argl long arg2 gt ziPidAdvisor Create a pidAdvisor class This will start a thread for running an asynchronous pidAdvisor argl Reference to the ziDAQServer clas
167. ents 193 6 2 Module Documentation ziAPISubscribe ZlResult_enum ziAPISubscribe ZIConnection conn const char path subscribes the nodes given by path for ziAPIPollDataEx This function subscribes to nodes so that whenever the value of the node changes the new value can be polled using ziAPIPollDataEx By using wildcards or by using a path that is not a leaf node but contains sub nodes more than one leaf can be subscribed to with one function call Parameters lin conn Pointer to the ziConnection for which to subscribe for lin path Path to the nodes to subscribe Returns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values Zl TIMEOUT when communication timed out See Data Handling for an example See Also ziAPIUnSubscribe ziAPIPollDataEx ziAPlGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 194 6 2 Module Documentation ziAPIUnSubscribe ZlResult_enum ziAPIUnSubscribe ZIConnection conn const char path unsubscribes to the nodes given by path This function is the co
168. er edge delay 0 gt trigger edge at left border delay lt 0 gt trigger edge inside trigger frame pretrigger delay gt 0 gt trigger edge before trigger frame posttrigger Recording frame length s Trigger level voltage V Trigger hysteresis V Record more than one trigger ina trigger frame Has the software trigger triggered 1 Yes 0 No read only Filter bandwidth Hz for pulse and tracking triggers Number of skipped triggers until the LabOne Programming Manual Revision 31421 Zurich Instruments 104 4 4 LabOne Python API ziPython Command Reference next trigger is recorded again trigger 0O holdoff time double Hold off time s before the next trigger is recorded again A hold off time smaller than the duration will produce overlapped trigger frames trigger N hwtrigsource int Only available for devices that support hardware triggering Specify the channel to trigger on trigger 0 pulse min double Minimal pulse width s for the pulse trigger trigger 0 pulse max double Maximal pulse width s for the pulse trigger trigger filename string This parameter is deprecated If specified i e not empty it enables automatic saving of data in single trigger mode trigger endless 0 trigger savepath string The directory where files are saved when saving data trigger fileformat string The format of the file for saving data 0 Matlab 1 CSV trigger historyle
169. er of the server 7 _ERROR_SERVER_INTERNAL if an internal error occurred in Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved or no value is attached to the node Z ERROR TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIIntegerData Valuel if RetVal ziAPISetValueD Conn LabOne Programming Manual Revision 31421 Zurich Instruments 149 6 2 Module Documentation DEV1046 demods rate 5 53 I ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValuel Conn DEV1046 demods 0 rate amp Valuel ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n float Valuel See Also ziAPISetValuel ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 150 6 2 Module Documentation ziAPIGetDemodSample ZIResult_enum ziAPIGetDemodSample ZIConnection conn const char path ZIDemodSample value Paramet Returns Gets the demodulator sample value of the specified node This function retrieves the value of the specified node as an DemodSample struct The value first foun
170. erence finish finish ziDAQSweeper argl gt None Stop sweeping The sweeping may be restarted by calling execute again finished finished ziDAQSweeper argl gt bool Check if the sweep has finished Returns True if finished get get ziDAQSweeper argl str arg2 bool arg3 gt object Return a dict with all nodes from the specified sub tree argl Reference to the ziDAQSweeper class arg2 Path string of the node Use wild card to select all arg3 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False get ziDAQSweeper argl str arg2 gt object listNodes listNodes ziDAQSweeper argl str arg2 int arg3 gt list This function returns a list of node names found at the specified path argl Reference to the ziDAQRecorder class arg2 Path for which the nodes should be listed The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents arg3 Enum that specifies how the selected nodes are listed ziPython ziListEnum none gt 0x00 The default flag returning a simple listing if the given node ziPython ziListEnum recursive gt 0x01 Returns the nodes recursively ziPython ziListEnum absolute gt 0x02 Returns absolute paths ziPython ziListEnum leafsonly gt 0x04 Returns only nodes that are leafs which means the they are at the outermost leve
171. erent computer on the network away from their experimental setup Then on either computer the user can configure and retrieve data from their instrument via a number of different software interfaces i e viathe web based LabOne User Interface and or their own custom programs In this way the user can decide which connectivity setup and combination of interfaces best suits their experimental setup and data processing needs Refer to Section 1 1 for an overview of the LabOne Software Architecture m Section 1 2 fora Comparison of the LabOne Interfaces Section 1 3 for an explanation of LabOne API Levels Section 1 4 for Finding settings The Node Hierarchy Section 1 5 for Obtaining Data from the Instrument Section 1 6 for Instrument Specific Considerations Note New users could benefit by first familiarizing themselves with the instrument using the LabOne User Interface or ziControl please refer to the appropriate user manual for your instrument for more details Note The Real time Option RTK for the HF2 Series is not a PC based interface for controlling an instrument and is documented in the HF2 User Manual LabOne Programming Manual Revision 31421 Zurich Instruments 5 1 1 LabOne Software Architecture 1 1 LabOne Software Architecture Zurich Instruments devices uses a server based connectivity methodology Server based means that all communication between the user and the instrument takes place via a
172. erial The serial of the device to connect to e g dev2100 in devicelnterface The interface to use for the connection e g USBI1 GbE in interfaceParams Parameters for interface configuration Z _INFO_SUCCESS on success Z _ERROR_TIMEOUT when communication timed out ziAPIDisconnectDevice ziAPIConnect ziAPIDisconnect ziAPIInit LabOne Programming Manual Revision 31421 Zurich Instruments 143 6 2 Module Documentation ziAPIDisconnectDevice ZlResult_enum ziAPIDisconnectDevice ZIConnection conn const char deviceSerial Disconnect a device from the server This function disconnects a device specified by deviceSerial from the server Parameters lin conn Pointer to the ZIConnection with which the connection should be established in deviceSerial The serial of the device to connect to e g dev2100 Returns Z _INFO_SUCCESS on success Z ERROR TIMEOUT when communication timed out See Also ziAPIConnectDevice ziAPIConnect ziAPIDisconnect ziAPIInit LabOne Programming Manual Revision 31421 Zurich Instruments 144 6 2 Module Documentation 6 2 3 Set and Get Parameters This section describes several functions for getting and setting parameters of different datatypes Functions 7l Result_enum ziAPIGetValueD ZIConnection conn const char path ZIDoubleData value gets the double type value of the specified node Z Result enum ziAPIGetValuel ZIConnection conn
173. escription trigger device byte array 7 The device ID to execute the software trigger e g dev123 compulsory parameter trigger buffersize double Seconds Overwrite the buffersize of the trigger object set when it was instantiated Recommended buffer size is 2 trigger N duration trigger endless uint64 Enable endless triggering 1 enable O disable trigger uint64 Force a trigger forcetrigger LabOne Programming Manual Revision 31421 Zurich Instruments 34 2 4 Software Trigger Recorder Module Setting Path Type Unit Description trigger filename byte array This parameter is deprecated If specified i e not empty it enables automatic saving of data in single triggering mode trigger endless 0 trigger savepath byte array The directory where files are saved when saving data trigger fileformat byte array The format of the file for saving data O Matlab 1 CSV trigger uint64 Maximum number of entries stored in the historylength measurement history trigger uint64 Clear the measurement history clearhistory trigger triggered uint64 Has the software trigger triggered 1 Yes O No read only trigger N bandwidth double Hz Only for Tracking Triggers The bandwidth used in the calculation of the exponential running average of the source signal trigger N bitmask uint64 Only for Digital triggers Specify
174. esponding data type Z DoubleDa when va Z Double when va Zlinteger when va Ziinteger when va Z ByteArray Type Zl VAL Type Zl VAL Type Zl VAL Type Zl VAL ta doubleData E_TYPE_ DOUBLE DATA U talS doubleDataTS E_TYPE_DOUBLE_DATA_TS U ta integerData E_TYPE_INTEGER_DATA U talS E_TYPE_ INTEGER DATA TS talS integerDa U byteArray when value Z ByteArray Type Zl VAL E_TYPE_BYTE_ARRAY U TS byteArrayTS LabOne Programming Manual Revision 31421 Zurich Instruments 224 6 3 Data Structure Documentation when valueType ZILVALUE_TYPE_BYTE_ARRAY_TS Z TreeChangeData treeChangeData when valueType ZI_VALUE_TYPE_TREE_CHANGE_DATA TreeChange treeChangeDataOld when valueType ZI_VALUE_TYPE_TREE_CHANGE_DATA_OLD Z DemodSample demodSample when valueType ZI_VALUE_TYPE_DEMOD_SAMPLE Z lAuxInSample auxInSample when valueType ZILVALUE_TYPE_AUXIN_SAMPLE 7IDIOSample dioSample when valueType ZI_LVALUE_TYPE_DIO_SAMPLE Z ScopeWave scopeWave when valueType ZILVALUE_TYPE_SCOPE_WAVE ScopeWave scopeWaveOld when valueType ZILVALUE_TYPE_SCOPE_WAVE_OLD ZIPWAWave pwaWave when valueType ZILVALUE_TYPE_PWA_WAVE union ZlEvent 1 value Convenience pointer to allow for access to the first entry in Data using the corre
175. etrieved lin path Path to the Node holding the value Returns Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server ZI SERVER INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no value is attached to the node 7 _TIMEOUT when communication timed out See Data Handling for an example See Also ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx LabOne Programming Manual Revision 31421 Zurich Instruments 336 6 4 File Documentation ziAPIGetError ZlResult_enum ziAPIGetError ZIResult enum result char buffer int base Paramet Returns returns a description and the severity for a ZIResult_enum This function returns a static char pointer to a description string for the given ZlResult enum error code It also provides a parameter returning the severity info warning error If the given error code does not exist a description for an unknown error and the base for an error will be returned If a description or the base is not needed NULL may be passed ers lin result A ZIResult_enum for which the description or base will b
176. eturns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Z _OVERFLOW when a FIFO overflow occurred See Data Handling for an example See Also ziAPISubscribe ziAPIUnSubscribe ziAPlGetValueAsPollData ziEvent LabOne Programming Manual Revision 31421 Zurich Instruments 341 6 4 File Documentation ziAPIGetValueS ZlResult_enum ziAPIGetValueS ZIConnection conn char path DemodSample value LabOne Programming Manual Revision 31421 Zurich Instruments 342 6 4 File Documentation ziAPIGetValueDIO ZlResult_enum ziAPIGetValueDIO ZIConnection conn char path DIOSample value LabOne Programming Manual Revision 31421 Zurich Instruments 343 6 4 File Documentation ziAPIGetValueAuxIn ZlResult_enum ziAPIGetValueAuxin ZIConnection conn char path AuxlnSample value LabOne Programming Manual Revision 31421 Zurich Instruments 344 6 4 File Documentation ziAPISecondsTimeStamp double ziAPISecondsTimeStamp ziTimeStampType TS Deprecated timestamps should instead be converted to seconds by dividing by the instrument s clockbase This is available as an leaf under the instruments s root device branch in the node hierarchy e g dev2001 clockbase Parameters lin TS the timestamp to convert to seconds Returns The timestamp in seconds as a double LabOne Programming Manual Revision 31421 Zurich Instrume
177. ext help See Figure 5 2 for an example Finding the LabOne LabVIEW API Examples Many examples come bundled with the LabOne LabVIEW API which demonstrate the most important concepts of working with Zurich Instrument devices The easiest way to browse the list of available examples is via the NI Example Finder In LabVIEW select Find Examples from the Help menu bar and search for LabOne see Figure 5 3 The examples are located in the directory instr lib Zurich Instruments LabOne Examples found in LabVIEW installation directory In order to modify an example for your needs please copy it to your local workspace NI Example Finder ole ks Browse Search Double click an example to open it Information 27 examples match your search criteria Description a This is an example for a Zurich Instruments HF2 or UHFLI instrument This vi uses the aux outputs and aux inputs gt gt Enter keyword s LabOne ziExample Boxcar vi ziExample Bursts vi Keywords X ziExample DIO vi Such fak ziExample HF2 ExtTriggerDemodData vi ziExample HF2 ImpedanceSweep vi ziExample HF2 Noise vi Double click keyword s ziExample HF2 PLL vi ziExample HF2 RTK PLvi ziExample HF2 SaveLoad_Settings vi ziExample HF2 Scope vi ziExample HF2 SetParameters vi ziExample HF2 Sweep vi ziExample HF2 SweepPtByPt vi ziExample HF2 TipProtect vi ziExample HF2 ZoomFFT vi ziExample InitializeParameters vi ziExample LabOne GettingStarted vi ziExa
178. fies how the selected nodes are listed ziPython ziListEnum none gt 0x00 The default flag returning a simple listing if the given node ziPython ziListEnum recursive gt 0x01 Returns the nodes recursively ziPython ziListEnum absolute gt 0x02 Returns absolute paths ziPython ziListEnum leafsonly gt 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree ziPython ziListEnum settingsonly gt 0x08 Returns only nodes which are marked as setting Or combinations of flags can be used progress progress ziDAQZoomFFT argl gt object Reports the progress of the measurement with a number between 0 and 1 read read ziDAQZoomFFT argl bool arg2 gt object Read zoom FFT data If the zoom FFT is still ongoing only a subset of zoom FFT data is returned argl optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False read ziDAQZoomFFT argl gt object save save ziDAQZoomFFT argl str arg2 gt None Save zoom FFT data to file argl Reference to the ziDAQZoomFFT class arg2 File name string without extension set set ziDAQZoomFFT argl str arg2 float arg3 gt None zoom FFT Parameters LabOne Programming Manual Revision 31421 Zurich Instruments 100 4 4 LabOne Python API ziPython Command Reference Path name Type
179. for an introduction to LabOne LabVIEW Programming Concepts Section 5 2 3 for Finding help for the LabOne Vis from within LabVIEW Section 5 2 4 for help Finding the LabOne LabVIEW API Examples Section 5 2 5 for help Running the LabOne Example Vis Section 5 3 for some LabVIEW Programming Tips and Tricks Note This section and the provided examples are no substitute for a general LabVIEW tutorial See for example the National Instruments website for help to get started programming with LabVIEW LabOne Programming Manual Revision 31421 Zurich Instruments 113 5 1 Installing the LabOne LabVIEW API 5 1 Installing the LabOne LabVIEW API 5 1 1 Requirements A LabVIEW 2009 or higher installation is required on either Windows or Linux in order to use the LabOne LabVIEW API The LabOne LabVIEW API is included in a standard LabOne installation However in order to make the LabOne LabVIEW API available for use within LabVIEW a directory needs to be copied to a specific directory of your LabVIEW installation The LabOne installer is available from Zurich Instruments download page login required 5 1 2 Windows 1 Locate the instr 1lib directory in your LabVIEW installation and delete any previous Zurich Instruments API directories The instr lib directory is typically located at C Program Files National Instruments LabVIEW 201x instr 1lib Previous Zurich Instruments installations will be directories loc
180. for transfer Any data including poll data retrieved afterwards is guaranteed to be produced not earlier than the call to ziAPISync This ensures in particular that any settings made prior to the call to ziAPISync have been propagated to the device and the data retrieved afterwards is produced with the new settings already set to the hardware Note however that this does not include any required settling time Parameters lin conn Pointer to the ZIConnection that is to be synchronized Returns Z _INFO_SUCCESS on success Zl ERROR TIMEOUT when communication timed out LabOne Programming Manual Revision 31421 Zurich Instruments 168 6 2 Module Documentation ziAPlEchoDevice ZIResult_enum ziAPlEchoDevice ZIConnection conn const char deviceSerial Sends an echo command to a device and blocks until answer is received This is useful to flush all buffers between API and device to enforce that further code is only executed after the device executed a previous command Per device echo is only implemented for HF2 For other device types it is a synonym to ziAPISync and deviceSerial parameter is ignored Parameters lin conn Pointer to the ZIConnection that is to be synchronized in deviceSerial The serial of the device to get the echo from e g dev2100 Returns Z _INFO_SUCCESS on success Z ERROR TIMEOUT when communication timed out LabOne Programming Manual Revision 31421 Zurich Instruments 169 6
181. g of signal Personal Computer Phase Detector Electronic circuit that serves to track and control a defined frequency For this purpose a copy of the external signal is generated such that itis in phase with the original signal but with usually better spectral characteristics It can act as frequency stabilization frequency multiplication or as frequency recovery In both analog and digital implementations it consists of a phase detector a loop filter a controller and an oscillator AFM mode where the phase between drive and measured signal encodes the topography or the measured AFM variable See Also Atomic Force Microscope Proportional Integral Derivative Packet Loss loss of packets of data between the instruments and the host computer Reduced Instruction Set Computer Statistical measure of the magnitude of a varying quantity It is especially useful when variates are positive and negative e g sinusoids sawtooth LabOne Programming Manual Revision 31421 Zurich Instruments 349 RT S Scalar Network Analyzer SNA SL Spectrum Analyzer SA SSH TC TCP IP Thread Total Harmonic Distortion THD TTL U UHF UHS USB V VCO Vector Network Analyzer VNA XML square waves For a sine wave the following relation holds between the amplitude and the RMS value Urs Upk V2 UpK 1 41 The RMS is also called quadratic mean Real time Instrument that measures the voltage of
182. gramming Manual Revision 31421 Zurich Instruments 282 6 4 File Documentation Trying to get data from a poll event with wrong target data type ZI_ERROR_MAX Z SUCCESS Success no error Z _MAX_INFO ZI WARNING Warning general Z UNDERRUN FIFO Underrun m Z OVERFLOW FIFO Overflow Z NOTFOUND Value or Node not found ZI_MAX_WARNING ZI ERROR Error general Z USB USB Communication failed ZI MALLOC Memory allocation failed ZI MUTEX_INIT Unable to initialize mutex Z MUTEX DESTROY Unable to destroy mutex m Z MUTEX_LOCK Unable to lock mutex Z MUTEX_UNLOCK Unable to unlock mutex 7 THREAD START Unable to start thread ZI_THREAD_JOIN Unable to join thread Z SOCKET_INIT Can t initialize socket m Z SOCKET CONNECT Unable to connect socket LabOne Programming Manual Revision 31421 Zurich Instruments 283 6 4 File Documentation Z HOSTNAME Hostname not found ZI CONNECTION Connection invalid m Z TIMEOUT Command timed out Z COMMAND Command internally failed Z SERVER INTERNAL Command failed in server ZI LENGTH Provided Buffer length doesn t reach y ARLE Can t open file or read from it ZI DUPLICATE There is already a similar entry Z READONLY Attempt to set a read only node ZI_MAX_ERROR LabOne Programming Manual Revision 31421 Zurich Instr
183. h Z Result_enum ziAPISyncSetValuel ZIConnection conn const char path ZlintegerData value synchronously sets an integer type value to one or more nodes specified ina path LabOne Programming Manual Revision 31421 Zurich Instruments 145 6 2 Module Documentation Z Result_ enum ziAPISyncSetValueB ZIConnection conn const char path uint8_t buffer uint32_t length uint32_t bufferSize Synchronously sets the binary type value of one ore more nodes specified in the path ziResult_enum ziAPISync ZIConnection conn Synchronizes the session by dropping all pending data 7Z Result enum ziAPlEchoDevice ZIConnection conn const char deviceSerial Sends an echo command to a device and blocks until answer is received zlResult_enum ziAPlAsyncSetDoubleData ZIConnection conn const char path ZIDoubleData value 7 Result_enum ziAPlAsyncSetintegerData ZIConnection conn const char path ZllntegerData value zlResult_enum ziAPlAsyncSetByteArray ZIConnection conn const char path uint8_t buffer uint32_t length 7l Result_enum ziAPIGetValueS ZIConnection conn char path DemodSample value 7l Result_enum ziAPIGetValueDIO ZiIConnection conn char path DIOSample value 7l Result_enum ziAPlGetValueAuxln ZIConnection conn char path AuxInSample value LabOne Programming Manual Revision 31421 Zurich Instruments 146 6 2 Module Documentation Function Documentati
184. h Instruments devices The aim of this section is to familiarize the user with the key ziCore programming concepts Software Architecture Each of the ziCore based APIs are designed to have a minimal code footprint They are simply small interface layers that use the functionality derived from ziCore a central C API The derived API interfaces Matlab and Python provide a familiar interface to the user and allow the user to receive and manipulate data from their instrument using the API language s native data types and formats See Section 1 1 for an overview of the LabOne software architecture ziCore Modules In addition to the usual API commands available for instrument configuration and data retrieval e g set Int poll ziCore based APIs also provide a number of so called Modules high level interfaces that perform common tasks such as sweeping data or performing FFT s The Module s functionality is implemented in ziCore and each derived high level API simply provides an interface to that module from the API s native environment This design ensures that the user can expect the same behavior from each module irrespective of which API is being used if the user is familiar with a module available in one high level programming API it is quick and easy to start using the module in a different API In particular the LabOne User Interface is also based on ziCore and as such the user can expect the same behavior using a ziCore based API that
185. han one value can be set itis if a wildcard is used The function sets the value synchronously After returning you know that set and to which value it is set Parameters in Poi conn nter to the ziConnection for which the value s will be set lin path Pa th to the node s for which the value s will be set lin value Pointer to a int type containing then value to be written when the function returns value holds the effectively written value Returns See Also ziA ZI SUCCESS on success ZI_CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN Z _OVERFLOW when a FIFO overflow occurred ZI_READONLY on attempt to set a read only node ZI_LCOMMAND on an incorrect answer of the server ZI_SERVER_INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no node given by path is able to hold values ZI_TIMEOUT when communication timed out PlGetValuel ziAPISetValuel LabOne Progr amming Manual Revision 31421 Zurich Instruments 324 6 4 File Documentation ziAPISyn cSetValueB ZIResult_enum ziAPISyncSetValueB ZIConnection conn const char path uint8_t buffer u Paramet Returns int32_t length uint32_t bufferSize Synchronously sets the binary type value of one ore more nodes specified in the path This function sets the v
186. he LabOne APIs depend on the base ziAPI the C API Needless to say we try as hard as possible to make any improvements in ziAPI backwards compatible for the convenience of our users We take care that existing programs do not need to be changed upon a new software release Occasionally however we do have to make a breaking change in our API by removing some old functionality This old functionality is however phased out over several software releases First the functionality is marked as deprecated and the user is informed via a depreciation warning this can be turned off This indicator warns that this function may be unsupported in the future If we have to break some functionality we use a so called API level With support of new devices and features we need to break functionality on the ziAPI h e g data returned by poll commands In order to still support the old functionality we introduced API levels If a program is only using old functionality the API level 1 default can be used If a user needs new functionality they need to use a higher API level This will usually need some changes on the existing code Available API levels as of LabOne Software Release 15 01 are API Level 1 HF2 support basic UHF support API Level 4 UHF support with timestamps and PWA name clean up API Level 5 Introduction of scope offset for extended non hardware scope inputs UHF Note that Levels 2 and 3 are used only internally and are
187. he bytes field uint8_t bytes the data itself The array has the size given in length LabOne Programming Manual Revision 31421 Zurich Instruments 254 6 4 File Documentation struct ScopeWave The structure used to hold a single scope shot API Level 1 If the client is connected to the Data Server using API Level 4 recommended if supported by your device class please see Z ScopeWave instead include ziAPI h typedef struct ScopeWave double dt unsigned int ScopeChannel unsigned int TriggerChannel unsigned int BWLimit unsigned int Count short Data 0 ScopeWave Data Fields double dt Time difference between samples unsigned int ScopeChannel Scope channel of the represented data unsigned int TriggerChannel Trigger channel of the represented data unsigned int BWLimit Bandwidth limit flag unsigned int Count Count of samples short Data First wave data LabOne Programming Manual Revision 31421 Zurich Instruments 255 6 4 File Documentation struct ZIScopeWave The structure used to hold scope data The data may be formatted differently depending on settings See the description of the structure members for details include ziAPI h typedef struct ZIScopeWave ZITimeStamp ZITimeStamp double uint8 t uint8 t uint8 t uint8 t uint8 t uint8 t uint8 t float uint32 t uint32 t uint32 t uint6
188. he event ZI_DATA_BYTEARRAY ByteArray data type use the ziEvent Val ByteArray Pointer to read the data of the event ZI_DATA_TREE_CHANGED a list of added or removed trees use the ziEvent Val Tree Pointer to read the data of the event LabOne Programming Manual Revision 31421 Zurich Instruments 286 6 4 File Documentation enum ZITreeAction_enum Defines the actions that are performed on a tree as returned in the ZlTreeChangeData action or ZITreeChangeDataOld action Enumerator ZI TREE ACTION _REMOVE A node has been removed Z TREE ACTION ADD A node has been added ZI TREE ACTION CHANGE A node has been changed LabOne Programming Manual Revision 31421 Zurich Instruments 287 6 4 File Documentation enum ZIAPIVersion_enum Enumerator Z _API_VERSION_1 Z _API_VERSION_4 LabOne Programming Manual Revision 31421 Zurich Instruments 288 6 4 File Documentation enum ZIListNodes_enum Defines the values of the flags used in ziAPIListNodes Enumerator ZI_LIST_ NODES_NONE Default return a simple listing of the given node immediate descendants ZI_LIST NODES_RECURSIVE List the nodes recursively Z _LIST_ NODES_ABSOLUTE Return absolute paths Z I_LIST NODES_LEAFSONLY Return only leaf nodes which means the nodes at the outermost level of the tree Z I_LIST NODES_SETTINGSONLY Return only nodes which are marked
189. he folder containing LabOne s Matlab API library to Matlab s search path This is done as following 1 Start Matlab and set the Current Folder current working directory to the Matlab API folder in your LabOne Installation On Windows this is typically C Program Files Zurich Instruments LabOne API MATLAB2012 On Linux this is the location where you unpacked the LabOne tar gz file PATH LabOne64 API MATLAB2012 2 Inthe Matlab Command Window run the Matlab script ziAddPath located in the MATLAB2012 directory gt gt ziAddPath On Windows similar for Linux you should see the following output in Matlab s Command Window Added ziDAQ s Driver Utilities and Examples directories to Matlab s path for this session To make this configuration persistent across Matlab sessions either 1 Run the pathtool command in the Matlab Command Window and add the following paths WITH SUBFOLDERS to the Matlab search path C Program Files Zurich Instruments LabOne API MATLAB2012 or 2 Add the following line to your Matlab startup m file run C Program Files Zurich Instruments LabOne API MATLAB2012 ziAddPath This is sufficient configuration if you would only like to use ziDAQ inthe current Matlab session LabOne Programming Manual Revision 31421 Zurich Instruments 43 3 1 Installing the LabOne Matlab API 3 4 5 3 1 3 A To 1 3 To make this configuration persistent between Matlab sessions do ei
190. host as the hostname Error Message Attempt to execute SCRIPT ziDAQ as a function ziDAQ m There could be a problem with your LabOne Matlab API installation The call to ziDAQ is trying to call the help file ziDAQ m as a function instead of calling the ziDAQ function defined in the MEX file In this case you need to ensure that the ziDAQ MEX file is in your search path as described in Section 3 1 and navigate away from from the Driver directory Secondly ensure that the LabOne Matlab MEX file is in the Driver folder as described in Section 3 2 1 LabOne Programming Manual Revision 31421 Zurich Instruments 53 3 5 LabOne Matlab API ziDAQ Command Reference 3 5 LabOne Matlab API ziDAQ Command Reference Copyright 2009 2015 Zurich Instruments Ltd Switzerland This software is a preliminary version Function calls and parameters may change without notice This version is linked against Matlab 7 9 0 529 R2009b libraries In case of incompatibility with the currently used Matlab version Send us the requested version use ver command ziDAQ is a interface for communication with the ZI server Usage ziDAQ command optionl option2 5 command clear connect connectDevice disconnectDevice finished flush get 5 getAsEvent getAuxInSample getByte getDIO getDouble getInt 5 getSample listNodes logOn logOff 5 poll poll
191. iDAQServer argl str arg2 gt object Returns a single auxin sample The auxin data is averaged in contrast to the auxin data embedded in the demodulator sample argl Reference to the ziDAQServer class arg2 Path string getByte getByte ziDAQServer argl str arg2 gt object Get a byte array string value from the specified node argl Reference to the ziDAQServer class arg2 Path string of the node getConnectionAPILevel getConnectionAPlLevel ziDAQServer argl gt int Returns ziAPI level used for the active connection getDIO getDIO ziDAQServer argl str arg2 gt object Returns a single DIO sample argl Reference to the ziDAQServer class arg2 Path string getDouble getDouble ziDAQServer argl str arg2 gt float Get a double value from the specified node argl Reference to the ziDAQServer class arg2 Path string of the node getInt getInt ziDAQServer argl str arg2 gt int Get a integer value from the specified node argl Reference to the ziDAQServer class arg2 Path string of the node getList getList ziDAQServer argl str arg2 gt object Return a list with all nodes from the specified sub tree argl Reference to the ziDAQServer class arg2 Path string of the node Use wild card to select all getSample getSample ziDAQServer argl str arg2 gt object Returns a single demodulator sample including DIO and AuxIn For more efficient data
192. ibutes defined here LabOne Programming Manual Revision 31421 Zurich Instruments 98 4 4 LabOne Python API ziPython Command Reference _ init lt built in function init gt Raises an exception This class cannot be instantiated from Python Data descriptors inherited from Boost Python instance ret _ weakref _ Data and other attributes inherited from Boost Python instance new_ lt built in method _ new__ of Boost Python class object gt T new S gt a new object with type S a subtype of T 4 4 6 Help for ziPython s ziDAQZoomFFT class An instance of ziDAQZoomFFT is initialized using the zoomFFT method from ziDAQServer gt gt gt help zhinst ziPython ziDAQServer zoomFFT Help on method zoomFFT in zhinst ziPython ziDAQServer zhinst ziPython ziDAQServer zoomFFT zoomFFT unbound zhinst ziPython ziDAQServer method zoomFFT ziDAQServer argl long arg2 gt ziDAQZoomFFT Create a zoomFFT class This will start a thread for running an asynchronous zoomFFT argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms Reference help for the ziDAQZoomFFT class gt gt gt help zhinst ziPython ziDAQZoomFFT Help on class ziDAQZoomFFT in zhinst ziPython zhinst ziPython ziDAQZoomFFT class ziDAQZoomFFT Boost Python instance Method resolution order ziDAQZoomFFT Boost Python instance __builtin__ object Methods defined here __reduce__ lt unnamed
193. ice under test and to measure the impedance by means of a current measurement at a selectable frequency and its amplitude and phase change over time The output is both amplitude and phase information referred to the stimulus signal Measure of instrument s capability to faithfully indicate the signal amplitude at the input channel versus a traceable standard Total noise generated by the instrument and referred to the signal input thus expressed as additional source of noise for the measured signal Internet Protocol Local Area Network Light Emitting Diode Instrument suited for the acquisition of small signals in noisy environments or quickly changing signal with good signal to noise ratio lock in amplifiers recover the signal of interest knowing the frequency of the signal by demodulation with the suited reference frequency the result of the demodulation are amplitude and phase of the signal compared to the reference these are value pairs in the complex plane X Y R Refers to the unique identifier assigned to network adapters for physical network communication Refers to the simultaneous measurement of signals modulated at arbitrary frequencies The objective of multi frequency is to increase the information that can be derived from a measurement which is particularly important for one time non repeating events and to increase the speed of a measurement since different frequencies do not have to be applied one after
194. idth value Equivalent to the obsolete bandwidth 0 setting sweep order int Defines the filter roll off to use in Fixed bandwidth selection Valid values are between 0 6 dB octave and 8 48 dB octave An order of 0 triggers a read out of the order from the selected demodulator sweep maxbandwidth double Maximal bandwidth used in auto bandwidth mode in Hz The default is 1 25MHz sweep omegasuppression double Damping in dB of omega and 2 omega LabOne Programming Manual Revision 31421 Zurich Instruments 97 4 4 LabOne Python API ziPython Command Reference components Default is 40dB in favor of sweep speed Use higher value for strong offset values or 3 omega measurement methods sweep averaging tc double Min averaging time tc 0 no averaging see also time 5 low precision 15 medium precision 50 high precision sweep averaging sample int Min samples to average 1 no averaging if averaging tc 0 sweep phaseunwrap bool Enable unwrapping of slowly changing phase evolutions around the 180 degree boundary sweep sincfilter bool Enables the sinc filter if the sweep frequency is below 50 Hz This will improve the sweep speed at low frequencies as omega components do not need to be suppressed by the normal low pass filter sweep filename string This parameter is deprecated If specified i e not empty it enables automatic saving of data in single sweep mode sweep endless 0
195. ied in the path This function sets the values of the nodes specified in path to Value More than one value can be set itis if a wildcard is used The function sets the value synchronously After returning you know that set and to which value it is set Parameters in Poi conn nter to the ziConnection for which the value s will be set in path Pa th to the Node s for which the value s will be set to value lin value Pointer to a double type containing the value to be written When the function returns value holds the effectively written value Returns See Also ziA ZI SUCCESS on success ZI_CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN Z _OVERFLOW when a FIFO overflow occurred ZI_READONLY on attempt to set a read only node ZI_LCOMMAND on an incorrect answer of the server ZI_SERVER_INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no node given by path is able to hold values ZI_TIMEOUT when communication timed out PlGetValueD ziAPISetValueD LabOne Progr amming Manual Revision 31421 Zurich Instruments 165 6 2 Module Documentation ziAPISyncSetValuel ZIResult_enum ziAPISyncSetValuel ZIConnection conn const char path ZiintegerData value syn chronously sets an integer type value to one or more nodes spec
196. ified ina path This function sets the values of the nodes specified in path to value More than one value can be set itis if a wildcard is used The function sets the value synchronously After returning you know that set and to which value it is set Parameters in Poi conn nter to the ziConnection for which the value s will be set lin path Pa th to the node s for which the value s will be set lin value Pointer to a int type containing then value to be written when the function returns value holds the effectively written value Returns See Also ziA ZI SUCCESS on success ZI_CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN Z _OVERFLOW when a FIFO overflow occurred ZI_READONLY on attempt to set a read only node ZI_LCOMMAND on an incorrect answer of the server ZI_SERVER_INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no node given by path is able to hold values ZI_TIMEOUT when communication timed out PlGetValuel ziAPISetValuel LabOne Progr amming Manual Revision 31421 Zurich Instruments 166 6 2 Module Documentation ziAPISyn cSetValueB ZIResult_enum ziAPISyncSetValueB ZIConnection conn const char path uint8_t buffer u Paramet Returns int32_t length uint32_t bufferSize Synchronously se
197. ile Documentation struct ZIDemodSample The structure used to hold data for a single demodulator sample include ziAPI h typedef struct ZIDemodSample ZITimeStamp timeStamp double x double y double frequency double phase uint32 t dioBits uint32 t trigger double auxInO double auxInl ZIDemodSample Data Fields 7 TimeStamp timeStamp The timestamp at which the sample has been measured double x X part of the sample double y Y part of the sample double frequency Frequency at that sample double phase Phase at that sample uint32_t dioBits the current bits of the DIO uint32_t trigger trigger bits double auxInO value of Aux input 0 LabOne Programming Manual Revision 31421 Zurich Instruments 249 6 4 File Documentation double auxin1 value of Aux input 1 LabOne Programming Manual Revision 31421 Zurich Instruments 250 6 4 File Documentation struct ZlAuxInSample The structure used to hold data for a single auxiliary inputs sample include ziAPI h typedef struct ZIAuxInSample ZITimeStamp timeStamp double cho double ahl ZIAuxInSample Data Fields 7 TimeStamp timeStamp The timestamp at which the values have been measured double chO Channel 0 voltage double ch1 Channel 1 voltage LabOne Programming Manual Revision 31421 Zurich Instruments 251 6 4 File Documentation struct ZIDIOSample
198. ill be written to the node s m Zl SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z READONLY on attempt to set a read only node Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values 7 _TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIIntegerData Valuel LabOne Programming Manual Revision 31421 Zurich Instruments 159 6 2 Module Documentation if RetVal ziAPISetValueD Conn DEV1046 demods rate 5 53 I ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValuel Conn DEV1046 demods 0 rate amp Valuel ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n float Valuel See Also ziAPIGetValueD ziAPISyncSetValueD LabOne Programming Manual Revision 31421 Zurich Instruments 160
199. imeout_milliseconds 500 gt gt gt sweeper daq sweep timeout_milliseconds Note that since creating a Module object without an API connection to the Data Server does not make sense the Sweeper object is instantiated via the sweep method of the ziDAQServer class not directly from from the ziDAQSweeper class The Module s parameters are configured using the Module s set method and specifying a path value pair for example gt gt sweeper set sweep start 1 2e5 The parameters can be read back usingthe get method which supports wildcards for example gt gt sweep params sweeper get sweep The variable sweep_params now contains a dictionary of all the Sweeper s parameters The other main Module commands are similarly used e g sweeper execute tostartthe sweeper See Section 2 1 2 for more help with Modules and a description of their parameters LabOne Programming Manual Revision 31421 Zurich Instruments 78 4 3 LabOne Python API Tips and Tricks 4 3 LabOne Python API Tips and Tricks In this section some tips and tricks for working with the LabOne Python API are provided Data Structures returned by ziPython The output arguments that ziPython returns are designed to use the native data structures that Python users are familiar with and that reflect the data s location in the instruments node hierarchy For example when the poll command returns data from the instruments fourth demodulator loc
200. in sequential mode but are then set in reverse order from larger to smaller values see Figure 2 4 This allows for effects in the sweep parameter to be observed that depend on the order of changes in the sweep parameter s values LabOne Programming Manual Revision 31421 Zurich Instruments 21 2 2 Sweeper Module Controlling how the Sweeper sets the Demodulator s Time Constant The sweep bandwidthcontrol parameter specifies which demodulator filter bandwidth equivalently time constant the Sweeper should set for the current measurement point The user can either specify the bandwidth manually 0 in which case the value of the current demodulator filter s bandwidth is simply used for all measurement points specify a fixed bandwidth 1 specified by sweep bandwidth for all measurement points or specify that the Sweeper sets the demodulator s bandwidth automatically 2 Note to use either Fixed or Manual mode sweep bandwidth must be set to a value gt 0 even though in manual mode it is ignored Specifying the Sweeper s Settling Time For each change in the sweep parameter that takes effect on the instrument the Sweeper waits before recording measurement data in order to allow the measurement to settle This behavior is configured with the parameters in the sweep settling branch The sweep settling tc parameter defines the minimum number of time constants of the demodulator filter that will Sweeper module wait after setting the
201. ion For a description of how the data are available in the struct refer to the documentation of struct ziEvent When no event was available within timeOutMilliseconds the ziEvent Type field will be ZI_DATA_NONE and the ziEvent Count field will be zero Otherwise these fields hold the values corresponding to the event that occurred Parameters in conn Pointer to the ZIConnection for which events should be received out ev Pointer to a ZlEvent struct in which the received event will be written in timeOutMilliseconds Time to wait for an event in milliseconds If 1 it will wait forever if O the function returns immediately Returns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Z _OVERFLOW when a FIFO overflow occurred See Data Handling for an example See Also ziAPISubscribe ziAPlUnSubscribe ziAPIGetValueAsPollData ziEvent LabOne Programming Manual Revision 31421 Zurich Instruments 196 6 2 Module Documentation ziAPIGetValueAsPollData ZlResult_enum ziAPIGetValueAsPollData ZIConnection conn const char path triggers a value request which will be given back on the poll event queue Use this function to receive the value of one or more nodes as one or more events using ziAPIPollDataEx even when the node is not subscribed or no value change has occured Parameters lin conn Pointer to the ZIConnection with which
202. ion of how the data are available in the struct refer to the documentation of struct ziEvent When no event was available within timeOutMilliseconds the ziEvent Type field will be ZI_DATA_NONE and the ziEvent Count field will be zero Otherwise these fields hold the values corresponding to the event that occurred Parameters in conn Pointer to the ZIConnection for which events should be received out ev Pointer to a ZlEvent struct in which the received event will be written in timeOutMilliseconds Time to wait for an event in milliseconds If 1 it will wait forever if O the function returns immediately Returns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Z _OVERFLOW when a FIFO overflow occurred See Data Handling for an example See Also ziAPISubscribe ziAPlUnSubscribe ziAPIGetValueAsPollData ziEvent LabOne Programming Manual Revision 31421 Zurich Instruments 335 6 4 File Documentation ziAPIGetValueAsPollData ZlResult_enum ziAPIGetValueAsPollData ZIConnection conn const char path triggers a value request which will be given back on the poll event queue Use this function to receive the value of one or more nodes as one or more events using ziAPIPollDataEx even when the node is not subscribed or no value change has occured Parameters lin conn Pointer to the ZIConnection with which the value should be r
203. is sufficient to provide the Device ID only highlighted in Figure 5 4 The host and port are then determined by network discovery Should the discovery not work prepend lt host gt lt port gt to the Device ID Examples are myhf2 company com 8004 dev466 or myhf2 company com 8004 In the latter case the first found instrument on the data server listening on myhf2 company com 8004 will be selected 33 zitxample PollData vi oss 7 a File Edit Operate Tools Window Help SAEZ Tested Instruments N oo Ne Mu Wi Zurich y m N I Instruments ziValueType DEMOD_SAMPLE Locked Context Help C Program Files x86 National Instruments LabVIEW 2009 instr lib Zurich Instruments LabOne Public ziOpen vi Address HandleOut tname obsolete aut DE rt obsolete auto Error Out Error In Creates a connection to a Data Server Address is of the format lt host gt lt port lt Device ID gt Usually it is sufficient to provide the Device ID only The host and port are then determined by network discovery Should the discovery not work prepend lt host gt lt port gt to the Device ID Examples are myhf2 company com 8004 dev466 or myhf2 company com 8004 In the latter case the first found instrument on the data server listening on myhf2 company com 8004 will be selected a Figure 5 4 LabOne LabVIEW Example Poll Data Device selection Ru
204. l 5 status 6 setDouble setDouble ziDAQServer argl str arg2 float arg3 gt None argl Reference to the ziDAQServer class arg2 Path string of the node SEEING en 2 setInt ziDAQServer argl str arg2 int arg3 gt None argl Reference to the ziDAQServer class arg2 Path string of the node subscribe subscribe ziDAQServer argl object arg2 gt None Subscribe to one or several nodes Fetch data with the poll command In order to avoid fetching old data that is still in the buffer execute a flush command before subscribing to data streams argl Reference to the ziDAQServer class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified sweep sweep ziDAQServer argl long arg2 gt ziDAQSweeper Create a sweeper class This will start a thread for asynchronous sweeping argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms sync sync ziDAQServer argl gt None Synchronize all data path Ensures that get and poll commands return data which was recorded after the setting changes in front of the sync command This sync command replaces the functionality of all syncSet flush and echoDevice commands argl Reference to the ziDAQServer class syncSetDouble syncSetDouble ziDAQServer argl str arg2 float arg3 gt float argl Reference to the ziDAQServer class arg2 Path
205. l of the tree ziPython ziListEnum settingsonly gt 0x08 Returns only nodes which are marked as setting Or combinations of flags can be used progress progress ziDAQSweeper argl gt object Reports the progress of the measurement with a number between 0 and 1 read read ziDAQSweeper argl bool arg2 gt object Read sweep data If the sweeping is still ongoing only a subset of sweep data is returned If huge data sets are recorded call this method to keep memory usage reasonable argl optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False read ziDAQSweeper argl gt object save save ziDAQSweeper argl str arg2 gt None Save sweeper data to file argl Reference to the ziDAQSweeper class arg2 File name string without extension LabOne Programming Manual Revision 31421 Zurich Instruments 96 4 4 LabOne Python API ziPython Command Reference SEE zee set ziDAQSweeper argl str arg2 float arg3 gt None Sweep Parameters Path name Type Description sweep device string Device that should be used for the parameter sweep e g dev99 sweep start double Sweep start frequency Hz sweep stop double Sweep stop frequency Hz sweep gridnode string Path of the node that should be used for sweeping For frequency sweep applications this will be e g oscs 0 freq
206. l the next trigger is recorded again LabOne Programming Manual Revision 31421 Zurich Instruments 35 2 4 Software Trigger Recorder Module Setting Path Type Unit Description trigger N holdoff double Seconds The holdoff time the amount of time until the time next trigger is recorded again trigger N uint64 UHFLI and MFLI only For HW Triggers only hwtrigsource Specify which of the four hardware trigger channels to trigger on trigger N double Many Specify the hysteresis value the trigger is re hysteresis armed after the signal exceeds trigger N level and then falls below trigger N hysteresis if using positive edge trigger N path uint64 The path to the demod sample to trigger on e g demods 3 sample see also trigger N source trigger N pulse max double Only for Pulse triggers The maximum pulse width to trigger on See Figure 2 9 trigger N pulse min double Only for Pulse triggers The minimum pulse width to trigger on See Figure 2 9 trigger N retrigger uint64 1 enable O disable Enable to allow retriggering within one trigger duration If enabled continue recording data in one segment if another trigger comes within the previous trigger s duration If disabled the triggers will be recorded as separate events trigger N source uint64 z The value of trigger N path touse 0 X 1 Y 2 R 3 angle 4 freq 5 phase
207. l23 compulsory parameter 5 trigger endless bool Enable endless triggering l enable O disable 5 trigger forcetrigger bool Force a trigger trigger 0 path string The path to the demod sample to trigger on e g demods 3 sample see also trigger 0 source trigger 0 source int Signal that is used to trigger on a do 0 x X SOURCE 1 y Y_ SOURCE 3 2 r R SOURCE 5 3 angle ANGLE SOURCE 5 4 frequency FREQUENCY SOURCE 5 9 phase PHASE SOURCE 5 6 auxiliary input 0 AUXINO SOURCE 7 auxiliary input 1 AUXIN1_ SOURCE trigger 0 count int Number of trigger edges to record trigger 0 type int Trigger type used Some parameters are oo do only valid for special trigger types trigger off analog edge trigger on source digital trigger mode on DIO analog pulse trigger on source analog tracking trigger on source trigger 0 edge int Trigger edge 1 rising edge 2 falling edge oo do oe oe SW NE O oo le de do 5 3 both trigger 0 findlevel bool Automatically find the value of trigger 0 level based on the current signal value trigger 0 bits int Digital trigger condition trigger 0 bitmask int Bit masking for bits used for triggering Used for digital trigger trigger 0 delay double Trigger frame position s left side oo relative to trigger edge delay 0 gt trigger edge at left border delay lt 0 gt trigger edge inside t
208. lass This will start a thread for running an asynchronous zoomFFT argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms Data and other attributes defined here _ instance size 48 Data descriptors inherited from Boost Python instance det _ weakref _ Data and other attributes inherited from Boost Python instance new lt built in method _ new of Boost Python class object gt T __new__ S gt a new object with type S a subtype of T 4 4 4 Help for ziPython s ziDeviceSettings class An instance of ziDeviceSettings is initialized using the deviceSettings method from ziDAQServer gt gt gt help zhinst ziPython ziDAQServer deviceSettings Help on method deviceSettings in zhinst ziPython ziDAQServer LabOne Programming Manual Revision 31421 Zurich Instruments 92 4 4 LabOne Python API ziPython Command Reference zhinst ziPython ziDAQServer deviceSettings deviceSettings unbound zhinst ziPython ziDAQServer method deviceSettings ziDAQServer argl long arg2 gt ziDeviceSettings Create a deviceSettings class This will start a thread for running an asynchronous deviceSettings argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms Reference help for the ziDeviceSettings class gt gt gt help zhinst ziPython ziDeviceSettings Help on class ziDeviceSettings in zhinst ziPython zhinst ziPython ziDeviceSettings
209. ll function oe de EXAMPLES HF2 Examples specific to the HF2 Series hf2 example autorange determine and set an appropriate range for a sigin channel hf2 example poll hardware trigger Poll demodulator data in combination with a HW trigger de de ol ae 5 hf2 example scope Record scope data using ziDAQServer s 5 synchronous poll function hf2 example zsync poll Synchronous demodulator sample timestamps ae from multiple HF2s via the Zsync feature Note On Windows the MEX file is called either ziDAQ mexw64 or ziDAQ mexw32 for 64 bit and 32 bit platforms respectively and on Linux it is called ziDAQ mexa64 or ziDAQ mexa32 If more than one MEX file is present Matlab automatically selects the correct MEX file for the current platform Using the Built in Documentation To access ziDAQ s documentation within Matlab type either of the following in the Matlab Command Window gt gt help ziDAO gt gt doc ziDAO This documentation is located in the file MATLAB2012 Driver ziDAQ m See Section 3 5 LabOne Matlab API ziDAQ Command Reference for a printer friendly version Running the Examples Prerequisites for running the Matlab examples 1 Matlab is configured for ziDAQ as described above in Section 3 1 2 The Data Server program is running and the instrument is connected to the Data Server See Section 1 1 1 and the User Manual specific to the instrument for more help connecting LabOne
210. llAdvisor if not yet running finish finish ziPllAdvisor argl gt None Stop the pllAdvisor finished finished ziPllAdvisor argl gt bool Check if the command execution has finished Returns True if finished get get ziPllAdvisor argl str arg2 bool arg3 gt object Return a dict with all nodes from the specified sub tree argl Reference to the ziPllAdvisor class LabOne Programming Manual Revision 31421 Zurich Instruments 106 4 4 LabOne Python API ziPython Command Reference arg2 Path string of the node Use wild card to select all arg3 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False get ziPllAdvisor argl str arg2 gt object listNodes listNodes ziPllAdvisor argl str arg2 int arg3 gt list This function returns a list of node names found at the specified path argl Reference to the ziPllAdvisor class arg2 Path for which the nodes should be listed The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents arg3 Enum that specifies how the selected nodes are listed ziPython ziListEnum none gt 0x00 The default flag returning a simple listing if the given node ziPython ziListEnum recursive gt 0x01 Returns the nodes recursively ziPython ziListEnum absolute gt 0x02 Returns absolute paths ziPython ziList
211. mands is that Modules execute their commands asynchronously see Section 2 1 4 Note The LabOne User Interface Command Log can be set to store commands in either Matlab or Python formats which can then be used to start writing custom programs see Section 2 7 Note Much of the same functionality is provided in ziControl but ziControl Ul is not based on ziCore ziCore Module Work Flow Regardless of the Module s function all ziCore Modules follow same work flow in all of the derived interfaces create instantiate an instance of the module set the module s parameters using path value pairs subscribe to instrument nodes from which to obtain data execute the module wait until the module has finished executing intermediate reading of data is possible read the module s data clear the module to remove it from memory The highlighted words above are commands for all the Modules For interface specific concepts when using Modules see the following Sections m Using ziCore Modules in the LabOne Matlab API m Using ziCore Modules in the LabOne Python API LabOne Programming Manual Revision 31421 Zurich Instruments 19 2 1 An Introduction to ziCore based APIs 2 1 4 Synchronous versus Asynchronous Commands The low level API commands such as set Int and poll are synchronous commands that is the interface will be blocked until that command has finished executing the user can not run any commands in
212. mber of samples recorded at lower frequencies whereas sweep averaging sample will influence averaging behavior at higher frequencies An Explanation of Settling and Averaging Times in a Frequency Sweep Figure 2 2 shows which demodulator samples are used in order to calculate an averaged measurement point in a frequency sweep This explanation of the Sweeper s parameters is specific to the following commonly used Sweeper settings sweep gridnode is setto an oscillator frequency e g dev123 oscs 0 freg sweep bandwidthcontrol is set to 2 corresponding to automatic bandwidth control i e the Sweeper will set the demodulator s filter bandwidth settings optimally for each frequency used sweep scan is set to 0 corresponding to sequential scan mode for the range of frequency values swept i e the frequency is increasing for each measurement point made Each one of the three red segments in the demodulator data correspond to the data used to calculate one single Sweeper measurement point The light blue bars correspond to the time the sweeper should wait as specified by the sweep settling tc parameter and the purple bars correspond to the time specified by the sweep settling time parameter The sweeper will wait for the maximum of these two times according to Equation 2 1 When measuring at lower frequencies the Sweeper sets a smaller demodulator filter bandwidth due to automatic sweep bandwidthcontrol corresponding to a larger demod
213. modSample y See Also ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 310 6 4 File Documentation ziAPIGet DIOSample ZIResult_enum ziAPIGetDIOSample ZIConnection conn const char path ZIDIOSample value Paramet Returns Gets the Digital I O sample of the specified node This function retrieves the newest available DIO sample from the specified node The value first found is returned if more than one value is available a wildcard is used in the path This function is only applicable to nodes ending in DIOS O 9 INPUT ers lin conn Pointer to the ZIConnection with which the value should be retrieved lin path Path to the node holding the value out value Pointer toa ZIDIOSample struct in which the value should be written 7Z _INFO_SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred ZI ERROR LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z _ERROR_OVERFLOW when a FIFO overflow occurred Z ERROR COMMAND on an incorrect answer of the server Z ERROR SERVER INTERNAL if an internal error occurred in the Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved or no value is attached to the node Z _ERROR_TIMEOUT when communication timed out
214. modulator R value phasestddev double Radians Standard deviation of demodulator phase value phase noise auxin0stddev double Volts Standard deviation of Auxiliary Input 1 value auxinlstddev double Volts Standard deviation of Auxiliary Input 2 value xpwr double Volts Average power of demodulator x value ypwr double Volts Average power of demodulator y value rpwr double Volts Average power of demodulator R value rpwr double Volts Average power of demodulator x value auxin0pwr double Volts Average power of Auxiliary Input 1 value auxinlpwr double Volts Average power of Auxiliary Input 2 value grid double Many Values of sweeping setting frequency values at which demodulator samples where recorded bandwidth double Hz Demodulator filter s bandwidth set for each measurement point assuming we re performing a frequency sweep tc double Seconds Demodulator s filter time constant for each measurement point settling double Seconds The waiting time for each measurement point settimestamp uint64 Ticks The timestamp at which we verify that the frequency for the current measurement point was set on the device by reading back demodulator data nexttimestamp uint64 Ticks The timestamp at which we can obtain the data for that measurement point i e nexttimestamp settimestamp corresponds roughly to the demodulator filter settling time LabOne Programming Manual Revision 31421 Zurich Instruments 2 3
215. mple The structure used to hold data for a single digital I O sample include ziAPI h typedef struct ZIDIOSample ZITimeStamp timeStamp uint32 t bits uint32 t reserved ZIDIOSample Data Fields ZlTimeStamp timeStamp The timestamp at which the values have been measured uint32_t bits The digital I O values uint32_t reserved Filler to keep 8 bytes alignment in the array of ZIDIOSample structures LabOne Programming Manual Revision 31421 Zurich Instruments 215 6 3 Data Structure Documentation 6 3 13 struct ZIDoubleDataTS The structure used to hold a single IEEE double value Same as Z DoubleData but with timestamp include ziAPI h typedef struct ZIDoubleDataTS ZITimeStamp timeStamp ZIDoubleData value ZIDoubleDataTS Data Fields ZlTimeStamp timeStamp Time stamp at which the value has changed 7Z DoubleData value LabOne Programming Manual Revision 31421 Zurich Instruments 216 6 3 Data Structure Documentation 6 3 14 struct ziEvent This struct holds event data forwarded by the Data Server Deprecated See ZlEvent include ziAPI h typedef struct ziEvent ziAPIDataType Type unsigned int Count unsigned char Path 256 union ziEvent Val Val unsigned char Data 0x400000 ziEvent Data Structures union ziEvent Val Data Fields ziAPIDataType Type unsigned int Count 5 unsigned char Pat union ziEvent
216. mple break case ZI VALUE TYPE TREE CHANGE DATA printf Su elements of tree changed data s n Event gt count Event gt path for j 0 j lt Event gt count z jtt switch Event gt value treeChangeDataold j Action LabOne Programming Manual Revision 31421 Zurich Instruments 219 6 3 Data Structure Documentation case ZI TREE ACTION REMOVE printf Tree removed s n Event gt value treeChangeDataold j Name break case ZI_TREE_ACTION_ADD printf treeChangeDataOld added s n Event gt value treeChangeDataOld jl Name break case ee ZI TREE ACTION CHANG printf treeChangeDataOld changed s n Event gt value treeChangeDataOld jl Name break break default printf Unexpected event value type d n Event gt valueType break LabOne Programming Manual Revision 31421 Zurich Instruments 220 6 3 Data Structure Documentation Data Structure Documentation union ziEvent Val typedef union ziEvent Val void ziDoubleType ziIntegerType ziEvent Val Data Fields void Void Void DemodSample SampleDemod AuxInSample SampleAuxIn DIOSample SampleDIO Double Integer TreeChange Tree ByteArrayData ByteArray ScopeWave Wave DemodSample SampleDemod AuxinSample SampleAuxin DlOSample SampleDIO ziDoubleType Dou
217. mple ListDevices vi ziExample PIDAdvisorModul vi ziExample PollData vi Visit ni com ziExample PWA_Signallnput vi for more examples ziExample ReadSingleValue vi ziExample SaveDemodData vi ziExample Scope vi ziExamole Set Get Freauencv vi allthe words X LabOne m Requirements Hardware ouuuveuuuuuuesugguuuuuues Find hardware v E Limit results to hardware l Add to Favorites Setup l Help Close Figure 5 3 Search for LabOne in NI s Example Finder to find examples to run with your instrument Running the LabOne Example VIs This section describes how to run a LabOne LabVIEW example on your instrument Note Please ensure that the example you would like to run is supported by your instrument class and its options set For example examples for HF2 Instruments can be found in the Example Finder LabOne Programming Manual Revision 31421 Zurich Instruments 118 5 2 Getting Started see Section 5 2 4 by searching for HF2 examples for the UHFLI by searching for UHFLI and examples for the MFLI by searching for MFLI Device Connection After opening one of the LabOne LabVIEW examples please ensure that the example is configured to run on the desired instrument type ziOpen vi establishes a connection to a Data Server The address is of the format lt host gt lt port gt lt Device ID gt Usually it
218. mplement to ziAPISubscribe By using wildcards or by using a path that is not a leaf node but contains sub nodes more than one node can be unsubscribed with one function call Parameters lin conn Pointer to the ziConnection for which to unsubscribe for lin path Path to the Nodes to unsubscribe Returns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values Zl TIMEOUT when communication timed out See Data Handling for an example See Also ziAPISubscribe ziAPIPollDataEx ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 195 6 2 Module Documentation ziAPIPollDataEx ZlResult_enum ziAPIPollDataEx ZIConnection conn ZlEvent ev uint32_t timeOutMilliseconds checks if an event is available to read This function returns immediately if an event is pending Otherwise it waits for an event for up to timeOutMilliseconds All value changes that occur in nodes that have been subscribed to or in children of nodes that have been subscribed to are sent from the Data Server to the ziAPI sess
219. n Package gt gt gt help zhinst Help on package zhinst NAME zhinst Zurich Instruments LabOne Python API FILE usr lib python2 7 dist packages zhinst init py MODULE DOCS http does python org library zhinst DESCRIPTION Contains the API driver utility functions and examples for Zurich Instruments devices PACKAGE CONTENTS examples package utils ziPython DATA all ziPython utils Help for zhinst s Utility Functions gt gt gt help zhinst utils Help on module zhinst utils in zhinst NAME zhinst utils Zurich Instruments LabOne Python API Utility Functions LabOne Programming Manual Revision 31421 Zurich Instruments 80 4 4 LabOne Python API ziPython Command Reference FILE usr lib python2 7 dist packages zhinst utils py MODULE DOCS http docs python org library zhinst utils DESCRIPTION This module provides basic utility functions for Creating an API session by connecting to an appropriate Data Server Detecting devices Loading and saving device settings Loading data saved by either the Zurich Instruments LabOne User Interface or ziControl into Python as numpy structured arrays FUNCTIONS autoConnect default port None api level None Try to connect to a Zurich Instruments Data Server with an attached available UHF or HF2 device Important autoConnect does not support MFLI devices Args default port int optional The default port to use when con
220. n a single call as well as an event LabOne Programming Manual Revision 31421 Zurich Instruments 243 6 4 File Documentation framework with which the user may subscribe the parameter tree and receive the events which occur when values change m All functions do not check passed pointers if they re NULL pointers In that case a segmentation fault will occur The ZIConnection is not thread safe One connection can only be used in one thread If you want to use the ziAPI in a multi threaded program you will have to use one ZIConnection for each thread that is communicating or implement a mutual exclusion m The Data Server is able to handle connections from threads simultaneously The Data Server takes over the synchronization LabOne Programming Manual Revision 31421 Zurich Instruments 244 6 4 File Documentation Data Structure Documentation struct ZIDoubleDataTS The structure used to hold a single IEEE double value Same as Z DoubleData but with timestamp include ziAPI h typedef struct ZIDoubleDataTS ZITimeStamp timeStamp ZIDoubleData value ZIDoubleDataTS Data Fields __ ZiTimeStamp timeStamp Time stamp at which the value has changed 7Z DoubleData value LabOne Programming Manual Revision 31421 Zurich Instruments 245 6 4 File Documentation struct ZllntegerDataTS The structure used to hold a single 64bit signed integer value Same as ZlintegerData but with timestamp include
221. nd Reference de de dE AP AP AP AP P AP AP AP OP OP AO DO AP AP OO result result result AP de AP AP AP AP AP AP P AP AP OP OP AP AP AP AP P P AP AP P P OO AP de dE AP AP AP AP path Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified ziDAQ unsubscribe handle path Unsubscribe from one or several nodes During the recording process paths can not be subscribed or unsubscribed handle Reference to the ziDAQZoomFFT class path Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified ziDAQ execute handle Start the zoom FFT Subscription or unsubscription is no more possible until the zoomFFT is finished ZiDAQ finished handle handle Handle of the zoom FFT session Returns 1 if the zoom FFT is finished otherwise 0 ZiDAQ read handle handle Handle of the zoom FFT session Transfer the zoomFFT data to Matlab ziDAQ progress handle Report the progress of the measurement with a number between 0 and 1 ZiDAQ finish handle Stop the zoomFFT The zoom FFT may be restarted by calling execute again ziDAQ clear handle handle Handle of the zoom FFT session Stop the current zoom FFT Device Settings Module Device Settings Parameters devicesettings device string Device whose settings are to be saved loaded e g dev99
222. ne Public VI Tree vi Modules e g Sweeper enable additional functionality of your Zurich instrument device in Labview The outline of the instruction flow for a LabVIEW Module is as following 1 2 ziModSetValue vi Initialization Create a ziModHandle from a ziHandle ziModStart vi Configuration Perform the module s settings For example using the virtual instrument 3 Subscribe Define the recorded data node ziModSubscribe vi 4 Execute Start the operation ofthe module ziModExecute vi 5 Data Read data from the module For example using the ziModGetNextNode vi and ziModGetData vi 6 Utility Perform data analysis on the read data potentially repeating Step 2 Step 3 and or Step d i 1 H 7 Clear Terminate the APl s connection to the module ziModClear vi Zurich Instruments LabOne VI Tree Use the Example Finder and search for LabOne to find examples for the usage of the LabOne instrument driver To launch Example Finder select Find Examples from the LabVIEW Help menu Initialize Configuration Data Utility a ziOpen vi ziSetValue vi ziGetValueDouble vi ziSubscribe vi ziPollDataEx vi ziLoadSettings vi zilist vi ziListDevices vi ziClose vi za a _ EJ ja a mal te i Er Double v ziUnSubscribe vi ziGetEvent vi ziSaveSettingsvi ziSelectDevice vi me zu ziSetValueD
223. nect ziAPlInit ziAPIDestroy ziAPIGetConnectionVersion LabOne Programming Manual Revision 31421 Zurich Instruments 133 6 2 Module Documentation See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 134 6 2 Module Documentation ziAPlGetConnectionAPlLevel ZIResult_enum ziAPIGetConnectionAPlLevel ZIConnection conn ZIAPIVersion_enum apiLevel Returns ziAPI level used for the connection conn Parameters lin conn Pointer to ZIConnection out apiLevel Pointer to preallocated ZIAPIVersion_enum receiving the ziAPI level Returns 7Z _INFO_SUCCESS on success Z ERROR CONNECTION if level can not be determined due to conn is not connected See Also ziAPIConnectEx ziAPIGetVersion LabOne Programming Manual Revision 31421 Zurich Instruments 135 6 2 Module Documentation ziAPIGetRevision ZIResult_enum ziAPIGetRevision unsigned int revision Retrieves the revision of ziAPI Sets an unsigned int with the revision build number of the ziAPI you are using Parameters lin revision Pointer to an unsigned int to fill up with the revision Returns Zl INFO SUCCESS LabOne Programming Manual Revision 31421 Zurich Instruments 136 6 2 Module Documentation 6 2 2 Tree All parameters and streams are organized in a tree You can list the whole tree parts of it or single items using ziAPIListNodes or you may update the tree with nodes of newl
224. necting to the Data Server specify 8005 for the HF2 Data Server and 8004 for the UHF Data Server api level int optional The API level to use either 1 4 or 5 HF2 only supports Level 1 Level 5 is recommended for UHF and MFLI devices Returns ziDAQServer An instance of the ziPython ziDAQServer class that is used for communication to the Data Server Raises RunTimeError If no running Data Server is found or no device is found that is attached to a Data Server x If default port is not specified None then first try to connect to a HF2 if no server devices are found then try to connect to an UHF This behaviour is useful for the API examples If we cannot connect to a server and or detect a connected device raise a RunTimeError If default port is 8004 try to connect to a UHF if it is 8005 try to connect to an HF2 If no server and device is detected on this port raise a RunTimeError autoDetect dag exclude None Return a string containing the first device ID not in the exclude list that is attached to the Data Server connected via dag an instance of the ziPython ziDAQServer class Args daq ziDAQServer An instance of the ziPython ziDAQServer class representing an API session connected to a Data Server exclude list of str optional A list of strings specifying devices to exclude autoDetect will not return the name of a device in this list LabOne Programming Manual Revision 31421 Zuri
225. ng started with Python itself see either the Python Tutorial or one of the many online resources for example the learnpython org The Interactive Python Course is an interesting resource for those already familiar with Python basics LabOne Programming Manual Revision 31421 Zurich Instruments 70 4 1 Installing the LabOne Python API 4 1 Installing the LabOne Python API 4 1 1 4 1 2 Requirements In order to install and use the LabOne Python API you require 1 Either a Python 2 6 or a Python 2 7 installation on either Windows or Linux 2 The NumPy python package installed for your Python installation 3 The correct version of ziPython for your Python version and platform available from the Zurich Instruments download page login required Note Linux users must also ensure they download the version of zi Python that is Unicode compatible with their Linux distribution s Python installation see Section 4 1 4 for help determining which version is required Note Important If you your system already has an existing ziPython installation older than version 14 08 please be sure to either manually uninstall ziPython or manually remove the existing zhinst installation folder This is due to improvements in the zhinst package structure in 14 08 examples for different device classes are now organized in separate module sub directories and the Python installer simply overwrites the existing installation leading to a duplic
226. ngth bool Maximum number of entries stored in the measurement history trigger clearhistory bool Remove all records from the history list set ziDAQRecorder argl str arg2 int arg3 gt None set ziDAQRecorder argl str arg2 str arg3 gt None set ziDAQRecorder argl object arg2 gt None argl Reference to the ziDAQRecorder class arg2 A list of path value pairs subscribe subscribe ziDAQRecorder argl str arg2 gt None Subscribe to one or several nodes After subscription the recording process can be started with the execute command During the recording process paths can not be subscribed or unsubscribed argl Reference to the ziDAQRecorder class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified trigger trigger ziDAQRecorder argl gt None Execute a manual trigger unsubscribe unsubscribe ziDAQRecorder argl str arg2 gt None Unsubscribe from one or several nodes During the recording process paths can not be subscribed or unsubscribed argl Reference to the ziDAQRecorder class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified Data and other attributes defined here _ init lt built in function init gt Raises an exception This class cannot be instantiated from Python Data descriptors inherited from Boost Python instance i
227. nnection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z READONLY on attempt to set a read only node Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values 7 _TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIIntegerData Valuel LabOne Programming Manual Revision 31421 Zurich Instruments 317 6 4 File Documentation if RetVal ziAPISetValueD Conn DEV1046 demods rate 5 53 I ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer if RetVal ziAPIGetValuel Conn DEV1046 demods 0 rate amp Valuel ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf Value f n float Valuel See Also ziAPIGetValueD ziAPISyncSetValueD LabOne Programming Manual Revision 31421 Zurich Instruments 318 6 4 File Documentation ziAPISetValuel ZIResult_enum ziAPISetValuel ZIConnection
228. nning ona different computer connect manually to the Data Server via ziDAQ s connect function gt gt ziDAQ connect hostname port where hostname should be replaced by the IP of the computer the Data Server is running on and port is specified as in Section 1 1 1 LabOne Programming Manual Revision 31421 Zurich Instruments 52 3 4 Troubleshooting the LabOne Matlab API Error Message Error using ziIDAQ ZIAPIException on path dev123 sigins 0 imp50 with status code 16387 Value or Node not found The API is connected to the Data Server but the command failed to find the specified node Please Check whether your instrument is connected to the Data Server in the User Interface if it is not connected the instruments device node tree e g dev123 will not be constructed by the Data Server Check whether the node path is spelt correctly m Explore the node tree to verify the node actually exists with the listNodes command gt gt ziDAQ listNodes dev123 sigins 0 3 Error Message using ziDAQ Server not connected Use ziDAQ connect first A ziDAQ command was issued before initializing a connection to the Data Server First use the connect command gt gt ziDAQ connect hostname port where hostname should be replaced by the IP address of the computer the Data Server is running on and port is specified as in Section 1 1 1 If the Data Server is running on the same computer use local
229. nning the VI and Block Diagram The example can be ran as any LabVIEW program by clicking the Run icon in the icon bar Be sure to check the example s code and explanation by pressing Ctrl e to view the example s block diagram see Figure 5 5 LabOne Programming Manual Revision 31421 Zurich Instruments 119 5 2 Getting Started ziExample PollData vi Block Diagram Window Help File Edit View Project Operate Tools EE Oud demods 0 sample auxins O sample dios Ofinput demods 2iOpen vi ort so is example VI explains the procedure for streaming instrument output data equirements HF2 or UHFLI device connected to the computer user interface to adjust settings and make sure that the device is properly connected ata is streamed using the following steps 1 A connection is initialized and the required data is subscribed 2 After the subscription the LabVIEW vi continuaulsy receives data from the ziServer which is the interface to the device To read demodulator samples a defined sampling rate it is recommended to subscribe to a demodulator node and to fetch the data using the 2iPollData vi function In the left part of he block diagram both demodulator 1 and 2 samples are subscribed using a loop by adding more entries to the array a subscription to even more modulators can be done with little effort 3 Now samples are written to a buffer in the data se
230. not be found ZI ERROR SOCKET_CONNECT if no connection could be established 7 _ERROR_OVERFLOW when a FIFO overflow occurred Z FRROR_SOCKET_INIT if initialization of the socket failed 7 _ERROR_CONNECTION when the Data Server didn t return the correct answer 7 _ERROR_TIMEOUT when initial communication timed out See Also ziAPlDisconnect ziAPIInit ziAPIDestroy See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 293 6 4 File Documentation ziAPIDisconnect ZlResult_enum ziAPIDisconnect ZIConnection conn Disconnects an established connection Disconnects from Data Server If the connection has not been established and the function is called it returns without doing anything Parameters lin conn Pointer to ZIConnection to be disconnected Returns Z _INFO_SUCCESS See Also ziAPIConnect ziAPlInit ziAPIDestroy See Connection for an example LabOne Programming Manual Revision 31421 Zurich Instruments 294 6 4 File Documentation ziAPlListImplementations ZIResult_enum ziAPIListlmplementations char implementations uint32_t bufferSize Returns the list of supported implementations Returned names are defined by implementations in the linked library and may change depending on software version Parameters out implementations Pointerto a buffer receiving a newline delimited listofthenames of all the supported ziAPI implementati
231. nts 345 Glossary This glossary provides easy to understand descriptions for many terms related to measurement instrumentation including the abbreviations used inside this user manual A A D AC ADC AM Amplitude Modulated AFM AM AFM API ASCII Atomic Force Microscope AFM AVAR B Bandwidth BW BNC C Analog to Digital See Also ADC Alternate Current Analog to Digital Converter Amplitude Modulation AFM mode where the amplitude change between drive and measured signal encodes the topography or the measured AFM variable See Also Atomic Force Microscope Application Programming Interface American Standard Code for Information Interchange Microscope that scans surfaces by means an oscillating mechanical structure e g cantilever tuning fork whose oscillating tip gets so close to the surface to enter in interaction because of electrostatic chemical magnetic or other forces With an AFM it is possible to produce images with atomic resolution See Also Amplitude Modulated AFM Frequency Modulated AFM Phase modulation AFM Allen Variance The signal bandwidth represents the highest frequency components of interest in a signal For filters the signal bandwidth is the cut off point where the transfer function of a system shows 3 dB attenuation versus DC In this context the bandwidth is a synonym of cut off frequency feut off Or 3dB frequency f_gqg The concept of bandwidth is used when the dynami
232. o text based commands LabOne User Interface The browser based user interface that connects to the Web Server m LabOne Web Server The program that generates the browser based LabOne User Interface ziControl The GUI for HF2 Instruments ziCore The core C library upon which many APIs are based see Part Il of this document m Modules ziCoreSoftware components that provide a unified interface to APIs to perform high level common tasks such as sweeping data 1 1 1 LabOne Port and Hostname Selection In order for an API client to connect to the correct Data Server both the correct hostname and port must be provided when the API session is instantiated Firstly LabOne Programmers must be aware that HF2 Instruments use a different Data Server program than UHFLI and MFLI Instruments A LabOne API client connects to the correct Data Server for their instrument by specifying the appropriate port use port 8004 for UHF and MFLI Instruments and 8005 for HF2 Instruments Both servers can handle connections to multiple devices from multiple software interfaces APIs or User Interfaces simultaneously see Figure 1 2 for an example configuration Secondly MFLI Programmers should be aware that in contrast to HF2 and UHFLI instruments the Data Server runs on the instrument itself Thus the instrument s hostname must be provided as the input argument when the API session is instantiated This willbe the same hostname that is used to acce
233. oll function 5 example record async Record data asyncronously using ziDAQ s 5 record module example record demod trigger Record demodulator data upon a rising 5 edge trigger via ziDAQ s record module example record digital trigger Record data using a digital trigger via ziDAQ s record module example save device settings simple Save and load device settings synchronously using ziDAQ s utility functions example save device settings expert Save and load device settings asynchronously with ziDAQ s devicesettings module example sweeper Perform a frequency sweep using ziDAQ s sweep module oo de dE oP oP oP oP ae LabOne Programming Manual Revision 31421 Zurich Instruments 46 3 2 Getting Started with the LabOne Matlab API 32 2 32 9 de example sweeper rstddev fixedbw Perform a frequency sweep plotting the stddev in demodulator output R using ziDAQ s sweep module do do 5 example sweeper two demods Perform a frequency sweep saving data 5 from 2 demodulators using ziDAQ s sweep 3 module 5 example zoomfft Perform an FFT using ziDAQ s zoomFFT 3 module oo de EXAMPLES UHF Examples specific to the UHF Series uhf example boxcar Record boxcar data using ziDAQServer s synchronous poll function 5 uhf example scope Record scope data using ziDAQServer s synchronous poll function uhf example scope offset Record digitizer data using ziDAQServer s de synchronous po
234. om any of the ziCore based APIs This means that an instrument can be conveniently configured via the LabOne User Interface and then its settings saved to file This settings file can then be loaded via an API in order to configure an instrument for a script See the Section 2 5 LabOne Programming Manual Revision 31421 Zurich Instruments 40 Part Il LabOne APIs This part of the Programming Manual documents language specific installation and usage for each of the LabOne APIs For details of common functionality and features that are shared by all the LabOne APIs please refer to Partl Refer to Chapter 3 forthe LabOne Matlab API ziDAQ m Chapter 4 forthe LabOne Python API ziPython Chapter5 forthe LabOne LabVIEW API Chapter 6 forthe LabOneC API ziAPI Chapter 3 Matlab Programming The Mathwork s numerical computing environment Matlab has powerful tools for data analysis and visualization and can be used to create graphical user interfaces or automatically generate reports of experimental results in various formats LabOne s Matlab API also known as ziDAQ Zurich Instruments Data Acquisition enables the user to stream data from their instrument directly into Matlab allowing them to take full advantage of this powerful environment This chapter aims to help you get started using Zurich Instruments LabOne s Matlab API zi DAQ to control your instrument please refer to Section 3 1 for help Installing the LabOne
235. on Retrieves the revision of ziAPI Sets an unsigned int with the revision build number of the ziAPI you are using Parameters lin revision Pointer to an unsigned int to fill up with the revision Returns Zl INFO SUCCESS LabOne Programming Manual Revision 31421 Zurich Instruments 299 6 4 File Documentation ziAPIList Nodes ZlResult_enum ziAPIListNodes ZIConnection conn const char path char nodes int buffe Paramet Returns rSize int flags Returns all child nodes found at the specified path This function returns a list of node names found at the specified path The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents The list is returned in a null terminated char buffer each element delimited by a newline If the maximum length of the buffer bufferSize is not sufficient for all elements nothing will be returned and the return value willbe ZI_LENGTH ers in conn Pointer to the ZIConnection for which the node names should be retrieved lin path Path for which all children will be returned The path may contain wildcard characters out nodes Upon call filled with newline delimited list of the names of all the children found The string is zero terminated lin bufferSize The length of the buffer used for the nodes output parameter lin flags A combination of flags applied bitwise Jas defined in ZlListNodes_enum
236. on ziAPIGetValueD ZlResult_enum ziAPIGetValueD ZIConnection conn const char path ZIDoubleData value gets the double type value of the specified node This function retrieves the numerical value of the specified node as an double type value The value first found is returned if more than one value is available a wildcard is used in the path Parameters in Pointer to ZIConnection with which the value should be retrieved in conn path Path to the node holding the value out value Pointer to a double in which the value should be written Returns ZI_INFO_SUCCESS on success ZILERROR_CONNECTION when the connection is invalid not connected or when a communication error occurred ZI_ERROR_LENGTH if the path s length exceeds MAX_PATH_LEN ZI ERROR OVERFLOW when a FIFO overflow occurred ZI ERROR COMMAND on an incorrect answer of the server ZI ERROR SERVER INTERNAL if an internal error occurred in Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved or no value is attached to the node ZL ERROR TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void UpdateValue ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIDoubleData ValueD if RetVal LabOne Programming Manual Revision 31421 Zurich Instruments 147 6 2 Module Documentation ziAPISetValuel Conn
237. onn ZIResult enum RetVal char ErrBuffer zIEvent Event unsigned int Cnt 0 allocate ZIEvent in heap memory instead of getting it from stack will secure against stack overflows especially in windows 7 if Event ziAPIAllocateEventEx O NULL fprintf stderr Can t allocate memory n return subscribe to all nodes if RetVal ziAPISubscribe Conn VAN jj t ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t subscribe s n ErrBuffer ziAPIDeallocateEventEx Event return loop 1000 times while Cnt lt 1000 get all demod rates from all devices every 10th cycle if Cnt 10 if RetVal ziAPIGetValueAsPollData Conn demods rate ZI INFO SUCCESS LabOne Programming Manual Revision 31421 Zurich Instruments 177 6 2 Module Documentation ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get value as poll data s n ErrBuffer break poll data until no more data is available while 1 if RetVal ZiAPIPollDataEx Conn Event 0 ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t poll data s n ErrBuffer break else The field Count of the Event struct is zero when no data has been polled if Event gt valueType ZI VALUE TYPE N
238. onnect conf Locating the zhinst Installation Folder and Examples 4 2 4 The examples distributed with the zhinst package can serve as a Starting point to program your own measurement needs The example python files however are generally not installed in user space In order to ensure that you have sufficient permission to edit the examples and that your modifications are not overwritten by a later upgrade of the zhinst package please copy them to your own user space before editing them The examples are contained in a subfolder of the zhinst package installation folder PYTHONROOT lib site packages zhinst If you are unsure about the location of your PYTHONROOT the path ___ attribute of the zhinst module can be used in order to determine its location for example gt gt gt import zhinst gt gt gt print zhinst path __ will output something similar to C Python27 lib site packages zhinst Using ziCore Modules in the LabOne Python API In the LabOne Python API ziCore Modules are configured and controlled by instantiating an object of the Module s class For example in order to use the Sweeper Module a sweeper object is created as following LabOne Programming Manual Revision 31421 Zurich Instruments 77 4 2 Getting Started with the LabOne Python API gt gt gt daq ziPython ziDAQServer localhost 8004 4 Create a connection to the Data Server running on the same PC as the API client gt gt gt t
239. onnection conn const char hostname uint16_t port ZIAPIVersion_enum apiLevel const char implementation Connects to Data Server and enables extended ziAPI LabOne Programming Manual Revision 31421 Zurich Instruments 240 6 4 File Documentation 7l Result_enum ziAPIGetConnectionAPlLevel ZIConnection conn ZIAPlVersion_enum apiLevel Returns ziAPI level used for the connection conn zlResult_enum ziAPIGetRevision unsigned int revision Retrieves the revision of ziAP 7 Result_enum ziAPIListNodes ZIConnection conn const char path char nodes int bufferSize int flags Returns all child nodes found at the specified path Z Result enum ziAPlUpdateDevices ZIConnection conn Search for the newly connected devices and update the tree 7lResult_enum ziAPIConnectDevice ZiConnection conn const char deviceSerial const char devicelnterface const char interfaceParams Connect a device to the server 7l Result_enum ziAPIDisconnectDevice ZIConnection conn const char deviceSerial Disconnect a device from the server 7l Result_enum ziAPIGetValueD ZIConnection conn const char path ZIDoubleData value gets the double type value ofthe specified node 7l Result_enum ziAPIGetValuel ZIConnection conn const char path ZllntegerData value gets the integer type value ofthe specified node ziResult_enum ziAPlGetDemodSample ZIConnection conn const char path ZIDemodSample
240. ons The string is zero terminated lin bufferSize The size of the buffer assigned to the implementations parameter Returns ZI INFO SUCCESS on success Z ERROR LENGTH if the length of the char buffer given by MaxLen is too small for all elements See Also ziAPIConnectEx LabOne Programming Manual Revision 31421 Zurich Instruments 295 6 4 File Documentation ziAPICon nectEx ZIResult_enum ziAPIConnectEx ZIConnection conn const char hostname uint16_t port ZIA Paramet PlVersion_enum apiLevel const char implementation Connects to Data Server and enables extended ZiAPI With apiLevel ZI_API_VERSION_1 and implementation NULL this call is equivalent to plain ziAPlConnect With other version and implementation values enables corresponding ziAPI extension and connection using different implementation ers lin conn Pointer to the ZIConnection with which the connection should be established in hostname Name of the host to which it should be connected if NULL localhost will be used as default lin port The number of the port to connect to If O the port of the local Data Server will be used lin apiLevel Specifies the ziAP compatibility level to use for this connection 1 or 4 lin implementation Specifies implementation to use for a connection must be one of the returned by ziAPIListImplementations or NULL to select default implementation Returns ZI INFO
241. ons of flags might be used ziDAQ subscribe handle path Not relevant for the device settings module de de dE AP AP AP AP P AP AP AP OP OP AO DO AP AP OO ziDAQ unsubscribe handle path Not relevant for the device settings module ZiDAQ execute handle Execute the command result ziDAQ finished handle handle Handle of the device settings session Returns 1 if the command is finished otherwise 0 result ziDAQ read handle handle Handle of the device settings session Transfer the device settings to Matlab Not relevant since device settings are saved to a file result ziDAQ progress handle Report the progress of the command with a number between 0 and 1 ZiDAQ finish handle Stop the device settings module The module may be restarted by calling execute again ZiDAQ clear handle handle Handle of the device settings session End the current device settings thread de de AP AP AP AP AP AP AP AP AP OP OP AP AP AP AP AP P AP AP P P OO PLL Advisor Module PLL Advisor Parameters AP oP dE AP X AP AP PLL with the current settings The phase margin should be greater than 45 deg and preferably pllAdvisor bode struct Output parameter Contains the resulting bode plot of the PLL simulation pllAdvisor calculate int Command to calculate values Set to 1 to start 5 the calculation pllAdvisor center double Center frequency of
242. ons of flags might be used path path handle Start the PLL Advisor handle Handle of the PLL Advisor session Returns 1 if the command is finished otherwise 0 Handle of the PLL Advisor session Read pllAdvisor data If the simulation is still ongoing only a is returned handle Report the progress of the command with a number handle Stop the PLL Advisor module LabOne Programming Manual Revision 31421 Zurich Instruments 65 3 5 LabOne Matlab API ziDAQ Command Reference PID Advisor Module PID Advisor Parameters pidAdvisor advancedmode int pidAdvisor auto int pidAdvisor bode struct pidAdvisor bw double pidAdvisor calculate int pidAdvisor display freqstart double pidAdvisor display freqstop double pidAdvisor display timestart double pidAdvisor display timestop double pidAdvisor dut bw double pidAdvisor dut damping double pidAdvisor dut delay double pidAdvisor dut fcenter double pidAdvisor dut gain double pidAdvisor dut q double pidAdvisor dut source int pidAdvisor impulse struct pidAdvisor index int pidAdvisor pid autobw int pidAdvisor pid d double pidAdvisor pid dlimittimeconstant double pidAdvisor pid i double pidAdvisor pid mode double pidAdvisor pid p double pidAdvisor pid rate double pidAdvisor pid targetbw double pidAdvisor pm double pidAdvisor pmfreq double pidAdvisor stable int End the cur
243. or removed nodes include ZiAPI h typedef struct ZITreeChangeData ZITimeStamp timeStamp uint32 t action char name 32 ZITreeChangeData Data Fields ZlTimeStamp timeStamp Time stamp at which the data was updated uint32_t action field indicating which action occured on the tree A value of the ZlTreeAction_enum char name Name of the Path that has been added removed or changed LabOne Programming Manual Revision 31421 Zurich Instruments 236 6 4 File Documentation 6 4 File Documentation 6 4 1 File ZiAPI h Header File for the Zurich Instruments AG C C API v4 doing Communication with Data Server Data Structures struct ZIDoubleDataTS The structure used to hold a single IEEE double value Same as Z DoubleData but with timestamp struct ZllntegerDataTS The structure used to hold a single 64bit signed integer value Same as ZlintegerData but with timestamp struct ZlTreeChangeData The struct is holding info about added or removed nodes struct TreeChange The structure used to hold info about added or removed nodes This is the version without timestamp used in API v1 compatibility mode struct ZIDemodSample The structure used to hold data for a single demodulator sample struct ZlAuxinSample The structure used to hold data for a single auxiliary inputs sample struct ZIDIOSample The structure used to hold data for a single digital I O sample struct ZiByt
244. ouble AuxInO double AuxInl DemodSample Data Fields zilimeStampType TimeStamp doub doub doub doub ex eY e Frequency e Phase unsigned int DIOBits unsigned int Reserved doubl e Auxln0 LabOne Programming Manual Revision 31421 Zurich Instruments 203 6 3 Data Structure Documentation double Auxin1 LabOne Programming Manual Revision 31421 Zurich Instruments 204 6 3 Data Structure Documentation 6 3 4 struct DIOSample The DIOSample struct holds data for the ZI_DATA_DIOSAMPLE data type Deprecated See ZIDIOSample include ziAPI h typedef struct DIOSample ziTimeStampType TimeStamp unsigned int Bits unsigned int Reserved DIOSample Data Fields zilimeStampType TimeStamp unsigned int Bits unsigned int Reserved LabOne Programming Manual Revision 31421 Zurich Instruments 205 6 3 Data Structure Documentation 6 3 5 struct ScopeWave The structure used to hold a single scope shot API Level 1 If the client is connected to the Data Server using API Level 4 recommended if supported by your device class please see Z ScopeWave instead include ziAPI h typedef struct double unsigned int unsigned int unsigned int unsigned int short ScopeWave Data Fields double dt ScopeWave dt ScopeChannel TriggerChannel BWLimit Count Time difference between samples unsigned in
245. pecifies the type of the data held by the ZlEvent uint32_t count Number of values available in this event uint8_t path The path to the node from which the event originates void untyped For convenience The void field doesn t have a corresponding data type Z Double when va Z Double when va Zlinteger Da when va Z lnteger when va Z ByteArray when va Ue ta doubleData Type Zl VAL U E_TYPE_DOUBLE_DATA talS doubleDataTS Type ZI_VAL U E_TYPE_DOUBLE_DATA_TS ta integerData Type ZI_VAL U E_TYPE_INTEGER_DATA talS integerDataTS Type ZI_VAL U E_TYPE_INTEGER_DATA_TS byteArray Type ZI_VAL U E_TYPE_BYTE_ARRAY LabOne Programming Manual Revision 31421 Zurich Instruments 181 6 2 Module Documentation Z ByteArrayTS byteArrayTS when valueType ZILVALUE_TYPE_BYTE_ARRAY_TS Z TreeChangeData treeChangeData when valueType ZILVALUE_TYPE_TREE_CHANGE_DATA TreeChange treeChangeDataOld when valueType ZI VALUE TYPE TREE CHANGE DATA OLD 7 DemodSample demodSample when valueType ZILVALUE_TYPE_DEMOD_SAMPLE 7 lAuxinSample auxInSample when valueType ZILVALUE_TYPE_AUXIN_SAMPLE z DIOSample dioSample when valueType ZI_LVALUE_TYPE_DIO_SAMPLE Z ScopeWave scopeWave when valueType ZILVALUE_TYPE_SCOPE_WAVE ScopeWave
246. poll poll ziDAQServer argl float arg2 long arg3 int arg4 bool arg5 gt object This function returns subscribed data previously in the API s buffers or obtained during the specified time It returns a dict tree containing the recorded data This function blocks until the recording time is elapsed argl Reference to the ziDAQServer class arg2 Recording time in s The function will block during that time arg3 Poll timeout in ms Recommended value is 500ms arg4 optional Poll flags FILL 0x0001 Fill holes ALIGN 0x0002 Align data that contains a timestamp THROW 0x0004 Throw EOFError exception if sample loss is detected arg5 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False poll ziDAQServer argl float arg2 long arg3 int arg4 gt object pollEvent pollEvent ziDAQServer argl long arg2 gt object Execute a single poll command Note only one data packet will be fetched To get all data waiting in the buffers this command should be executed continuously until nothing is returned anymore This is a low level command Use the poll command or asynchronous recording instead argl Reference to the ziDAQServer class arg2 Poll timeout in ms Recommended value is 500ms programRT programRT ziDAQServer argl str arg2 str arg3 gt None Program RT argl Devic
247. r Since the resolution of an FFT depends on the number of point acquired and the spanned time not the sample rate it is possible to obtain very highly resolution spectral analysis Zurich Instruments Synchronization bus LabOne Programming Manual Revision 31421 Zurich Instruments 351 Index A API Compatibility 10 Levels 10 Versions 10 Asynchronous commands 20 C C API see ziAPI C Programming Language see ziAPI Comparison of LabOne APIs 9 D Data Server 6 Device Settings Module 37 37 L LabOne API overview 9 Comparison of APIs 9 LabVIEW 113 121 Comparison to other interfaces 9 Concepts 116 Examples finding 118 Examples running 118 Findingexamples 118 Finding help 117 Getting started 116 Installing the API 114 Linux 114 Windows 114 LabOne VI Palette 116 Palette LabOne 116 Running examples 118 Tips and tricks 121 VI Palette 116 M Matlab 42 69 Built in help 47 Command reference 54 Comparison to other interfaces 9 Contents of the API package 46 Examples running 47 Getting started 46 Help accessing 47 Installing the API 43 List of Examples 46 List of Utility functions 46 Modules 49 Modules configuring 49 Reference 54 Requirements 43 Running examples 47 Tips and tricks 50 Troubleshooting 52 Verifying correct configuration 45 N Node Concept 12 Leaf 12 Node hierarchy 12 P PLL Advisor Module 38 Polling Data Concept 12
248. r optional A list or tuple of column names demodulator sample field names to load from the CSV file Default is to load all columns Returns sample numpy ndarray A numpy structured array of shape num points whose field names correspond to the field names of a ziControl demodulator sample num_points is the number of lines in the CSV file 1 Example import zhinst utils sample zhinst utils load labone _csv Freql csv t x y import matplotlib plt as plt import numpy as np plt plot sample t np abs sample x 1j sample y load zicontrol zibin filename column _names t x y freq dio auxinO auxinl Load a ziBin file containing demodulator samples as saved by the ziControl User Interface into a numpy structured array This is for data saved by ziControl in binary format Arguments filename str The filename of the ziBin file to load column names list or tuple of str optional A list or tuple of column names to load from the CSV file Default is to load all columns Returns sample numpy ndarray A numpy structured array of shape num points whose field names correspond to the field names of a ziControl demodulator sample num_points is the number of sample points saved in the file Further comments Specifying a fewer names in column names will not result in a speed up as all data is loaded from the binary file by default Example import zhins
249. r changing the readout rate of demodulator 2 to 7 2kHz LabOne Programming Manual Revision 31421 Zurich Instruments 1 5 Obtaining Data from the Instrument 1 5 Obtaining Data from the Instrument The subscribe and poll commands The easiest way to obtain data from an instrument is via the poll command available in all of the LabOne API interfaces The poll command is a function for synchronous data recording from specified nodes of an instrument Synchronous means that the interface is blocked during execution of the command see Section 2 1 4 for asynchronous alternatives poll takes two obligatory input arguments recording time and timeout The subscribe and unsubscribe commands are used to select the nodes from which data should be recorded After subscribing to the node the Data Server s internal data buffer will start filling with data from the subscribed nodes The poll command will return the data that was recorded for the specified recording time obligatory input argument and any data that was already in the buffer since the last poll To get rid of the data from earlier measurements it s possible to clear the buffer before polling by using the flush command In order to avoid losing data the Data Server has a finite amount of memory available for its data buffers long recording times gt 20s depending on sampling rates and available memory should be avoided However since internal data buffering on the Data Server ensures
250. r is deprecated If specified i e not empty it enables automatic saving of data in single trigger mode trigger endless 0 trigger savepath string The directory where files are saved when saving data trigger fileformat string The format of the file for saving data 0 Matlab 1 CSV trigger historylength bool Maximum number of entries stored in the measurement history triggerclearhistory bool Remove all records from the history list handle ziDAQ record duration double timeout int64 duration Recording time in s timeout Poll timeout in ms Creates a recorder class The thread is not yet started Before the thread start subscribe and set command have to be called To start the real measurement use the execute function After that the trigger will start the recording of a frame result ziDAQ listNodes handle path flags int64 0 path Path string flags int64 0 gt ZI LIST NONE 0x00 The default flag returning a simple listing if the given node int64 1 gt ZI LIST RECURSIVE 0x01 Returns the nodes recursively int64 2 gt ZI LIST ABSOLUTE 0x02 Returns absolute paths int64 4 gt ZI LIST LEAFSONLY 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree int64 8 gt ZI_LIST_SETTINGSONLY 0x08 Returns only nodes which are marked as setting E Or combinations of flags might be used
251. rBuffer disconnect from the ziServer since ZIAPIDisconnect always returns ZI_INFO_SUCCESS no error handling is required ziAPIDisconnect Conn jz destroy the ZIConnection since ZIAPIDestroy always returns ZI_INFO_SUCC no error handling is required DJ un un ziAPIDestroy Conn return 0 LabOne Programming Manual Revision 31421 Zurich Instruments 124 6 2 Module Documentation 6 2 Module Documentation 6 2 1 Connecting to Data Server This section describes how to initialize the ZIConnection and establish a connection to Data Server as well as how to disconnect after all data handling is done and cleanup the ZIConnection Typedefs Functions typedef ZIConnection The ZIConnection is a connection reference it holds information and helper variables about a connection to the Data Server There is nothing in this reference which the user user may use so it is hidden and instead a dummy pointer is used See ziAPIInit for how to create a ZIConnection ZlResult_enum ziAPlIInit ZIConnection conn Initializes a ZIConnection structure ZlResult_enum ziAPIDestroy ZIConnection conn Destroys a ZIConnection structure ZilResult_enum ziAPIConnect ZIConnection conn const char hostname uint16_t port Connects the ZIConnection to Data Server ZlResult_enum ziAPIDisconnect ZIConnection conn Disconnects an established connection ZlResult_enum ziAPlListImplemen
252. rder argl gt None Stop recording The recording may be restarted by calling execute again finished finished ziDAQRecorder argl gt bool Check if the recording has finished Returns True if finished get get ziDAQRecorder argl str arg2 bool arg3 gt object Return a dict with all nodes from the specified sub tree argl Reference to the ziDAQRecorder class arg2 Path string of the node Use wild card to select all arg3 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False get ziDAQRecorder argl str arg2 gt object listNodes listNodes ziDAQRecorder argl str arg2 int arg3 gt list This function returns a list of node names found at the specified path argl Reference to the ziDAQRecorder class arg2 Path for which the nodes should be listed The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents arg3 Enum that specifies how the selected nodes are listed ziPython ziListEnum none gt 0x00 The default flag returning a simple listing if the given node ziPython ziListEnum recursive gt 0x01 Returns the nodes recursively ziPython ziListEnum absolute gt 0x02 Returns absolute paths ziPython ziListEnum leafsonly gt 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree ziPython ziLi
253. rder to learn about or verify the nodes available it can be very helpful to view the command log in the User Interface see the bar in the bottom of the screen to see which node has been configured during a previous setting change The text interface HF2 Series provides a convenient way to explore the node hierarchy Always close ziHandles and ziModHandles or LabVIEW runs out of memory If you use the Abort Execution button of LabVIEW your LabVIEW program will not close any existing connections to the ziServer Any open connection inside of LabVIEW will persist and continue to consume about 12 MB of RAM so that with time you will run out of memory Completely exit LabVIEW in order to release the memory again Use shift registers The structure of efficient LabVIEW code is distinguished by signals being piped through by use of shift registers in loops and by the absence of object replication Using shift registers in LabVIEW avoids copying of data and more important running the garbage collector frequently File Edit View Project Operate Tools Window Help simpleLoop vi Block Diagram on My Computer D File Edit View Project Operate Tools Window Help x gt simpleLoop Wrong vi Block Diagram on My Comput _ o Piel eine ax toet Avpication Font gt gor i 69 2 E i BEWARE This is an error ever copy Fi This copies the handle for each iteration of the loop Always close a ziHandle to
254. rent PLL Advisor thread Disable automatic calculation of the start and stop value Automatic response calculation triggered by parameter change Output parameter Contains the resulting bode plot of the PID simulation Output parameter Calculated system bandwidth In Out parameter Command to calculate values Set to 1 to start the calculation Start frequency for Bode plot For disabled advanced mode the start value is automatically derived from the system properties Stop frequency for Bode plot Start time for step response Stop time for step response Bandwith of the DUT device under test Damping of the second order low pass filter IO Delay of the feedback system describing the earliest response for a step change Resonant frequency of the of the modelled resonator Gain of the DUT transfer function quality factor of the modelled resonator Type of model used for the external device to be controlled by the PID source 1 Lowpass first order source 2 Lowpass second order source 3 Resonator frequency source 4 Internal PLL source 5 VCO source 6 Resonator amplitude Output parameter Impulse response not yet supported PID index for parameter detection Adjusts the demodulator bandwidth to fit best to the specified target bandwidth of the full systen In Out parameter Differential gain In Out parameter Differential filter timeconstant In Out parameter Integral gain Selec
255. rigger frame pretrigger delay gt 0 gt trigger edge before trigger frame posttrigger oo do oo do a do trigger 0 duration double Recording frame length s 5 trigger 0 level double Trigger level voltage V trigger 0 hysteresis double Trigger hysteresis V trigger 0 retrigger int Record more than one trigger in a trigger triggered bool Has the software trigger triggered 1 Yes O No 5 read only trigger 0 bandwidth double Filter bandwidth Hz for pulse and tracking triggers trigger 0 holdoff count int Number of skipped triggers until the next trigger is recorded again trigger 0 holdoff time double Hold off time s before the next trigger is recorded again A hold off time smaller than the duration will ao produce overlapped trigger frames trigger N hwtrigsource int Only available for devices that support hardware triggering Specify the channel to trigger on trigger 0 pulse min double Minimal pulse width s for the pulse oo de o oe LabOne Programming Manual Revision 31421 Zurich Instruments 57 3 5 LabOne Matlab API ziDAQ Command Reference de de dE AP AP AP AP P AP AP AP OP P AP DO AP AP OO de de de AP AP AP AP AP AP AP AP OP OP AP AP AP AP OP P AP AP P P de de de AP AP AP AP AP P P AP AP OP OP AP AO dE AP AP AP AP oP oP AP AO trigger trigger 0 pulse max double Maximal pulse width s for the pulse trigger trigger filename string This paramete
256. rogramming Manual Revision 31421 Zurich Instruments 262 6 4 File Documentation Data Fields ZIDIOSample dioSample ZIScopeWave scopeWave ScopeWave scopeWaveOld ZIPWAWave pwaWave union ZIEvent 1 uint8 t zIEvent value data 0x400000 Z ValueType_enum valueType Specifiesth e type of the data held by the ZlEvent uint32_t count Number of values available in this event uint8_t path The path to the node from which the event originates void untyped For convenie data type Z DoubleDa when va Z Double when va Z lnteger when va Z lnteger when va Z ByteArray when value Z ByteArrayTS byteArrayTS Type Zl VAL when value Type Zl VAL Type Zl VAL Type Zl VAL Type Zl VAL Type Zl VAL nce The void field doesn t have a corresponding ta doubleData E_TYPE_DOUBLE_DATA U talS doubleDataTS E_TYPE_DOUBLE_DATA_TS U ta integerData E_TYPE_INTEGER_DATA U talS E_ TYPE INTEGER DATA TS talS integerDa U byteArray E_TYPE_BYTE_ARRAY U E_TYPE_BYTE_ARRAY_TS U LabOne Programming Manual Revision 31421 Zurich Instruments 263 6 4 File Documentation Z TreeChangeData treeChangeData when valueType ZILVALUE_TYPE_TREE_CHANGE_DATA TreeChange treeChangeDataOld when valueType ZI VALUE TYPE TREE CHANGE DATA OLD Z DemodSample
257. rver and can be read by the ziPollDataEx vi which waits for an event without using CPU time Once le data is received which means that no timeout occured it is displayed on the front panel A case structure first checks whether a timeout occured d then evaluates the data source and thus data type channel property of the demodulator sample structure The data can now be stored in an array or a jeue or be shown in a waveform chart 3 Finally the connection is closed Zurich Instruments AG www zhinst com Poll Loop a en Timeout False 7 N o ziSubscribe vi Initialize a connection Subscribe required nodes Data source e DEMODS vP gt SAMPLE v zivalueType gt IN Demod Sample 7 Timestamps ticks X Vrms Y Vrms Osc Phase rad Freq Hz DIO Aux In 0 W Aux In 1 V Trigger Figure 5 5 LabOne LabVIEW Example Poll Data Block Diagram Zurich Instruments ziClose vi axe Close connection 120 LabOne Programming Manual Revision 31421 9 3 LabVIEW Programming Tips and Tricks 5 3 LabVIEW Programming Tips and Tricks Use the User Interface s command log or Server s text interface while programming with LabVIEW As with all other interfaces LabVIEW uses the path and nodes concept to address settings on an instrument see Section 1 1 In o
258. s arg2 Timeout in ms Recommended value is 500ms Reference help for the ziPidAdvisor class gt gt gt help zhinst ziPython ziPidAdvisor Help on class ziPidAdvisor in zhinst ziPython zhinst ziPython ziPidAdvisor class ziPidAdvisor Boost Python instance Method resolution order ziPidAdvisor Boost Python instance __builtin__ object Methods defined here _ reduce _ lt unnamed Boost Python function gt clear clear ziPidAdvisor argl gt None End the pidAdvisor thread execute execute ziPidAdvisor argl gt None Starts the pidAdvisor if not yet running finish finish ziPidAdvisor argl gt None Stop the pidAdvisor finished finished ziPidAdvisor argl gt bool Check if the command execution has finished Returns True if finished get get ziPidAdvisor argl str arg2 bool arg3 gt object Return a dict with all nodes from the specified sub tree argl Reference to the ziPidAdvisor class arg2 Path string of the node Use wild card to select all arg3 optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False get ziPidAdvisor argl str arg2 gt object LabOne Programming Manual Revision 31421 Zurich Instruments 109 4 4 LabOne Python API ziPython Command Reference listNodes listNodes ziPidAdvisor argl str arg2 int arg3 gt lis
259. s inherited from Boost Python instance new lt built in method new of Boost Python class object gt T new S gt a new object with type S a subtype of T 4 4 5 Help for ziPython s ziDAQSweeper class An instance of ziDAQSweeper is initialized using the sweep method from ziDAQServer gt gt gt help zhinst ziPython ziDAQServer sweep Help on method sweep in zhinst ziPython ziDAQServer zhinst ziPython ziDAQServer sweep sweep unbound zhinst ziPython ziDAQServer method sweep ziDAQServer argl long arg2 gt ziDAQSweeper Create a sweeper class This will start a thread for asynchronous sweeping argl Reference to the ziDAQServer class arg2 Timeout in ms Recommended value is 500ms Reference help for the ziDAQSweeper class gt gt gt help zhinst ziPython ziDAQSweeper Help on class ziDAQSweeper in zhinst ziPython zhinst ziPython ziDAQSweeper class ziDAQSweeper Boost Python instance Method resolution order ziDAQSweeper Boost Python instance __builtin__ object Methods defined here _ reduce _ lt unnamed Boost Python function gt clear mis clear ziDAQSweeper argl gt None End the sweeper thread execute execute ziDAQSweeper argl gt None Start the sweeper Subscription or unsubscription is no more possible until the sweep is finished LabOne Programming Manual Revision 31421 Zurich Instruments 95 4 4 LabOne Python API ziPython Command Ref
260. s only nodes which means the they are at the termost level of handle Handle of the PID Advisor session Subscribe to one or several nodes handle Handle of the PID Advisor session Unsubscribe from one or several nodes found a stable solution with the given settings When 0 revise your settings and rerun the PID Advisor 5 pidAdvisor step struct Output parameter Contains the resulting 5 step response plot of the PID simulation 5 pidAdvisor targetbw double Requested PID bandwidth Higher 5 frequencies may need manual tuning 5 pidAdvisor targetfail int Output parameter 1 indicates the simulated PID BW is smaller than the Target BW pidAdvisor tf closedloop int Switch the response calculation mode 5 between closed or open loop 5 pidAdvisor tf input int Start point for the plant response simulation for open or closed loops pidAdvisor tf output int End point for the plant response simulation for open or closed loops pidAdvisor tune int Optimize the PID parameters so that the noise of the closed loop system gets minimized handle ziDAQ pidAdvisor timeout int64 ms thread start set the command parameters then set the calculate parameter to start path flags int64 Advisor session 01 gt ZI LIST NONE 0x00 returning a simple gt ZI LIST RECURSIVE 0x01 turns the nodes recursively gt ZI LIST ABSOLUTE 0x02 paths gt ZI LIST LEAFSONLY 0x04 that are leafs
261. savepath string The directory where files are located when saving sweeper measurements sweep fileformat string The format of the file for saving sweeper measurements 0 Matlab 1 CSV sweep historylength bool Maximum number of entries stored in the measurement history sweep clearhistory bool Remove all records from the history list Note Settling time max settling tc tc settling time Averaging time max averaging tc tc averaging sample sample rate AP do AP AP oP AP dE handle ziDAQ sweep timeout int64 LabOne Programming Manual Revision 31421 Zurich Instruments 60 3 5 LabOne Matlab API ziDAQ Command Reference de de dE AP AP AP AP P AP AP AP P OP AO DO AP AP OO AP de de W AP AP AP AP AP AP AP OP OP AP AP AP AP OP P AP AP P P de result AP de dE AP X AP AP result result AP oP dE AP X AAP AP AP JP AP AP oP oP AP oO result timeout Poll timeout in ms Creates a sweep class The thread is not yet started Before the thread start subscribe and set command have to be called To start the real measurement use the execute function ziDAQ listNodes handle path flags int64 0 path Path string flags int64 0 gt ZI LIST NONE 0x00 The default flag returning a simple listing if the given node int64 1 gt ZI_LIST RECURSIVE 0x01 Returns the nodes recursively int64 2 gt ZI LIST ABSOLUTE 0x02 Returns absolute paths int64 4 gt
262. settings and measurement data of the instrument are accessed All the settings and data of the instrument are organized in a file system like hierarchical structure The features of the instrument such as demodulators are accessed as branches in this tree and their individual settings are leaves of these branches It is also possible to browse branches inside the tree as if the user were navigating in a file system This hierarchy is used no matter which interface you use when performing measurements An example demonstrating the hierarchy is the representation of the first demodulator on the device given by the node devX demods 0 which as we ve already noted is very similar to a path on a computer s file system Note that the top level ofthe path isthe device that you are connected to The demodulators are then given as a top level node under your device node and the node of the first demodulator is indexed by 0 This path represents a branch in the node hierarchy which in this case if we explore further has the following nodes devX demods 0 adcselect devX demods 0 order devX demods 0 timeconstant devX demods 0 rate devX demods 0 trigger devX demods 0 oscselect devX demods 0 harmonic devX demods 0 phaseshift devX demods 0 sinc devX demods 0 sample These nodes are leaves the most bottom level nodes which represent a setting of an instrument or a field that can be read to retrieve measurement data For example dev
263. sion 31421 Zurich Instruments 273 6 4 File Documentation See Also ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx include lt stdio h gt include ziAPI h void ProcessEvent zIEvent Event unsigned int j switch Event gt valueType case ZI VALUE TYPE DOUBLE DATA printf Su elements of double data s n Event gt count Event gt path for j 0 j lt Event gt count 7 jtt printf Sf n Event gt value doubleData 3 break case ZI VALUE TYPE INTEGER DATA printf Su elements of integer data s n Event gt count Event gt path 7 for j 0 j lt Event gt count 7 jtt printf Sf n float Event gt value integerData j 9 break LabOne Programming Manual Revision 31421 Zurich Instruments 274 6 4 File Documentation case ZI VALUE TYPE DEMOD SAMPLE printf Su elements of sample data s n Event gt count Event gt path 7 for j 0 j lt Event gt count 7 jtt printf TS f X f Y f n float Event gt value demodSample j timeStamp Event gt value demodSample j x Event gt value demodSample j y break case ZI VALUE TYPE TREE CHANGE DATA printf Su elements of tree changed data s n Event gt count r Event gt path for j 0 j lt Event gt count 7 J It switch Event gt value treeChangeDataold 3 Ac
264. ss arg2 File name string without extension Sebi set ziPidAdvisor argl str arg2 float arg3 gt None PID Advisor Parameters Path name Type Description pidAdvisor advancedmode int Disable automatic calculation of the start and stop value pidAdvisor auto int Automatic response calculation triggered by parameter change pidAdvisor bode struct Output parameter Contains the resulting bode plot of the PID simulation pidAdvisor bw double Output parameter Calculated system bandwidth pidAdvisor calculate int In Out parameter Command to calculate values Set to 1 to start the calculation pidAdvisor display freqstart double Start frequency for Bode plot For disabled advanced mode the start value is automatically derived from the system properties pidAdvisor display freqstop double Stop frequency for Bode plot pidAdvisor display timestart double Start time for step response LabOne Programming Manual Revision 31421 Zurich Instruments 110 4 4 LabOne Python API ziPython Command Reference pidAdvisor du pidAdvisor du pidAdvisor du pidAdvisor du pidAdvisor du pidAdvisor du pidAdvisor du pidAdvisor display timestop t bw t damping t delay t fcenter t gain t q t source pidAdvisor impulse pidAdvisor index pidAdvisor pid autobw pidAdvisor pid d pidAdvisor pid i pidAdvisor pid mode pidAdvisor pid p pidAdvisor pid rate pidAdvisor pid targetbw pidAd
265. ss the LabOne User Interface on the instrument remotely from a web browser please see the Getting Started chapter of the MFLI User Manual for help on determining the hostname LabOne Programming Manual Revision 31421 Zurich Instruments 7 1 1 LabOne Software Architecture LabVIEW Client 127 0 0 1 8004 Data Server UHF UHF Instrument s d ziDataServer exe Python Client 127 0 0 1 8004 Web Server UHF 127 0 0 1 8006 LabVIEW Client 127 0 0 1 8005 Data Server HF2 HF2 Instruments id ziServer exe MATLAB Client l 127 0 0 1 8005 A Figure 1 2 Server port handling Use 8004 for UHF Instruments and 8005 for HF2 Instruments lt gt LabOne Programming Manual Revision 31421 Zurich Instruments 1 2 Comparison of the LabOne Interfaces 1 2 Comparison of the LabOne Interfaces The various software interfaces available in LabOne allow the user to pick a programming environment they are familiar with to achieve fast results All other things being equal here is a brief discussion of the merits of each interface The LabVIEW interface allows for quick and efficient implementation of virtual instruments that run independently These can easily be integrated in existing experiment control performed in LabVIEW For most applications that need functions not included by ziControl this is a sensible interface to use This interface requires a National Instruments LabVIEW license and LabVIEW 2009
266. stEnum settingsonly gt 0x08 Returns only nodes which are marked as setting Or combinations of flags can be used progress progress ziDAQRecorder argl gt object Reports the progress of the measurement with a number between 0 and 1 r ad ete read ziDAQRecorder argl bool arg2 gt object Read recorded data If the recording is still ongoing only a subset of recorded data is returned If many triggers or huge data sets are recorded call this method to keep memory usage reasonable argl optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False read ziDAQRecorder argl gt object save save ziDAQRecorder argl str arg2 gt None LabOne Programming Manual Revision 31421 Zurich Instruments 103 4 4 LabOne Python API ziPython Command Reference trigger device trigger endless trigger forcetrigger trigger 0 path trigger 0 source trigger 0 count trigger 0 type trigger 0 edge trigger 0 findlevel trigger 0 bits trigger 0 bitmask trigger 0 delay trigger 0 duration trigger 0 level trigger 0 hysteresis trigger 0 retrigger trigger triggered trigger 0 bandwidth Save trigger data to file string bool bool string int int int int bool int int double double double double int bool double trigger 0 holdoff count int
267. sweep savepath string The directory where files are located when saving sweeper measurements sweep fileformat string The format of the file for saving sweeper measurements 0 Matlab 1 CSV sweep historylength bool Maximum number of entries stored in the measurement history sweep clearhistory bool Remove all records from the history list set ziDAQSweeper argl str arg2 int arg3 gt None set ziDAQSweeper argl str arg2 str arg3 gt None set ziDAQSweeper argl object arg2 gt None argl Reference to the ziDAQSweeper class arg2 A list of path value pairs subscribe subscribe ziDAQSweeper argl str arg2 gt None Subscribe to one or several nodes After subscription the sweep process can be started with the execute command During the sweep process paths can not be subscribed or unsubscribed argl Reference to the ziDAQSweeper class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified trigger trigger ziDAQSweeper argl gt None Execute a manual trigger unsubscribe unsubscribe ziDAQSweeper argl str arg2 gt None Unsubscribe from one or several nodes During the sweep process paths can not be subscribed or unsubscribed argl Reference to the ziDAQSweeper class arg2 Path string of the node Use wild card to select all Alternatively also a list of path strings can be specified Data and other attr
268. t This function returns a list of node names found at the specified path argl Reference to the ziPidAdvisor class arg2 Path for which the nodes should be listed The path may contain wildcards so that the returned nodes do not necessarily have to have the same parents arg3 Enum that specifies how the selected nodes are listed ziPython ziListEnum none gt 0x00 The default flag returning a simple listing of the given node ziPython ziListEnum recursive gt 0x01 Returns the nodes recursively ziPython ziListEnum absolute gt 0x02 Returns absolute paths ziPython ziListEnum leafsonly gt 0x04 Returns only leaf nodes which means the they are at the outermost level of the tree ziPython ziListEnum settingsonly gt 0x08 Returns only nodes which are marked as settings Or combinations of flags can be used progress progress ziPidAdvisor argl gt object Reports the progress of the command with a number between 0 and 1 read read ziPidAdvisor argl bool arg2 gt object Read pidAdvisor data If the simulation is still ongoing only a subset of the data is returned argl optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False read ziPidAdvisor argl gt object save save ziPidAdvisor argl str arg2 gt None Save PID advisor data to file argl Reference to the ziPidAdvisor cla
269. t 2 In Out gain In Out parameter PID Advisor sampling rate of the PID control loop PID system target bandwidth Output parameter Simulated phase margin of the PID with the current settings The phase margin should be greater than 45 deg and preferably greater than 65 deg for stable conditions Output parameter margin frequency Output parameter When 1 the PID Advisor found a stable solution with the given settings When 0 revise your settings and rerun the PID Advisor Output parameter Contains the resulting step response plot of the PID simulation Requested PID bandwidth Higher frequencies may need manual tuning Output parameter 1 indicates the simulated PID BW is smaller than the Target BW Switch the response mode between closed Start point for the simulation for open Simulated phase calculation or open loop plant response or closed LabOne Programming Manual Revision 31421 Zurich Instruments 111 4 4 LabOne Python API ziPython Command Reference loops pidAdvisor tf output int End point for the plant response simulation for open or closed loops pidAdvisor tune int Optimize the PID parameters so that the noise of the closed loop system gets minimized set ziPidAdvisor argl str arg2 int arg3 gt None set ziPidAdvisor argl str arg2 str arg3 gt None set ziPidAdvisor argl object arg2 gt None argl Reference to the ziPidAdvisor class arg2
270. t PID Advisor mode Mode value is bit coded bit 0 P bit 1 I bit 2 D bit 3 D filter limit In Out parameter Proportional gain In Out parameter PID Advisor sampling rate of the PID control loop PID system target bandwidth Output parameter Simulated phase margin of the PID with the current settings The phase margin should be greater than 45 deg and preferably greater than 65 deg for stable conditions Output parameter Simulated phase margin frequency Output parameter When 1 the PID Advisor LabOne Programming Manual Revision 31421 Zurich Instruments 66 3 5 LabOne Matlab API ziDAQ Command Reference timeout device Before the call execute and the simulation ZiDAQ listNodes handle path flags result t64 0 in t64 Re t64 Re t64 Re 1 in in 2 4 in ou t64 8 Re de de dE W AP AP AP AP P AP AP OP OP AP AP AP AP P P AP AP P P OO in ziDAQ subscribe handle AP de dE AP AP AP AP ZiDAQ unsubscribe handle ziDAQ get handle handle path AP de dE AP AO AAP AP ziDAQ execute handle ziDAQ trigger ZiDAQ finished handle result AP do dE AP oP oP AP oO Poll timeout in Creates a PID Advisor class for simulating the PID in the handle Handle of the PID Path string The default flag listing if the given node turns absolute turn
271. t utils sample zhinst utils load_zicontrol_zibin Freql ziBin import matplotlib plt as plt import numpy as np plt plot sample t np abs sample x 1j sample y save settings daq device filename Save settings from the specified device to a LabOne settings file This LabOne Programming Manual Revision 31421 Zurich Instruments 85 4 4 LabOne Python API ziPython Command Reference function is synchronous it will block until saving the settings has finished Arguments daq instance of ziDAQServer A ziPython API session device str The device ID specifying where to load the settings e g dev123 filename str The filename of the LabOne xml settings file The filename can include a relative or full path Raises RunTimeError If saving the settings times out Examples import zhinst utils as utils daq utils autoConnect dev utils autoDetect daq Then e g save settings to a file in the current directory utils save settings dag dev my_settings xml Then e g save settings to the default LabOne settings path filename my settings _example xml path utils get default settings path daq utils save settings daq dev path os sep filename DATA LABONE DEMOD DTYPE LABONE DEMOD FORMATS LABONE DEMOD NAMES chunk timestamp x y freq phase ZICONTROL DTYPE sE PES Wijn ale EB ig Eby FEST CAERS pa EN en ZICONTROL FORMATS f8 f8
272. ta Structures struct ZlEvent This struct holds event data forwarded by the Data Server struct ziEvent This struct holds event data forwarded by the Data Server Deprecated See ZlEvent Functions Z Event ziAPIAllocateEventEx Allocates ZlEvent structure and returns the pointer to it Attention It is the client code responsibility to deallocate the structure by calling ziAPIDeallocateEventEx void ziAP DeallocateEventEx ZlEvent ev Deallocates ZIEvent structure created with ziAPlAllocateEventEx 7 Result_enum ziAPISubscribe ZIConnection conn const char path subscribes the nodes given by path for ziAPIPollDataEx 7 Result_enum ziAPlUnSubscribe ZIConnection conn const char path unsubscribes to the nodes given by path 7l Result_enum ziAPIPollDataEx ZIConnection conn ZlEvent ev uint32_t timeOutMilliseconds checks if an event is available to read 7 Result_enum ziAPIGetValueAsPollData ZIConnection conn const char path triggers a value request which will be given back on the poll event queue 7l Result_enum ziAPIPollData ZIConnection conn ziEvent ev int timeOut Checks if an event is available to read Deprecated See ziAPIPollDataEx Detailed Description include lt stdio h gt LabOne Programming Manual Revision 31421 Zurich Instruments 176 6 2 Module Documentation include lt stdlib h gt include ZiAPI h void EventLoop ZIConnection C
273. tations char implementations uint32_t bufferSize Returns the list of supported implementations ZlResult enum ziAPIConnectEx ZIConnection conn const char hostname uint16_t port ZIAPIVersion_enum apiLevel const char implementation Connects to Data Server and enables extended ziAPI ZIResult_enum ziAPIGetConnectionAPlLevel ZIConnection conn ZIAPIVersion_enum apiLevel Returns ziAPI level used for the connection conn ZIResult_enum ziAPIGetRevision unsigned int revision Retrieves the revision of ziAPI Detailed Description LabOne Programming Manual Revision 31421 Zurich Instruments 125 6 2 Module Documentation include lt stdio h gt include ZiAPI h int main ZIResult_enum RetVal char ErrBuffer ZIConnection Conn if RetVal ZiAPIInit amp Conn ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t init Connection s n ErrBuffer return 1 connect to the ziServer set as default using the default port if RetVal ziAPIConnect Conn NULL 0 ZI_INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t connect to ziServer s n ErrBuffer else do something using the ZIConnection here since ZIAPIDisconnect always returns ZI INFO SUCCESS no error handling is required ziAPIDisconnect Conn Jz since ZIAPIDestroy always returns ZI INFO SU
274. ter to read the data of the event ZI_VALUE_TYPE_TREE_CHANGE_DATA_OLD TreeChange type alist of added or removed nodes used in v1 compatibility mode Use the ZlEvent value treeChangeDataOld pointer to read the data of the event LabOne Programming Manual Revision 31421 Zurich Instruments 285 6 4 File Documentation ZI VALUE TYPE SCOPE WAVE Z ScopeWave type Use the ZlEvent value scopeWave pointer to read the data of the event Z VALUE TYPE SCOPE _WAVE_ OLD ScopeWave type used in v1 compatibility mode use the ZlEvent value scopeWaveOld pointer to read the data of the event ZI_VALUE_TYPE_PWA_WAVE ZIPWAWave type Use the ZIEvent value pwaWave pointer to read the data of the event Z _DATA_NONE no data type the ziEvent is invalid Z DATA DOUBLE double data type use the ziEvent Val Double Pointer to read the data of the event ZI DATA INTEGER integer data type use the ziEvent Val Integer Pointer to read the data of the event ZI DATA DEMODSAMPLE DemodSample data type use the ziEvent Val Sample Pointer to read the data of the event ZI DATA SCOPEWAVE ScopeWave data type use the ziEvent Val Wave Pointer to read the data of the event Z DATA_AUXINSAMPLE MiscADValue data type use the ziEvent Val ADValue Pointer to read the data of the event Z _DATA_DIOSAMPLE DIOValue data type use the ziEvent Val DIOValue Pointer to read the data of t
275. the PLL oscillator The PLL 5 frequency shift is relative to this center frequency pllAdvisor d int Differential gain pllAdvisor demodbw int Demodulator bandwidth used for the PLL loop filter pllAdvisor i double Integral gain pllAdvisor mode double Select PLL Advisor mode Currently only one mode open loop is supported pllAdvisor order double Demodulator order used for the PLL loop filter pllAdvisor p int Proportional gain pllAdvisor pllbw int Demodulator bandwidth used for the PLL loop 5 filter 5 pllAdvisor pm int Output parameter Simulated phase margin of the LabOne Programming Manual Revision 31421 Zurich Instruments 64 3 5 LabOne Matlab API ziDAQ Command Reference pllAdvisor targetfail int handle ziDAQ pllAdvisor timeout de de dE AP AP AP AP P AP AP AP OP OP P AO AP AP OO device Before the call execute and the simulation ZiDAQ listNodes path flags result int64 0 t64 Re t64 Re t64 Re in 1 2 in in 4 ou t64 8 Re in ZiDAQ subscribe de de dE AP AP AP AP AP AP AP AP OP OP AP AP AP AP P P AP AP P OP de ZiDAQ unsubscribe ZiDAQ execute AP de dE AP AP AP AP ZiDAQ finished handle result ZiDAQ read handle handle result subset of the data AP oP dE AP X AP AP result ziDAQ progress between 0 and 1 ZiDAQ finish ziDAQ clear handle
276. the meantime Another feature of ziCore s Modules is that each instantiation of a Module creates anew Thread and as such the commands executed by a Module are performed asynchronously Asynchronous means that the task is performed in the background and the interface s process is available to perform other tasks in the meantime i e Module commands are non blocking for the user LabOne Programming Manual Revision 31421 Zurich Instruments 20 2 2 Sweeper Module 2 2 Sweeper Module The Sweeper Module allows the user to perform sweeps as in the Sweeper Tab of the LabOne User Interface In general the Sweeper can be used to obtain data when measuring a DUT s response to varying or sweeping one instrument setting while other instrument settings are kept constant 2 2 1 Configuring the Sweeper In the following we briefly describe how to configure the Sweeper Module See Table 2 1 fora full list of the Sweeper s input parameters and Table 2 2 for a description of the Sweeper s outputs Specifying the Instrument Setting to Sweep The Sweeper s sweep gridnode parameter the so called sweep parameter specifies the instrument s setting to be swept specified as a path to an instrument s node This is typically an oscillator frequency in a Frequency Response Analyzer e g dev123 oscs 0 freg but a wide range of instrument settings can be chosen such as a signal output amplitude or a PID controller s setpoint Specifying the Range of V
277. the value should be retrieved lin path Path to the Node holding the value Returns Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN or the length of the char buffer for the nodes given by MaxLen is too small for all elements Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server ZI SERVER INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no value is attached to the node 7 _TIMEOUT when communication timed out See Data Handling for an example See Also ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx LabOne Programming Manual Revision 31421 Zurich Instruments 197 6 2 Module Documentation ziAPIPollData ZIResult_enum ziAPIPollData ZIConnection conn ziEvent ev int timeOut Checks if an event is available to read Deprecated See ziAPIPollDataEx Parameters lin conn Pointer to the ZIConnection for which events should be received out ev Pointer to a ziEvent struct in which the received event will be written in timeOut Time to wait for an event in milliseconds If 1 it will wait forever if O the function returns immediately Returns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error
278. ther one of the next two steps as also indicated by the output of ziAddPath a Runthepathtool and click Add with Subfolders Browse to the MATLAB201 2 directory that was located above in Step 1 and click OK b Edityourstartup mtocontaintheline indicated in the output from Step 2 above For more help on Matlab s startup mfile type the following in in Matlab s Command Window gt gt docsearch startup m On Linux perform the additional step described in Section 3 1 3 Verify your Matlab configuration as described in Section 3 1 4 dditional Configuration Required on Linux use ziDAQ in Matlab on Linux it s necessary to additionally perform the following steps Tell Matlab the location of the ziDAQ MEX file by appending its location to the LD LIBRARY PATH environment variable The MEX file is located in the Driver subdirectory found in PATH LabOne64 API MATLAB2012 the path used above in Section 3 1 2 This can be performed in aterminal before starting Matlab or set in your shell s configuration file For the Bash shell for example in the bashrc export LD LIBRARY PATH LD LIBRARY PATH PATH LabOne64 API MATLAB2012 Driver Tell Matlab the location of the shared C library libstdc so it should use via the LD_PRELOAD environment variable This is necessary because ziDAQ is compiled against a newer version of libstdc than is typically included and used by default in a standard Matlab installation
279. tion case ZI_TREE ACTION REMOVE LabOne Programming Manual Revision 31421 Zurich Instruments 275 6 4 File Documentation printf Tree removed s n Event gt value treeChangeDataold j1 Name break case ZI_TREE_ACTION_ADD printf treeChangeDataOld added s n Event gt value treeChangeDataold le Name 7 break case ies ZI TREE ACTION CHANG printf treeChangeDataOld changed s n Event gt value treeChangeDataold 3 Name break break default printf Unexpected event value type Sd n Event gt valueType break LabOne Programming Manual Revision 31421 Zurich Instruments 276 6 4 File Documentation Data Structure Documentation union ziEvent Val typedef union ziEvent Val void Void DemodSample SampleDemod AuxInSample SampleAuxIn DIOSample SampleDIO ziDoubleType Double ziiIntegerType Integer TreeChange m ree ByteArrayData ByteArray ScopeWave Wave ziEvent Val Data Fields void Void DemodSample SampleDemod AuxInSample SampleAuxin DlOSample SampleDIO ziDoubleType Double zilntegerType Integer LabOne Programming Manual Revision 31421 Zurich Instruments 277 6 4 File Documentation TreeChange Tree ByteArrayData ByteArray ScopeWave Wave LabOne Programming Manual Revision 31421 Zurich Instruments 278 6 4 File Document
280. tion conn const char path ZIDoubleData value LabOne Programming Manual Revision 31421 Zurich Instruments 328 6 4 File Documentation ziAPlAsyncSetintegerData ZIResult_enum ziAPlAsyncSetIntegerData ZIConnection conn const char path ZiintegerData value LabOne Programming Manual Revision 31421 Zurich Instruments 329 6 4 File Documentation ziAPlAsyncSetByteArray ZIResult_enum ziAPlAsyncSetByteArray ZIConnection conn const char path uint8_t buffer uint32_t length LabOne Programming Manual Revision 31421 Zurich Instruments 330 6 4 File Documentation ZiAPIAllocateEventEx ZlEvent ziAPlAllocateEventEx Allocates ZlEvent structure and returns the pointer to it Attention It is the client code responsibility to deallocate the structure by calling ziAPIDeallocateEventEx This function allocates a ZlEvent structure and returns the pointer to it Free the memory using ziAPIDeallocateEventEx See Also ziAPIDeallocateEventEx LabOne Programming Manual Revision 31421 Zurich Instruments 331 6 4 File Documentation ziAPIDeallocateEventEx void ziAPIDeallocateEventEx ZlEvent ev Deallocates ZlEvent structure created with ziAPlAllocateEventEx Parameters in ev Pointer to ZlEvent structure to be deallocated See Also ziAPlAllocateEventEx This function is the compliment to ziAPlAllocateEventEx LabOne Programming Manual Revision 31421 Zurich Instruments 332
281. to save the settings for e g dev123 compulsory parameter devicesettings command byte array The command to issue load load settings from file save read device settings and save to file or read just read the device settings compulsory parameter devicesettings filename byte array The name of the file to load or save to devicesettings path byte array The path containing the file to load from or save to Table 2 8 Device Settings Parameters for use only by the LabOne Web Server Setting Path Type Description devicesettings throwonerror uint64 Throw an exception is there was error executing the command devicesettings errortext byte array The error text used In error messages devicesettings finished uint64 The status of the command read only LabOne Programming Manual Revision 31421 Zurich Instruments 37 2 6 PLL Advisor Module 2 6 PLL Advisor Module The PLL Advisor Module corresponds to the PLL Advisor section of the LabOne User Interface PLL tab The PLL Advisor is a mathematical model of the PLL incorporated in the instrument and provides a convenient way to tune parameters to obtain an optimal feedback loop performance for the desired application Note Note the PLL Advisor Module is only available for UHF Lock in Amplifiers Table 2 9 PLL Advisor Parameters Setting Path Type
282. to the instr 1ib directory in your LabVIEW installation as located in Step 1 Note you will need administrator rights to copy to this directory 4 Restart LabVIEW and verify your installation as described in Section 5 1 4 5 1 4 Verifying your Installation If the LabOne LabVIEW API palette can be accessed from within LabVIEW the LabOne LabVIEW API is correctly installed See Section 5 2 1 for help finding the palette LabOne Programming Manual Revision 31421 Zurich Instruments 115 5 2 Getting Started 5 2 Getting Started 5 2 1 Locating the LabOne LabVIEW VI Palette In order to locate the LabOne LabVIEW Vis start LabVIEW and create a new VI In the VI s Block Diagram Ctrl e you can to access the LabOne LabVIEW API palette with a mouse right click and browsing the tree under Instrument I O Instr Drivers see Figure 5 1 42 Untitled 1 Block Diagram on Zurich Instruments LabOne Ivproj My Computer e File Edit View Project Operate Tools Window Help DE I A a n 9 82 bale ox 15pt Application Font io i SeA as 21 Zurich Instruments LabOne Modules Rz ziOpen vi VI Treevi a Eal 22 Modules Config Utility Modules i roe ga 0 zal a Mf TR ziModStartvi ziModSetVal ziModSubser ziModExecut ziModRead vi Pio Neo hal Noe
283. tor grid double Hz The frequency grid nenbw double The normalized equivalent noise bandwidth resolution double Hz FFT resolution Spectral resolution defined by the reciprocal acquisition time sample rate number of samples recorded aliasingreject double dB How much damping is present at the border of your spectrum LabOne Programming Manual Revision 31421 Zurich Instruments 31 2 4 Software Trigger Recorder Module 2 4 Software Trigger Recorder Module The Recorder Module corresponds to the Software Trigger Tab of the LabOne User Interface It allows the user to record bursts of instrument data based upon pre defined trigger criteria similar to that of a laboratory oscilloscope see Figure 2 7 for an example The types of trigger available are listed in Table 2 5 Table 2 5 Overview of the trigger types available in the Software Trigger Module Trigger Type Description trigger N type Manual For simple recording 0 Edge Edge trigger with level hysteresis and noise rejection 1 see Figure 2 8 Digital Digital trigger with bit masking 2 Pulse Pulse width trigger with level hysteresis and noise 3 reduction see Figure 2 9 and Figure 2 10 Tracking Level tracking trigger to compensate signal drift see 4 edge or Figure 2 11 pulse Hardware UHFLI and MFLI only Trigger on one of the instrument s 6 Trigger hardware trigger channels Recorded 10 data segments of duration 0 180 se
284. tor data used for the FFT Use 0 for no overlap and 0 99 for maximal overlap LabOne Programming Manual Revision 31421 Zurich Instruments 30 2 3 zoomFFT Module Setting Path Type Unit Description zoomFFT settling tc double TC Minimum wait time in factors of the time constant TC before starting the measurement The maximum between this value and zoomFFT settling time is taken as effective settling time zoomFFT settling double Seconds Minimum wait time in seconds before time starting the measurement The maximum between this value and zoomFFT settling tc is taken as effective settling time zoomFFT window uint64 The type of FFT window to use O Rectangular 1 Hann 2 Hamming 3 Blackman Harris Table 2 4 ZoomFFT Output Values Name Type Unit Description x double Volts The real part x of the complex FFT result y double Volts The imaginary part y of the complex FFT result double VoltsRMS The absolute value R of the complex FFT result timestamp uint64 Ticks Demodulator timestamp of the measurement divide by the device s clockbase to obtain seconds center double Hz The center frequency corresponds to the demodulation frequency rate double Sampling rate of the demodulator filter double The filter envelope the filter compensation value for each gridnode bandwidth double Hz The bandwidth of the demodula
285. ts of sample data s n Event gt count r Event gt path for j 0 j lt Event gt count 7 jtt printf TS f X f Y f n float Event gt value demodSample j timeStamp Event gt value demodSample j x Event gt value demodSample j y break case ZI VALUE TYPE TREE CHANGE DATA printf Su elements of tree changed data s n Event gt count Event gt path 7 for j 0 j lt Event gt count 7 J switch Event gt value treeChangeDataold 3 Action case ZI_TREE ACTION REMOVE LabOne Programming Manual Revision 31421 Zurich Instruments 188 6 2 Module Documentation printf Tree removed s n Event gt value treeChangeDataold j1 Name break case ZI_TREE_ACTION_ADD printf treeChangeDataOld added s n Event gt value treeChangeDataold le Name 7 break case ies ZI TREE ACTION CHANG printf treeChangeDataOld changed s n Event gt value treeChangeDataold 3 Name break break default printf Unexpected event value type Sd n Event gt valueType break LabOne Programming Manual Revision 31421 Zurich Instruments 189 6 2 Module Documentation Data Structure Documentation union ziEvent Val typedef union ziEvent Val void Void DemodSample SampleDemod AuxInSample SampleAuxIn DIOSample SampleD
286. ts the binary type value of one ore more nodes specified in the path This function sets the values at the nodes specified in a path More than one value can be set if a wildcard is used This function sets the value synchronously After returning you know that it is set and to which value it is set ers lin conn Pointer to the ziConnection for which the value s will be set lin path Path to the Node s for which the value s will be set lin buffer Pointer to the byte array with the data in length Length of the data in the buffer lin bufferSize Length of the data in the buffer Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred ZI LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z READONLY on attempt to set a read only node Z COMMAND on an incorrect answer of the server ZI SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values Z _TIMEOUT when communication timed out See Also ziAPIGetValueB ziAPISetValueB LabOne Programming Manual Revision 31421 Zurich Instruments 167 6 2 Module Documentation ziAPISync ZlResult_enum ziAPISync ZIConnection conn Synchronizes the session by dropping all pending data This function drops any data that is pending
287. ubscribe By using wildcards or by using a path that is not a leaf node but contains sub nodes more than one node can be unsubscribed with one function call Parameters lin conn Pointer to the ziConnection for which to unsubscribe for lin path Path to the Nodes to unsubscribe Returns m Z SUCCESS on success Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values Zl TIMEOUT when communication timed out See Data Handling for an example See Also ziAPISubscribe ziAPIPollDataEx ziAPIGetValueAsPollData LabOne Programming Manual Revision 31421 Zurich Instruments 334 6 4 File Documentation ziAPIPollDataEx ZlResult_enum ziAPIPollDataEx ZIConnection conn ZlEvent ev uint32_t timeOutMilliseconds checks if an event is available to read This function returns immediately if an event is pending Otherwise it waits for an event for up to timeOutMilliseconds All value changes that occur in nodes that have been subscribed to or in children of nodes that have been subscribed to are sent from the Data Server to the ziAPI session For a descript
288. uccess Z CONNECTION when the connection is invalid not connected or when a communication error occurred Zl LENGTH if the Path s Length exceeds MAX_PATH_LEN Z OVERFLOW when a FIFO overflow occurred Z READONLY on attempt to set a read only node Z COMMAND on an incorrect answer of the server Z SERVER INTERNAL if an internal error occurred in the Data Server Z _NOTFOUND if the given path could not be resolved or no node given by path is able to hold values Zl TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void ProgramCPU ZIConnection Conn unsigned char Buffer int Len LabOne Programming Manual Revision 31421 Zurich Instruments 321 6 4 File Documentation ZIResult enum RetVal char ErrBuffer if RetVal ziAPISetValueB Conn DEV1046 cpus 0 program Buffer Len ZI_INFO_SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer See Also ziAPlGetValueB ziAPISyncSetValueB LabOne Programming Manual Revision 31421 Zurich Instruments 322 6 4 File Documentation ziAPISyncSetValueD ZIResult_enum ziAPISyncSetValueD ZIConnection conn const char path ZIDoubleData value syn chronously sets a double type value to one or more nodes specified in the path This function sets the values of the nodes specified in path to Value Mor
289. ues as for channel input u nt8_t reservedO uint8_t channelBWLimit Bandwidth limit flag per channel Bit 0 off 0 on 1 Bit 7 1 Reserved uint8_t channelMath Math Operation e g averaging Bit 7 0 Reserved float channelScaling Data scaling factors for up to 4 channels uint32_t sequenceNumber LabOne Programming Manual Revision 31421 Zurich Instruments 257 6 4 File Documentation Current scope shot sequence number Identifies a scope shot uint32_t segmentNumber Current segment number uint32_t blockNumber Current block number from the beginning of a scope shot Large scope shots are split into blocks which need to be concatenated to obtain the complete scope shot uint64_ttotalSamples Total number of samples in one channel in the current scope shot same for all channels uint8_t dataTransferMode Data transfer mode SingleTransfer 0 BlockTransfer 1 ContinuousTransfer 3 FFTSingleTransfer 4 Other values are reserved uint8_tblockMarker Block marker Bit 0 1 End marker for continuous or multi block transfer Bit 7 0 Reserved uint8_t flags Indicator Flags Bit 0 1 Data loss detected samples are 0 Bit 1 1 Missed trigger Bit 2 1 Transfer failure corrupted data uint8_t sampleFormat Data format of samples Int16 0 Int32 1 Float 2 Int16Interleaved 4 Int82Interleaved 5 Floatinterleaved
290. ulator filter time constant Therefore the sweep settling tc parameter dominates the settling time used by the Sweeper at low frequencies and at high frequencies the sweep settling time parameter takes effect Note that the light blue bars corresponding to the sweep settling tc parameter get shorter for each measurement point larger frequency used shorter time constant required whereas the purple bars corresponding to sweep settling time stay a constant length for each measurement point Similarly the sweep averaging tc parameter yellow bars dominates the Sweeper s averaging behavior at low frequencies whereas sweep averaging samples green bars specifies the behavior at higher frequencies see also Equation 2 2 LabOne Programming Manual Revision 31421 Zurich Instruments 23 2 2 Sweeper Module lt O Sweeper Parameters 4 3 pf Vel _ gt an io Demodulator data Averaged data haa Sweep averaging tc aaa Sweep averaging sample ee Sweep settling tc Sweep settling time 0 2 4 6 8 10 12 14 16 Time s Figure 2 2 Plot demonstrating how the Sweeper records three measurement points from demodulator data when using automatic bandwidth control in a frequency sweep Please see An Explanation of Settling and Averaging Times in a Frequency Sweep above for a detailed explanation Table 2 1 Sweeper Input Parameters Setting Path Type Unit Description sweep device byte array z The
291. uments 284 6 4 File Documentation enum ZIValueType_enum Enumerates all types that data ina ZlEvent may have Enumerator ZI_VALUE_TYPE_NONE No data type event is invalid ZI_VALUE_TYPE_DOUBLE_DATA Z DoubleData type Use the ZlEvent value doubleData pointer to read the data of the event Z _VALUE_TYPE_DOUBLE_DATA_TS Z DoubleDataTS type Use the ZlEvent value doubleDataTS pointer to read the data of the event ZI_VALUE_TYPE_INTEGER_DATA Z lntegerData type Use the ZlEvent value integerData pointer to read the data of the event ZI_VALUE_TYPE_INTEGER_DATA_TS ZlintegerDataTS type Use the ZlEvent value integerDataTS pointer to read the data of the event Z _VALUE_TYPE_DEMOD_SAMPLE Z DemodSample type Use the ZlEvent value demodSample pointer to read the data of the event ZI_VALUE_TYPE_AUXIN_SAMPLE ZlAuxInSample type Use the ZlEvent value auxlnSample pointer to read the data of the event ZI_VALUE_TYPE_DIO_SAMPLE Z DIOSample type Use the ZlEvent value dioSample pointer to read the data of the event ZI_VALUE_TYPE_BYTE_ARRAY Z ByteArray type Use the ZlEvent value byteArray pointer to read the data of the event ZI_VALUE_TYPE_BYTE_ARRAY_TS Z ByteArrayTS type Use the ZlEvent value byteArrayTS pointer to read the data of the event ZI_VALUE_TYPE_TREE_CHANGE_DATA ZlTreeChangeData type a list of added or removed nodes Use the ZlEvent value treeChangeData poin
292. umpy structured array Arguments fname file or str The file or filename of the CSV file to load column names list or tuple of str optional A list or tuple of column names to load from the CSV file Default is to load all columns Returns sample numpy ndarray A numpy structured array of shape num points whose field names correspond to the column names in the first line of the CSV file num points is the number of lines in the CSV file 1 Example import zhinst utils sample zhinst utils load labone demod_csv dev2004 demods 0 sample _00000 csv timestamp x y import matplotlib pyplot as plt import numpy as np plt plot sample timestamp np abs sample x 1j sample y load_labone_mat filename A wrapper function for loading a MAT file as saved by the LabOne User Interface with scipy io s loadmat function This function is included mainly to document how to work with the data structure return by scip io loadmat Arguments filename str the name of the MAT file to load LabOne Programming Manual Revision 31421 Zurich Instruments 83 4 4 LabOne Python API ziPython Command Reference Returns data dict a nested dictionary containing the instrument data as specified in the LabOne User Interface The nested structure of data corresponds to the path of the data s node in the instrument s node hierarchy Further comments The MAT file saved by the Lab
293. ure Which measurement data is actually returned by the Sweeper s read command is configured by subscribing to node paths using the Sweeper Module s subscribe command LabOne Programming Manual Revision 31421 Zurich Instruments 22 2 2 Sweeper Module Specifying how the Measurement Data is Averaged One Sweeper measurement point is obtained by averaging recorded data which is configured via the parameters in the sweep averaging branch The sweep averaging tc parameter specifies the minimum time window in factors of demodulator filter time constants during which samples will be recorded in order to average for one returned sweeper measurement point The sweep averaging sample parameter specifies the minimum number of data samples that should be recorded and used for the average The Sweeper takes both these settings into account for the measurement point s average according to Equation 2 2 N max sweep_averaging tc x te x sampling rate sweep averaging sample Equation 2 2 The number of samples N used to average one sweeper measurement point is determined by the parameters sweep averaging tcand sweep averaging sample Note the value of the demodulator filter s time constant may be controlled by the Sweeper depending on the value of sweep bandwidthcontrol and sweep bandwidth see above Controlling how the Sweeper sets the Demodulator s Time Constant For a frequency sweep the sweep averaging tc parameter will tend to influence the nu
294. value Gets the demodulator sample value of the specified node ziResult_enum ziAPIGetDIOSample ZIConnection conn const char path ZIDIOSample value Gets the Digital I O sample of the specified node ZiResult_enum ziAPIGetAuxinSample ZIConnection conn const char path ZlAuxlnSample value gets the Auxln sample of the specified node ziResult_enum ziAPIGetValueB ZIConnection conn const char path unsigned char buffer unsigned int length unsigned int bufferSize gets the Bytearray value of the specified node 7 Result_enum ziAPISetValueD ZIConnection conn const char path ZIDoubleData value asynchronously sets a double type value to one or more nodes specified in the path 7l Result_enum ziAPISetValuel ZIConnection conn const char path ZllntegerData value LabOne Programming Manual Revision 31421 Zurich Instruments 241 6 4 File Documentation asynchronously sets an integer type value to one or more nodes specified in a path Z Result_ enum ziAPISetValueB ZIConnection conn const char path unsigned char buffer unsigned int length asynchronously sets the binary type value of one ore more nodes specified in the path Z Result_ enum ziAPISyncSetValueD ZIConnection conn const char path ZIDoubleData value synchronously sets a double type value to one or more nodes specified inthe path Z Result_ enum ziAPISyncSetValuel ZIConnection conn const char path ZllntegerData
295. ve the same parents arg3 Enum that specifies how the selected nodes are listed ziPython ziListEnum none gt 0x00 The default flag returning a simple listing if the given node ziPython ziListEnum recursive gt 0x01 Returns the nodes recursively LabOne Programming Manual Revision 31421 Zurich Instruments 93 4 4 LabOne Python API ziPython Command Reference ziPython ziListEnum absolute gt 0x02 Returns absolute paths ziPython ziListEnum leafsonly gt 0x04 Returns only nodes that are leafs which means the they are at the outermost level of the tree ziPython ziListEnum settingsonly gt 0x08 Returns only nodes which are marked as setting Or combinations of flags can be used progress progress ziDeviceSettings argl gt object Reports the progress of the command with a number between 0 and 1 read read ziDeviceSettings argl bool arg2 gt object Read device settings Only relevant for the save command argl optional Specify which type of data structure to return Return data either as a flat dict True or as a nested dict tree False Default False read ziDeviceSettings argl gt object save save ziDeviceSettings argl str arg2 gt None Not relevant for the deviceSettings module Set ro set ziDeviceSettings argl str arg2 float arg3 gt None Device Settings Parameters Path name Type Description devicesettings device string Device that
296. version of ziPython 1114111 use the UCS 4 version of ziPython Note The installation needs root access rights If you do not have these permissions ask your system administrator for help Toinstall ziPython ona Debian derived distribution such as Ubuntu perform the following steps 1 If required install Python NumPy and matplotlib with elevated access rights sudo apt get install python python numpy python matplotlib LabOne Programming Manual Revision 31421 Zurich Instruments 73 4 1 Installing the LabOne Python API 2 Unpack the zi Python software bundle tar xzf ziPython version build linux32 linux64 tar gz 3 Change directory into the unpacked folder and run the setup script setup py as following cd ziPython version build linux32 linux64 python setup py build sudo python setup py install install layout deb Elevated access rights It s possible to skip the buildstep install will automatically perform this step but splitting the steps avoids creating a directory in your user space which is owned by root LabOne Programming Manual Revision 31421 Zurich Instruments 74 4 2 Getting Started with the LabOne Python API 4 2 Getting Started with the LabOne Python API This section introduces the user to the LabOne Python API 4 2 1 Contents of the LabOne Python API 4 2 2 4 2 3 Alongside the driver for interfacing with your Zurich Instruments device the LabOne Python A
297. vision 31421 Zurich Instruments 229 6 3 Data Structure Documentation 6 3 17 struct ZIPWASample Single PWA sample value include ziAPI h typedef struct ZIPWASample double binPhase double x double y uint32 t countBin uint32 t reserved ZIPWASample Data Fields double binPhase Phase position of each bin double x Real PWA result or X component of a demod PWA double y Y component of the demod PWA uint32_t countBin Number of events per bin uint32_t reserved Reserved LabOne Programming Manual Revision 31421 Zurich Instruments 230 6 3 Data Structure Documentation 6 3 18 struct ZIPWAWave PWA Wave include ziAPI h typedef struct ZIPWAWave ZITimeStamp timeStamp uint64 t sampleCount uint32 t inputSelect uint32 t oscSelect uint32 t harmonic uint32 t binCount double frequency uint8 t pwaType uint8 t mode uint8 t overflow uint8 t commensurable uint32 t reservedUInt ZIPWASample data 0 ZIPWAWave Data Fields ZIT imeStamp timeStamp Time stamp at which the data was updated uin uin Inp uin t64_t sampleCount Total sample count considered for PWA t32_t inputSelect ut selection used for the PWA t32_t oscSelect LabOne Programm ing Manual Revision 31421 Zurich Instruments 231 6 3 Data Structure Documentation Oscillator used for the PWA
298. visor pm pidAdvisor pmfreq pidAdvisor stable pidAdvisor step pidAdvisor targetbw pidAdvisor targetfail pidAdvisor tf closedloop pidAdvisor tf input double double double double double double double int struct int Int double pidAdvisor pid dlimittimeconstant double double double double double double double double int struct double int int int Stop time for step response Bandwith of the DUT device under test Damping of the second order low pass filter IO Delay of the feedback system describing the earliest response for a step change Resonant frequency of the of the modelled resonator Gain of the DUT transfer function quality factor of the modelled resonator Type of model used for the external device to be controlled by the PID source 1 Lowpass first order source Lowpass second order source Resonator frequency source Internal PLL source VCO source 6 Resonator amplitude Output parameter Impulse response not yet supported PID index for parameter detection Adjusts the demodulator bandwidth to fit best to the specified target bandwidth of the full system In Out parameter Differential gain BW NE In Out parameter Differential filter timeconstant t parameter Integral gain t PID Advisor mode Mode value t coded bit 0 P bit 1 I D bit 3 D filter limit parameter Proportional In Ou Selec is bi bi
299. width used for the PLL loop filter LabOne Programming Manual Revision 31421 Zurich Instruments 107 4 4 LabOne Python API ziPython Command Reference pllAdvisor i double Integral gain pllAdvisor mode double Select PLL Advisor mode Currently only one mode open loop is supported pllAdvisor order double Demodulator order used for the PLL loop filter pllAdvisor p double Proportional gain pllAdvisor pllbw double Demodulator bandwidth used for the PLL loop filter pllAdvisor pm double Output parameter Simulated phase margin of the PLL with the current settings The phase margin should be greater than 45 deg and preferably greater than 65 deg for stable conditions pllAdvisor pmfreq double Output parameter Simulated phase margin frequency pllAdvisor q double Quality factor Currently not used pllAdvisor rate double PLL Advisor sampling rate of the PLL control loop pllAdvisor stable int Output parameter When 1 the PLL Advisor found a stable solution with the given settings When 0 revise your settings and rerun the PLL Advisor pllAdvisor targetbw int Requested PLL bandwidth Higher frequencies may need manual tuning pllAdvisor targetfail int Output parameter 1 indicates the simulated PLL BW is smaller than the Target BW set ziPllAdvisor argl str arg2 int arg3 gt None set ziPllAdvisor argl str arg2 str arg3 gt None set ziPllAdvisor argl object arg2 gt None argl Refer
300. xt sweep point is recorded sweep xmapping uint64 Selects the spacing of the grid used by sweep gridnode the sweep parameter O linear and 1 logarithmic distribution of sweep parameter values sweep historylength uint64 Maximum number of entries stored in the measurement history sweep clearhistory bool Remove all records from the history list sweep filename byte array This parameter is deprecated If specified i e not empty it enables automatic saving of data in single sweep mode sweep endless 0 sweep savepath byte array The directory where files are located when saving sweeper measurements sweep fileformat byte array The format of the file for saving sweeper measurements O Matlab 1 CSV value Measured f f A 5 f fy f f f f f f Frequency Figure 2 3 Sweeper scanning modes Sequential sweep scan 0 LabOne Programming Manual Revision 31421 Zurich Instruments 26 2 2 Sweeper Module Measured value Measured value 6 f f fa f Frequency increases Frequency decreases f f f f 4 5 1 2 3 Figure 2 4 Sweeper scanning modes Bidirectional sweep scan 2 LabOne Programming Manual Revision 31421 Zurich Instruments 27 2 2 Sweeper Module Measured value Measured value Measured value Measured value f 6 7 Frequency f f Frequency f f 6 T Frequency ff
301. y applicable to paths matching DEMODS 0 9 SAMPLE ers in conn Pointer to ZIConnection with which the value should be retrieved lin path Path to the node holding the value out value Pointer toa ZiIDemodSample struct in which the value should be written 7Z _INFO_SUCCESS on success Z ERROR CONNECTION when the connection is invalid not connected or when a communication error occurred Z ERROR LENGTH if the path s length exceeds MAX_PATH_LEN Z _FRROR_OVERFLOW when a FIFO overflow occurred 7 _ERROR_COMMAND on an incorrect answer of the server Z _FRROR_SERVER_INTERNAL if an internal error occurred in Data Server ZI_ERROR_NOTFOUND if the given path could not be resolved or no value is attached to the node Z _ERROR_TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void GetSample ZIConnection Conn ZIResult enum RetVal char ErrBuffer ZIDemodSample LabOne Programming Manual Revision 31421 Zurich Instruments 309 6 4 File Documentation DemodSample if RetVal ziAPIGetDemodSample Conn DEV1046 demods 0 sample amp DemodSample ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t get Parameter s n ErrBuffer else printf TS X f Y f n float DemodSample timeStamp r DemodSample De
302. y connected devices by using ziAPlUpdateDevices Enumerations enum ZIListNodes_enum ZI_LIST_NODES_NONE ZI_LIST_NODES_RECURSIVE ZI_LIST_ NODES_ABSOLUTE ZI_LIST_NODES_LEAFSONLY ZI_LIST_NODES_SETTINGSONLY ZI_LIST_NONE ZI_LIST_RECURSIVE ZI_LIST_ABSOLUTE ZI_LIST_LEAFSONLY ZI_LIST_SETTINGSONLY Defines the values of the flags used in ziAPIListNodes Functions 7 Result_enum ziAPIListNodes ZIConnection conn const char path char nodes int bufferSize int flags Returns all child nodes found at the specified path ZiResult_enum ziAPlUpdateDevices ZIConnection conn Search for the newly connected devices and update the tree Z Result enum ziAPIConnectDevice ZIConnection conn const char deviceSerial const char devicelnterface const char interfaceParams Connect a device to the server 7l Result_enum ziAPIDisconnectDevice ZIConnection conn const char deviceSerial Disconnect a device from the server Detailed Description include lt stdio h gt include ZiAPI h void PrintChildren ZIConnection Conn char Path ZIResult enum RetVal char ErrBuffer LabOne Programming Manual Revision 31421 Zurich Instruments 137 6 2 Module Documentation char NodesBuffer 8192 if RetVal ziAPIListNodes Conn Path NodesBuffer 8192 ZI LIST NODES NONE T ZI_INFO_SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can
303. y for the provided Status parameter ZI INFO BASE for infos Z WARNING BASE for warnings Z ERROR BASE for errors ZI_SUCCESS LabOne Programming Manual Revision 31421 Zurich Instruments 200 6 3 Data Structure Documentation 6 3 Data Structure Documentation 6 3 1 struct AuxInSample The AuxInSample struct holds data for the ZILDATA_AUXINSAMPLE data type Deprecated See ZlAuxinSample include ziAPI h typedef struct AuxInSample ziTimeStampType TimeStamp double Cho double Chi AuxInSample Data Fields zilimeStampType TimeStamp double ChO double Ch1 LabOne Programming Manual Revision 31421 Zurich Instruments 201 6 3 Data Structure Documentation 6 3 2 struct ByteArrayData The ByteArrayData struct holds data for the ZI_LDATA_BYTEARRAY data type Deprecated See Z ByteArray include ziAPI h typedef struct ByteArrayData unsigned int Len unsigned char Bytes 0 ByteArrayData Data Fields unsigned int Len unsigned char Bytes LabOne Programming Manual Revision 31421 Zurich Instruments 202 6 3 Data Structure Documentation 6 3 3 struct DemodSample The DemodSample struct holds data for the ZI_DATA_DEMODSAMPLE data type Deprecated See ZIDemodSample include ZiAPI h typedef struct DemodSample ziTimeStampType TimeStamp double X double Y double Frequency double Phase unsigned int DIOBits unsigned int Reserved d
304. yte array with the data lin length Length of the data in the buffer Returns ZI_SUCCESS on success ZI_CONNECTION when the connection is invalid not connected or when a communication error occurred ZI_LENGTH if the Path s Length exceeds MAX_PATH_LEN Z _OVERFLOW when a FIFO overflow occurred ZI_READONLY on attempt to set a read only node ZI_LCOMMAND on an incorrect answer of the server ZI_SERVER_INTERNAL if an internal error occurred in the Data Server ZI_NOTFOUND if the given path could not be resolved or no node given by path is able to hold values ZI_TIMEOUT when communication timed out include lt stdlib h gt include lt stdio h gt include ziAPI h void ProgramCPU ZIConnection Conn unsigned char Buffer int Len LabOne Programming Manual Revision 31421 Zurich Instruments 163 6 2 Module Documentation ZIResult enum RetVal char ErrBuffer if RetVal ziAPISetValueB Conn DEV1046 cpus 0 program Buffer Len ZI_INFO_SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set Parameter s n ErrBuffer See Also ziAPlGetValueB ziAPISyncSetValueB LabOne Programming Manual Revision 31421 Zurich Instruments 164 6 2 Module Documentation ziAPISyncSetValueD ZIResult_enum ziAPISyncSetValueD ZIConnection conn const char path ZIDoubleData value syn chronously sets a double type value to one or more nodes specif
305. zation ziConnection is ready to connect to a ziServer by calling ziAPIConnect Then ziConnection is ready to be used for getting and setting parameters and streaming data When ziConnection is not needed anymore the established connection to the ziServer has to be hung up using ziAPIDisconnect before cleaning it up by calling ziAPIDestroy 6 1 1 Example Below you find a simple program which sets the demodulator rate of all demods for all devices include lt stdlib h gt include lt stdio h gt include ZiAPI h int main ZIResult enum RetVal char ErrBuffer ZIConnection Conn initialize the ZIConnection if RetVal ziAPIInit amp Conn ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t init Connection s n ErrBuffer return 1 connect to the ziServer running on localhost using the port 8005 default if RetVal ziAPIConnect Conn localhost 8005 ZI_INFO_SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t connect s n ErrBuffer else LabOne Programming Manual Revision 31421 Zurich Instruments 123 6 1 Getting Started set all demodulator rates of all devices to 150Hz if RetVal ziAPISetValueD Conn demods rate 150 t ZI INFO SUCCESS ziAPIGetError RetVal amp ErrBuffer NULL fprintf stderr Can t set parameter s n Er
306. ziAPI h typedef struct ZIIntegerDataTS ZITimeStamp timeStamp ZIIntegerData value ZIIntegerDataTS Data Fields ZITimeStamp timeStamp Time stamp at which the value has changed ZilntegerData value LabOne Programming Manual Revision 31421 Zurich Instruments 246 6 4 File Documentation struct ZITreeChangeData The struct is holding info about added or removed nodes include ziAPI h typedef struct ZITreeChangeData ZITimeStamp timeStamp uint32 t action char name 32 ZITreeChangeData Data Fields ZlTimeStamp timeStamp Time stamp at which the data was updated uint32_t action field indicating which action occured on the tree A value of the ZlTreeAction_enum charname Name of the Path that has been added removed or changed LabOne Programming Manual Revision 31421 Zurich Instruments 247 6 4 File Documentation struct TreeChange The structure used to hold info about added or removed nodes This is the version without timestamp used in API v1 compatibility mode include ziAPI h typedef struct TreeChange uint32 t Action char Name 32 TreeChange Data Fields uint32_t Action field indicating which action occured on the tree A value of the ZlTreeAction_enum TREE_ACTION enum char Name Name of the Path that has been added removed or changed LabOne Programming Manual Revision 31421 Zurich Instruments 248 6 4 F
307. ziAPIDataType Type unsigned int Count unsigned char Path 256 union ziEvent Val Val unsigned char Data 0x400000 ziEvent Data Structures union ziEvent Val Data Fields ziAPIDataType Type unsigned int Count unsigned char Path union ziEvent Val Val unsigned char Data Detailed Description ziEvent is used to give out events like value changes or errors to the user Event handling functionality is provided by ziAPISubscribe and ziAPlUnSubscribe as well as ziAPIPollDataEx LabOne Programming Manual Revision 31421 Zurich Instruments 186 6 2 Module Documentation See Also ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx include lt stdio h gt include ziAPI h void ProcessEvent zIEvent Event unsigned int j switch Event gt valueType case ZI VALUE TYPE DOUBLE DATA printf Su elements of double data s n Event gt count Event gt path for j 0 j lt Event gt count 7 jtt printf Sf n Event gt value doubleData 3 break case ZI VALUE TYPE INTEGER DATA printf Su elements of integer data s n Event gt count Event gt path 7 for j 0 j lt Event gt count 7 jtt printf Sf n float Event gt value integerData j 9 break LabOne Programming Manual Revision 31421 Zurich Instruments 187 6 2 Module Documentation case ZI VALUE TYPE DEMOD SAMPLE printf Su elemen
308. ziAPISubscribe ziAPIUnSubscribe ziAPIPollDataEx LabOne Programming Manual Revision 31421 Zurich Instruments 267 6 4 File Documentation struct DemodSample The DemodSample struct holds data for the ZI DATA_DEMODSAMPLE data type Deprecated See ZIDemodSample include ziAPI h typedef struct DemodSample ziTimeStampType TimeStamp double X double y double Frequency double Phase unsigned int DIOBits unsigned int Reserved double AuxInO double AuxInl DemodSample Data Fields _zilimeStampType TimeStamp double X double Y double Frequency double Phase unsigned int DIOBits unsigned int Reserved double AuxInO LabOne Programming Manual Revision 31421 Zurich Instruments 268 6 4 File Documentation double Auxin1 LabOne Programming Manual Revision 31421 Zurich Instruments 269 6 4 File Documentation struct AuxlnSample The AuxInSample struct holds data for the ZILDATA_AUXINSAMPLE data type Deprecated See ZlAuxIinSample include ziAPI h typedef struct AuxInSample ziTimeStampType TimeStamp double Cho double Chi AuxInSample Data Fields zilTimeStampType TimeStamp double ChO double Ch1 LabOne Programming Manual Revision 31421 Zurich Instruments 270 6 4 File Documentation struct DIOSample The DIOSample struct holds data for the ZI_DATA_DIOSAMPLE data type Deprecated See ZIDIOSample
309. zoomFFT Module 2 3 ZOOMFFT Module The zoomFFT Module corresponds to the Spectrum Tab of the LabOne User Interface It allows the user to perform Fast Fourier Transforms FFT on a specified demodulator s output See Table 2 3 for the input parameters to configure the ZoomFFT Module and Table 2 4 fora description of the ZoomFFT s outputs Amplitude dBV 2 994 2 996 200 2 99 2994 2 996 Amplitude ABV scaled with Filter 2 998 Frequency Hz 2 998 Frequency Hz 3 3 3002 3 004 3 006 3 008 x 10 3002 3 004 5006 3 008 x 10 Figure 2 6 A plot of an FFT created by one of the LabOne Matlab API examples Table 2 3 ZoomFFT Input Parameters Setting Path Type Unit Description zoomFFT device byte array The device ID to perform the FFT on e g dev123 compulsory parameter zoomFFT absolute bool Shifts the frequencies so that the center frequency becomes the demodulation frequency rather than 0 Hz ZOOMFFT bit uint64 E Number of lines of the FFT spectrum powers of 2 Increasing the bits increases the frequency resolution of the spectrum zoomFFT endless bool Enable Endless mode run the zoomFFT continuously zoomFFT loopcount uint64 The number of zoomFFTsto perform zoomFFT mode uint64 Select the source signal for the FFT O FFT x iy 1 FFT R 2 FFT phase 3 FFT Freq zoomFFT overlap double Overlap of the demodula

Download Pdf Manuals

image

Related Search

Related Contents

Bedienungsanleitung D100 Kinderhandy - Kochstofftier  Manuale tecnico    Siemens S65 User's Manual  ARCTIC Land Rider 309  Rosen Shingle Creek • Orlando, FL  Makita 2705X1 Instructions / Assembly  Sikaflex® –1c SL  3Q Instruction Booklet - Conair Canada  Toshiba PAR30 LED 16W  

Copyright © All rights reserved.
Failed to retrieve file