MWorks' Pulse Variable action does nothing other than set a specified variable to 1 for a duration then reset it to 0. Whether it would be appropriate for controlling your stimulation hardware depends entirely on the interface (hardware and software) used to connect MWorks to the device.
If you're using an XBI system, then I presume you'll be making use of its general-purpose I/O capabilities. If so, I recommend seeking the advice of someone familiar with the MWorks XBI interface. (The XBI interface is not a standard part of MWorks, and I have no knowledge of or experience with it.)
Thank you very much for your prompt response. I will contact our xBI expert Ralf Brockhausen.
I have another question, I train my animals on auditory tasks using xBI. To present auditory stimuli in xBI, I generate them on Matlab & save them as .wav files. During the experiment, MWorks loads .wav files & plays them during a trial. As a result, there is a latency of 16 milliseconds. I was wondering if you know a way to work around this issue. If not, do you plan to make any new plugins in the future that would let me define the sound frequency in a given trial & then MWorks presents the pre-defined tone without any time lag? Looking forward to your response!
I don't know the source of the 16ms latency you're experiencing.
MWorks' current audio playback capabilities are very limited. At some point, I would love to rework things so that audio stimuli are comparable to visual stimuli, in terms of both flexibility of stimulus definition and accuracy in presentation timing. However, I don't think I'll be able to take on such a project in the immediate future (i.e. the next 3-4 months).
If you're interested in attempting to develop a new audio plugin yourself, it looks like AVAudioEngine is Apple's currently-recommended interface for low-latency audio playback.
Thanks again for your response. I load my Matlab-generated wav files on MWorks in the 'Sounds' directory & then use the built-in function 'Play sound' to play a sound in a given trial. Please let me know if this is the right way to do it. To look for latency issues, I used a click train & found that if the first click starts after 16 or 20 ms from the click train onset (please see the figure) then I can hear all the 3 clicks when played on MWorks.
It would be great if MWorks can present audio stimuli to the level of visual stimuli. I will look into AVAudioEngine.