U3 Programming - make FIO output depend on FIO input | LabJack
 

U3 Programming - make FIO output depend on FIO input

2 posts / 0 new
Last post
Cliff Stoll
Cliff Stoll's picture
U3 Programming - make FIO output depend on FIO input

Newbie here!  

I have a U3 labjack (v1.3) connected through USB to my iMac (MacOs Monterry).  Exodriver & LabJack Python.  

The little red guy works like a champ!  I can easily read digital pins & write to pins with Python commands:

     eg,   python commands like    return(d.getFIOState(input_wire))

Application: Turn on a motor by setting high the FIO output wire#1.   When the device hits a limit switch connected to FIO input #7 (and FIO#7 input goes high), the output wire#1 wll go low and the motor stops 

This works fine right now, using a python loop on the Mac, I turn on wire#1 which starts the motor.  I watch for the FIO state of wire#7.  When it goes high, my script sets the FIO state on wire#1 to low. 

This loop requires the Mac to repeatedly query the U3, with a short 20 millisec delay between queries.

It works like a champ -- my high congratulations to the LabJack programmers!

But is there a way to program this entirely into the U3  so that the loop can be offloaded from the Mac onto the U3?  

What I'm thinking is a short function that lives on the U3:

        Mac tells U3 to start function.  U3 turns on FIO#1.  When FIO#7 goes high, the FIO#1 goes low.  Function ends, optionally sending a message back to Mac.  (looping & testing done entirely within U3)

Is this possible?  If so, can you give a few hints on how to do it?

In advance, MANY THANKS!    -Cliff (a sunny Sunday mornining in Oakland)

Cliff Stoll
Cliff Stoll's picture
Aha!  I see that the"T"

Aha!  I see that the"T" series devices support this type of programming, not the U3 that's on my desk. 

No problem, I'll keep fooling with the U3.  

   Cheers all around!    -Cliff