Hi Jing,
I am having some problem with the Reward Window function to send manual reward. My Mworks with a NI-6212, the digital output that controls a solenoid valve stayed on constantly no matter how long the set duration is. do you know why this could happen?
MWClient’s reward window is very simple. When you click “Send Reward”, all it does is take the value in “Reward Duration”, convert it from milliseconds to microseconds, and assign the duration in microseconds to the variable specified in “Var name”. Your experiment is responsible for monitoring assignments to this variable and dispensing the reward when appropriate.
Here’s an example (in MWEL) of how you can arrange this to work with a NIDAQ device:
var reward_line = false
nidaq nidaq (
name = Dev1
update_interval = 3ms
analog_input_data_interval = 1ms
analog_output_data_interval = 1ms
) {
nidaq_digital_output (
port_number = 1
num_lines_in_port = 8
line0 = reward_line
)
}
var reward (0) {
if (reward > 0) {
reward_line = true
wait (reward)
reward_line = false
}
}
The key point is that there are two variables. reward
is assigned via the reward window. It has some attached actions that set the second variable (reward_line
) high, wait for the specified duration, then set reward_line
low again.
I suspect that you were attempting to set the equivalent of reward_line
directly via the reward window, which isn’t going to work.
what kind of capacitive touchscreen devices have been used and recommended to interface with MWorks.
The only capacitive touchscreen that’s directly supported is the built-in touchscreen on an iPad. This requires that you run the equivalent of MWServer on the iPad itself. To detect touches within your experiment, you would use a touch input device.
If you want/need to run your experiment on a Mac, any touchscreen that registers touches as standard mouse events should be fine. To detect the touches, you’d use a mouse input device. I know some folks have successfully used Elo touchscreens with MWorks in the past, though I don’t remember the specific model.
I don’t see any option of taking webcam as input in the library. My purpose is simply registering the intensity of few pixels of an imaging device to MWorks. Is there a way to implement that?
MWorks does not support webcam input. Could you instead use a photodiode connected to an analog input on the NIDAQ?
Cheers,
Chris