Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxBase Error -1073807346 on USB6501

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
 

0 Kudos
Message 1 of 3
(3,857 Views)
I should have mentioned that this is on MacOSX. Thanks,

Doug

0 Kudos
Message 2 of 3
(3,856 Views)

Hi Doug,

It sounds like you are trying to eliminate the load delay. There is no way to eliminate this because the LabVIEW Run-Time Engine is being loaded. I recommend going to back to a language that you are more comfortable programming with and using some example programs. The DAQmx Base text based examples on the Mac are located in Applications >> National Instruments >> NI-DAQmx Base >> Examples. The LabVIEW Examples are in the LabVIEW Folder. I hope that you find this information helpful.

Regards,

Hal L.

0 Kudos
Message 3 of 3
(3,844 Views)