voltage from port DAC0

Shuyang Jin's Avatar

Shuyang Jin

12 Aug, 2021 05:51 PM

Hi Chris,

This is Shuyang in Court Hull's lab at Duke. I was setting up a new experiment recently and found something weird. On some of our rigs, there is a 5V output between port DAC0 and Ground once an experiment is loaded in MWorks. This doesn't seem to be experiment specific, as I tried to load different xml programs and they all made the DAC0 to have a 5V output. I'm also not seeing this on all of our rigs. All the Macs are having the same LabJack6 Plugin code. Do you have any idea why there's this 5V output on some of the rigs?

Thank you so much!
Shuyang

Showing page 2 out of 2. View the first page

  1. Support Staff 31 Posted by Christopher Sta... on 04 Oct, 2021 04:22 PM

    Christopher Stawarz's Avatar

    Do you see tBlock2TrialNumber getting set to 1 on each trial?

    No, it's always zero.

  2. 32 Posted by llglick on 04 Oct, 2021 04:29 PM

    llglick's Avatar

    That's very strange.
    doBlock2 and doBlock2SeparateOdds are both set to 1?
    And block2TrPer80Level1 = 80?
    I'll make sure that tBlock2TrialNumber is being set on our end...
    Lindsey.

  3. Support Staff 33 Posted by Christopher Sta... on 04 Oct, 2021 05:34 PM

    Christopher Stawarz's Avatar

    doBlock2 and doBlock2SeparateOdds are both set to 1? And block2TrPer80Level1 = 80?

    Yes to all.

  4. 34 Posted by llglick on 06 Oct, 2021 08:11 PM

    llglick's Avatar

    Hi Chris,
    After some more troubleshooting, it seems like at least some of our issue
    was a variable set one. When doEasyStart is 1, this sets tBlock2TrialNumber
    to 0.
    However, we're still not in the clear. There is still a computer-specific
    and/or plugin-specific issue:
    On three computers, the plugin you had sent on 7/22 (to fix the
    ehFeedbackError) and the more recent one (to fix the DAC0 high error) have
    the expected DAC0 output using both our code and dac_cycle.mwel.
    However, on another computer the plugin from 7/22 works fine, but the more
    recent one does not: tBlock2TrialNumber goes high (and in dac_cycle it says
    that it's sending output) but nothing happens.
    We tried swapping the labjacks between the two computers, but that didn't
    do anything.
    All computers have the same version of Mworks, but the one in question had
    a much older OS (it had High Sierra, while the other three had either
    Mojave or Catalina). We updated the computer to Catalina, but that still
    doesn't have any DAC0 output with the latest plugin.
    We also now have a different problem, where Mworks is using Display 1 as
    the stimulus display, despite this being set for Display 2 in the
    Preferences.
    We've tried reinstalling Mworks, but that didn't solve either issue.
    Do you have any suggestions?
    Thanks,
    Lindsey.

  5. 35 Posted by llglick on 08 Oct, 2021 01:44 PM

    llglick's Avatar

    Hi Chris,

    To follow up on the display issue, we did try to use the configuration file
    as described here:
    https://mworks.tenderapp.com/discussions/questions/568-mwork-window-configuration

    We created a system-level configuration file but noticed that it doesn't
    update when we make changes in the MWclient preferences window. We found
    the user-level configuration file that does change appropriately when
    changes are made in the preferences window. According to the documentation
    the system level file should take precedence, but it doesn't seem to be
    that way. Another interesting thing we noticed is that this computer is the
    only one with a user-level "Library" folder that contains Application
    support > Mworks > Configuration. Could this be the issue?

    Lindsey.

  6. Support Staff 36 Posted by Christopher Sta... on 08 Oct, 2021 02:11 PM

    Christopher Stawarz's Avatar

    Hi Lindsey,

    We created a system-level configuration file but noticed that it doesn't update when we make changes in the MWclient preferences window. We found the user-level configuration file that does change appropriately when changes are made in the preferences window. According to the documentation the system level file should take precedence, but it doesn't seem to be that way.

    You're correct that changes made in MWServer's preferences window affect the user-level config file, not the system-level one. However, as noted in the manual, it's the user file that takes precedence, not the system one. The system one will be used only if the user one doesn't exist.

    Another interesting thing we noticed is that this computer is the only one with a user-level "Library" folder that contains Application support > Mworks > Configuration. Could this be the issue?

    The user-level config file should just contain the settings you see in MWServer's preferences window. What do you see in MWServer → Preferences → Display → "Display stimuli on:"? On a system with two displays, the three possibilities should be "Mirror window only", "Main display", and "Display 2". "Main display" is whichever display the macOS Dock is on. "Display 2" is the other one.

    Chris

  7. Support Staff 37 Posted by Christopher Sta... on 08 Oct, 2021 02:52 PM

    Christopher Stawarz's Avatar

    Hi Lindsey,

    On three computers, the plugin you had sent on 7/22 (to fix the ehFeedbackError) and the more recent one (to fix the DAC0 high error) have the expected DAC0 output using both our code and dac_cycle.mwel. However, on another computer the plugin from 7/22 works fine, but the more recent one does not: tBlock2TrialNumber goes high (and in dac_cycle it says that it's sending output) but nothing happens.

    Just to be specific, when you say that dac_cycle.mwel says it's sending output, are you seeing this message?

    *** 10mW is received and 4.13953V is sent ***
    

    If yes, then this must be another issue in LabJack's code, as the reported voltage value (4.13953) is exactly what gets passed to the eDAC function.

    To confirm this, I've attached a test program (called just "dac_cycle") that does the same thing as dac_cycle.mwel but uses only LabJack code. When I run it, the LED attached to my U6 toggles on/off once per second, and I see the following output in Terminal:

    $ ./dac_cycle 
    Setting DAC0 to 4.1 V (54291)
    Setting DAC0 to 0 V (0)
    Setting DAC0 to 4.1 V (54291)
    Setting DAC0 to 0 V (0)
    ...
    

    The program stops after 10 on/off iterations. Can you try this on your misbehaving system and let me know what happens?

    Thanks,
    Chris

  8. 38 Posted by llglick on 08 Oct, 2021 05:30 PM

    llglick's Avatar

    This comment was split into a new discussion: MWorks always uses main display

    Hi Chris,

    Yes, we do see those three options. Selection of either the Main Display or
    Display 2 results in the display on the Main Display (the one with the
    macOS Dock).

    When these preferences are toggled, they are updated in the user-level file
    (0 for Main, 1 for Display 2), but the display used does not change, and
    nor does the system-level file.

    Lindsey.

  9. Support Staff 39 Posted by Christopher Sta... on 12 Oct, 2021 12:46 PM

    Christopher Stawarz's Avatar

    Hi Lindsey,

    It sounds like the preferences are being set correctly. I have no idea why the main display is always being used. Have you tried rebooting the Mac?

    Chris

  10. 40 Posted by llglick on 12 Oct, 2021 01:42 PM

    llglick's Avatar

    Yes.

  11. Support Staff 41 Posted by Christopher Sta... on 18 Oct, 2021 12:58 PM

    Christopher Stawarz's Avatar

    Hi Lindsey,

    Have you had a chance to run the additional DAC test I suggested?

    Thanks,
    Chris

  12. 42 Posted by llglick on 18 Oct, 2021 03:16 PM

    llglick's Avatar

    Hi Chris,
    No- I had missed this email.
    The console did report sending the output.
    We will try this new test.
    Thanks,
    Lindsey.

  13. 43 Posted by llglick on 20 Oct, 2021 02:30 PM

    llglick's Avatar

    Hi Chris,

    I just tried this (I'm just executing the unix file, right?), but it doesn't seem to find the labjack- here's the terminal error:

    hullglick6:~ hullglick$ /Users/hullglick/Downloads/dac_cycle ; exit;
    Open error: could not find a U6 with a local ID or serial number of -1

    Lindsey.

  14. Support Staff 44 Posted by Christopher Sta... on 20 Oct, 2021 03:37 PM

    Christopher Stawarz's Avatar

    Hi Lindsey,

    Despite the wording, that error message indicates that at least one U6 device was found, but it couldn't be opened for some reason. Is MWServer open and running an experiment that uses the U6? If so, try quitting it, as it may be preventing dac_cycle from using the device.

    Chris

  15. 45 Posted by llglick on 20 Oct, 2021 03:44 PM

    llglick's Avatar

    Oops- yes, I had Mworks open.
    I do see DAC0 output using that script.
    Lindsey.

  16. Support Staff 46 Posted by Christopher Sta... on 20 Oct, 2021 03:59 PM

    Christopher Stawarz's Avatar

    I do see DAC0 output using that script.

    OK, so both the device and the LabJack code seem to work correctly.

    But you don't see DAC0 output when running dac_cycle.mwel in MWorks, correct? And this is despite the console message saying "10mW is received and 4.13953V is sent"? If so, it's hard to see where things could be going wrong, as it sounds like both the MWorks plugin and the LabJack code it uses are working correctly.

    I'm not sure what the next step is with this...

    Chris

  17. 47 Posted by llglick on 20 Oct, 2021 04:07 PM

    llglick's Avatar

    That is correct. I do not see DAC0 output using dac_cycle.mwel in Mworks-
    though only if I use the most recent plugin where you fixed the DAC0-high
    issue.
    If I use the plugin you sent in July, I do see DAC0 output with dac_cycle.
    So I do think it's a plugin issue- though for some reason, it's an issue
    that is specific to this computer.
    Lindsey.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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