Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


Photo

LabJack using Python 2.7.3. (need to run 2 programs at same time).

Fork Loop

  • Please log in to reply
2 replies to this topic

#1 medavis1

medavis1
  • Members
  • 1 posts

Posted 20 November 2013 - 03:58 PM

I'm trying to write a program (1) that will monitor inputs of both analog and digital while another program (2) is monitoring different inputs both analog and digital and as well as sending commands out.

Program (1) is a safety program, that will need to be able to shut everything down if activated. It should run continuously, until the program shuts down.

Program (2) is the service program, I'm using to run some test continuously until a certain count is reached. I will also need to record some of the data.

 

Can anybody help?

Please give me some pointers as to what commands I need to use and how to use them, to accomplish what I'm trying to do.

 



#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 20 November 2013 - 05:07 PM

For all supported operating systems, only one process can access a LabJack/U3 device at a time. The process that has the LabJack opened needs to close the device handle (or close the process) before the other process can access it. You can try one of the three things:

 

1. Have the processes communicate between each other to synchronize when the LabJack is opened/closed and data. You can open, perform your operation and close the LabJack to minimize the process's claim of it.

 

2. Instead of two processes use two threads in one process. The two threads can share the handle to the LabJack.

 

3. Use two U3s. One process uses one U3 and the other process uses the other U3.

 

Note that there are other options but these are 3 quick ones I came up with.

 

For Python usage refer to the LabJackPython page:

 

http://labjack.com/s...t/labjackpython

 

The quickstart section demonstrates analog inputs/outputs and digital I/O usage.



#3 NinerSevenTango

NinerSevenTango
  • Members
  • 3 posts

Posted 20 November 2013 - 07:13 PM

1 or 3, above, seem best.

 

Here's why:

 

http://eli.thegreenp...ultiprocessing/




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users