#NEWLINE# @ Action ( units = ( None , None , 'seconds' , None ) , values = ( None , None , None , _GROUP_BY ) ) #NEWLINE# def write( self , data , auto_start = True , timeout = 10.0 , group_by = 'scan' ) : #NEWLINE# #INDENT# "Write multiple floating-point samples or a scalar to a task\n        that contains one or more analog output channels.\n\n        Note: If you configured timing for your task, your write is\n        considered a buffered write. Buffered writes require a minimum\n        buffer size of 2 samples. If you do not configure the buffer\n        size using DAQmxCfgOutputBuffer, NI-DAQmx automatically\n        configures the buffer when you configure sample timing. If you\n        attempt to write one sample for a buffered write without\n        configuring the buffer, you will receive an error.\n\n        :param data: The array of 64-bit samples to write to the task\n                     or a scalar.\n\n        :param auto_start: Whether or not this function automatically starts\n                           the task if you do not start it.\n\n        :param timeout: The amount of time, in seconds, to wait for this\n                        function to write all the samples. The default value is 10.0\n                        seconds. To specify an infinite wait, pass -1\n                        (DAQmx_Val_WaitInfinitely). This function returns an error\n                        if the timeout elapses.\n\n                        A value of 0 indicates to try once to write the submitted\n                        samples. If this function successfully writes all submitted\n                        samples, it does not return an error. Otherwise, the\n                        function returns a timeout error and returns the number of\n                        samples actually written.\n\n        :param group_by: how the samples are arranged, either interleaved or noninterleaved\n\n            'channel' - Group by channel (non-interleaved).\n\n            'scan' - Group by scan number (interleaved).\n\n        :return: The actual number of samples per channel successfully\n                 written to the buffer.\n\n        " #NEWLINE# if np . isscalar ( data ) : #NEWLINE# #INDENT# err = self . lib . WriteAnalogScalarF64 ( bool32 ( auto_start ) , float64 ( timeout ) , float64 ( data ) , None ) #NEWLINE# return 1 #NEWLINE# #UNINDENT# data = np . asarray ( data , dtype = np . float64 ) #NEWLINE# number_of_channels = self . number_of_channels ( ) #NEWLINE# if ( data . ndims == 1 ) : #NEWLINE# #INDENT# if ( number_of_channels == 1 ) : #NEWLINE# #INDENT# samples_per_channel = data . shape [ 0 ] #NEWLINE# shape = ( samples_per_channel , 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# samples_per_channel = ( data . size / number_of_channels ) #NEWLINE# shape = ( samples_per_channel , number_of_channels ) #NEWLINE# #UNINDENT# if ( not ( group_by == Constants . Val_GroupByScanNumber ) ) : #NEWLINE# #INDENT# shape = tuple ( reversed ( shape ) ) #NEWLINE# #UNINDENT# data . reshape ( shape ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( group_by == Constants . Val_GroupByScanNumber ) : #NEWLINE# #INDENT# samples_per_channel = data . shape [ 0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# samples_per_channel = data . shape [ ( - 1 ) ] #NEWLINE# #UNINDENT# #UNINDENT# ( err , count ) = self . lib . WriteAnalogF64 ( samples_per_channel , auto_start , timeout , group_by , data . ctypes . data , RetValue ( 'i32' ) , None ) #NEWLINE# return count