Reward window, touchscreen and video devices

wangjing's Avatar

wangjing

04 Jul, 2018 12:28 AM

Dear Chris,
1, 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?
2, what kind of capacitive touchscreen devices have been used and recommended to interface with MWorks.
3, 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?
Thank you very much!

-Jing

  1. Support Staff 1 Posted by Christopher Sta... on 05 Jul, 2018 06:47 PM

    Christopher Stawarz's Avatar

    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

  2. 2 Posted by wangjing on 06 Jul, 2018 02:43 PM

    wangjing's Avatar

    Hi Chris, That’s very helpful, I have to extract signal from a video stream, It seems better to find other way to synchronize the recording. Thank you!
    - Jing

  3. Christopher Stawarz closed this discussion on 09 Jul, 2018 01:50 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac