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

UE9 Program Flow and Counter Question


  • Please log in to reply
4 replies to this topic

#1 RedSpanner

RedSpanner
  • Members
  • 37 posts

Posted 28 July 2012 - 10:29 AM

Hi,
I'm just returning to a LabJack project after several months on a different project. In my earlier work, I started with the LJWorkingWithModbus.py program, and got a configuration working with excellent help from LJ staff and this forum.

As I look at the evolution of this project, though, and add in some additional control activity, I'm thinking I should re-write this code using the LJ low-level functions rather then Modbus-oriented reads and writes. Before I embark on that, though, I want to ensure I'm moving in the right direction. Here is how I anticipate doing this: Am I on the right track?
  • Operate in Command/ Response Mode
  • Use low level functions
  • Establish communication (I'll use existing code, which works fine) with ue9;
  • Initialize ue9 devices with UE9.controlConfig() method;
  • Read data with UE9.feedback() and UE9.timerCounter() methods;
  • Iterate reads and send control signals via UE9.feedback() method;

I've got another question related to hardware setup: I will be counting pulses from a powermeter, with each output pulse signalling 1.25 Watt-hours. This powermeter is connected to a 60W heater, so I don't anticipate high-freq pulse counting. Hence, I expect counter0 can capture the falling edge of these pulses with no problem. However, I'm puzzled by the dynamic allocation of FIO lines to timers and counters. If I wire the pulse output from the power meter to FIO6, how can I always ensure the counter0 is looking at that pin? Or, am I misundertstanding what I read in Sec 5.3.5?

Thanks in advance, folks, I'd welcome any feedback!
Dean

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 30 July 2012 - 12:40 PM

It looks like you are on the right track, though if reading analog inputs or setting analog outputs I suggest performing a UE9.getCalibrationData() call after your UE9.controlConfig() call so analog conversion functions are using calibrated data stored on the UE9.

As for timers/counters and the pin assignment on the FIO lines, take a look at this User Guide section as it explains it:

http://labjack.com/s...sers-guide/2.10

Timers/counters start on FIO0 and take over FIO lines in a sequence starting with enabled timers and then counters. So to force Counter 0 on FIO6 you would need to enable 6 timers and Counter 0.

#3 RedSpanner

RedSpanner
  • Members
  • 37 posts

Posted 31 July 2012 - 04:44 PM

FIO0 through FIO4 are configured for power and related functions for 2 - EI1050 sensors. FIO5 is unassigned. Does the fact that FIO0-4 are doing non-timer/counter activities cause a problem here? Will FIO5 then take up the first counter function defined, in the same fashion as outlined in the user manual? Thanks!

#4 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 01 August 2012 - 10:14 AM

On the U3 and U6 you can move timer's and counters using the TCPinOffset, but the UE9 does not have this feature. Timer and counters take precedence over all other functions and always start at at FIO0. Section 2.10 goes into more detail about pin assignments.

#5 RedSpanner

RedSpanner
  • Members
  • 37 posts

Posted 01 August 2012 - 05:23 PM

On the U3 and U6 you can move timer's and counters using the TCPinOffset, but the UE9 does not have this feature. Timer and counters take precedence over all other functions and always start at at FIO0. Section 2.10 goes into more detail about pin assignments.


OK -- Ouch! I'll need to move those wires!


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users