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

Problem in using EDigitalOut


  • Please log in to reply
3 replies to this topic

#1 achal

achal
  • Members
  • 4 posts

Posted 17 July 2012 - 12:01 AM

I am using EdigitalIn method to read state its working fine.But when i use EDigitalOut to set state of a channel then it does not give error, but when i read the state of the set channel using EDigitalIn it gives error 66(Could not claim LabJack). How to Set state and then read the set . using C#

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 17 July 2012 - 06:21 AM

That is a strange error to get. It suggests that something else is holding the U12 open, and thus the EDigitalIn call cannot open it. What language are you using? Do you have any threads that might be getting in the way? Can you replicate the problem with a very simple example?

#3 achal

achal
  • Members
  • 4 posts

Posted 17 July 2012 - 11:07 PM

I am using C#. To set state: _labJackId=1; DemoMode=0; _channel=5;//(Any channel number) _value=1 lj.LabJack.EDigitalOut(ref _labJackId, DemoMode, _channel, 1, _value); After Calling this method then to read the state: lj.LabJack.EDigitalIn(ref _labJackId, DemoMode, portNumber, -1, ref state); It gives error : 66 (Could not claim LabJack).

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 23 July 2012 - 01:35 PM

I am using C#.

To set state:
_labJackId=1;
DemoMode=0;
_channel=5;//(Any channel number)
_value=1
lj.LabJack.EDigitalOut(ref _labJackId, DemoMode, _channel, 1, _value);


After Calling this method then to read the state:

lj.LabJack.EDigitalIn(ref _labJackId, DemoMode, portNumber, -1, ref state);

It gives error : 66 (Could not claim LabJack).


That error message is caused when the driver isn't able to claim the mutex associated with the device. Typically, this means that another thread or program is in the middle of calling a function with the LabJack and that one has not yet finished. Are those calls inside the same thread?


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users