U3-HV Two timers + one counter...???


Recommended Posts

Hello DF team & all !

I am developping an app for engine test acquisition. I have read anything (and looked everywhere, in this forum, and the labjack's one...and the documentation) before posting here... :)

I use a U3-HV device, and DF5.79A trial version, your app was delivered with the LJ...

In my project, I have to monitor and log 10 datas, (5 temps, 2 pressures, 1 tachy (rpm), and two Flowmeters)

OK. Everything is fine, except for flows and tachy...

I planed to use 2 timers in RISINGEDGE32 mode, to mesure the period of my 2 flowmeters (to compute real time oil consumption) and one counter to monitor the tachy (display and log RPM)...

I've used your samples (copy and paste) and turned them in every order imaginable, but I still cannot obtain both working...

I restart a test prog, just to see if there wasn't a "border issue", starting with just a counter init -> ok.

I added a channel, named "Tachy", on the Chn# 0, as counter, tested it, it works fine...

Then, I added the 2 timers init (still in the init sequence), -> no problem...

I created then 2 channels "Flow_In" and "Flow out", on the 1 and 2 Ch#, as timer, and when I applied these changes, I had the error message :

D0050:00:0002 LabJack Device #0 error: Invalid channel number

As you can imagine, I tried other chan numbers, but I've always the same kind of messages...

I'm electronician and programmer, and I'm wondering if there isn't some bug somewhere (can't guess if it is inside the LJ or DaqFactory...)

I join my test prog, if you can have a look, it would be nice ! ;)

And I must say that I find your DaqFactory app very good, I've used other daq apps before, but never seen something that practicle and easy to use...

I would be happy to give you my contribution in your customer returns section, as I have finished these first experiments...

Thank you for all the good work you do in this forum !

Best regards,

Michel Lathuraz

France

Test_Timer_Counter.ctl

Link to comment
Share on other sites

Hi,

I've just found the "bug"...it is not really one though...:)

Let say it's a problem in the documentation...

Things aren't clear, about the channel numbering, with the offset of 4, on U3-HV...

The command LJ_chNUMBER_COUNTER_PIN_OFFSET let suppose that the Ch# must start 4 (for exemple)

After a while, I finally understood that Ch# must restart from 0, as soon as you declare it as a timer...

I thought Ch# would be incemented, say Timer0 ->Ch#0, Timer1 -> Ch#1, Counter0 ->Ch#2, and so forth...

I finally discovered that Counter0 goes on Ch#0 also...

The numbering for each channel depends on its kind, ie Analog, Timer, Counter...starting from zero each time...

Maybe you should be more precise around this in the next release of your documentation... ;)

So, the final result is :

Init sequence attached in my previous post is ok

Channels must be :

Timer0 -> Ch#0

Timer1 -> Ch#1

Counter0 -> Ch#0

Everything is OK now, :P, hope this will be usefull for other users in the futur....

Best regards,

Michel Lathuraz

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.