Skip to content

Commit 6a798fc

Browse files
Merged in cbillington/labscript/bugfix (pull request labscript-suite#39)
Static DO fix
2 parents 5268ab1 + 7bcd410 commit 6a798fc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

labscript.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1610,12 +1610,14 @@ def __init__(self, *args, **kwargs):
16101610
self._static_value = None
16111611

16121612
def go_high(self):
1613-
if self._static_value is not None:
1613+
if self._static_value is None:
16141614
self.add_instruction(0,1)
16151615
self._static_value = 1
1616+
else:
1617+
raise LabscriptError('%s %s has already been set to %s. It cannot also be set to %s.'%(self.description, self.name, self.instruction_to_string[self._static_value], self.instruction_to_string[value]))
16161618

16171619
def go_low(self):
1618-
if self._static_value is not None:
1620+
if self._static_value is None:
16191621
self.add_instruction(0,0)
16201622
self._static_value = 0
16211623
else:

0 commit comments

Comments
 (0)