Hello,
The full error I get is
DAQmxBase Error -1073807346: Refnum to Session in
Fusion.WriteThenRead.vi->Fusion.DIO_Immediate.read.vi->DAQmxBase
Write Fusion(Digital 1D U8 NChan 1Samp).vi:5->DAQmxBase Write
(Digital 2D U32 NChan
NSamp).vi:2->DAQmxBaseWriteDigitalU32.vi->DAQmxBaseWriteDigitalU32.vi.ProxyCaller
What I am trying to do is write a Python daemon program to get around
the ~20 sec time it takes to loads the libs and dlls. So as a test I want the daemon
to write an incrementing value every 10 seconds to the port0
the code looks like
write_byte(121) ###### It works fine here. In fact
if I don't write here before the main loop the main loop crashes.
_constants = ['count']
count = 55
def main(count):
""" A demo daemon main routine, write a datestamp to
/tmp/daemon-log every 10 seconds.
"""
import time
#count = 0
f = open("/Users/daemon-log", "w")
while 1:
f.write('%d %s\t' % (count, time.ctime(time.time())) )
f.write('%s\n' % sys.platform)
f.flush()
time.sleep(10)
#print "\a"
count += 1
#if count ==1:
write_byte(count) #########
This is where I get the error or crash if I don't write_byte above
So I am a lot naive about writing a daemon program so I don't quite understand exactly what I am doing
but the Python write_byte routine does work. Any thoughts , pointers or references would be greatly appreciated.
Thanks much,
Doug Taylor