# Voltage from port DAC0

**URL:** <https://mworks.discourse.group/t/voltage-from-port-dac0/98>\
**Category:** Support\
**Tags:** unsolved-mystery\
**Created:** [August 12, 2021, 5:51pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98 "2021-08-12T17:51:47Z")\
**Posts on this page:** 16\
**Page:** 3

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 6, 2021, 8:11pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/41 "2021-10-06T20:11:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 8, 2021, 1:44pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/42 "2021-10-08T13:44:39Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 8, 2021, 2:11pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/43 "2021-10-08T14:11:38Z")

</div>

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](https://mworks.github.io/documentation/latest/guide/installation.html#configuration), 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

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 8, 2021, 2:52pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/44 "2021-10-08T14:52:17Z")

</div>

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:

```auto
$ ./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

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 8, 2021, 2:52pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/45 "2021-10-08T14:52:17Z")

</div>

Attachment: [dac\_cycle.zip](https://mworks.discourse.group/uploads/short-url/q8WDaBtPa32aa5P0yglCyyGQopk.zip) (58.3 KB)

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 8, 2021, 5:30pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/46 "2021-10-08T17:30:29Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 12, 2021, 12:46pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/47 "2021-10-12T12:46:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 12, 2021, 1:42pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/48 "2021-10-12T13:42:57Z")

</div>

Yes.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 18, 2021, 12:58pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/49 "2021-10-18T12:58:17Z")

</div>

Hi Lindsey,

Have you had a chance to run the [additional DAC test](https://mworks.tenderapp.com/discussions/questions/7105#comment_49426166) I suggested?

Thanks,  
Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 18, 2021, 3:16pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/50 "2021-10-18T15:16:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 20, 2021, 2:30pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/51 "2021-10-20T14:30:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 20, 2021, 3:37pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/52 "2021-10-20T15:37:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 20, 2021, 3:44pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/53 "2021-10-20T15:44:32Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 20, 2021, 3:59pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/54 "2021-10-20T15:59:04Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 20, 2021, 4:07pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/55 "2021-10-20T16:07:49Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [April 2, 2024, 1:18pm UTC](https://mworks.discourse.group/t/voltage-from-port-dac0/98/57 "2024-04-02T13:18:39Z")

</div>

Closed on April 2, 2024, 1:18pm UTC



[Previous page](https://mworks.discourse.group/t/voltage-from-port-dac0/98.md?page=2)
