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.


timer with .net and matlab

  • Please log in to reply
3 replies to this topic

#1 fox

  • Members
  • 2 posts

Posted 31 July 2013 - 12:38 AM



I am using an U3 with matlab. I recently tested the matlab .net examples provided here: http://labjack.com/s...examples/matlab


Now I'm having trouble changing the timer clock base:

%Use the 48 MHz timer clock base with divider (LJ_tc48MHZ_DIV = 26). Since we are using clock with divisor support, Counter0 is not available.

ljudObj.AddRequest(ljhandle, LabJack.LabJackUD.IO.PUT_CONFIG, LabJack.LabJackUD.CHANNEL.TIMER_CLOCK_BASE, 26, 0, 0);


The comment says that "LJ_tc48MHZ_DIV" equals "26". Where do I find the values for other clocks and pwm modes?

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 31 July 2013 - 09:32 AM

In readable form, Section 4.3.6 is a good resource for timer/counter configuration:




To get the numeric value of the constants, I suggest you look at the header file labjackud.h, although the more elegant solution is to use the string and pass it to StringToConstant() to get the number if needed:



#3 fox

  • Members
  • 2 posts

Posted 05 August 2013 - 12:01 AM

Thank you. Getting the numerical values from the header file worked fine for me.


But now I have a different problem:

I want to stream data from AIN0 with the special 0-3.6V range. I tried to enable this by the following line:

ljudObj.Addrequest(ljhandle, LabJack.LabJackUD.IO.ADD_STREAM_CHANNEL_DIFF, 0, 0, 32, 0);

But now I only get maximum readings of 2.5V instead of 3.6V.  I measured my signal with a voltmeter... it should definitively get up to nearly 4V.


#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 05 August 2013 - 09:03 AM

I don't see a problem in your call.  A couple things you can try:


    - Make a simple call to eAIN and see if you can get the 0-3.6V range working with that.


    - Try closing matlab and run LJStreamUD.exe to see if you can get the 0-3.6V range working there.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users