Counter Starts "double/triple" Counter After Some Time


BeeHay

Recommended Posts

Not sure how to explain this, baut after about 24hrs of "counting" with the LJ-U6 pro, my counts start going haywire?!

I am starting to think I need to "stream" my labjack instead of the basic connection I have now....

Here is my LJ startup code -


using("device.labjack.")
include("c:\program files (x86)\labjack\drivers\labjackud.h")
global ID = 1

ePut(ID, LJ_ioPIN_CONFIGURATION_RESET, 0, 0, 0)

//first counter on FIO4
AddRequest (ID, LJ_ioPUT_CONFIG, LJ_chTIMER_COUNTER_PIN_OFFSET, 4, 0, 0)

// enable counter 0 & 1 and reset them:
AddRequest(ID, LJ_ioPUT_COUNTER_ENABLE,0,1,0,0)
AddRequest(ID, LJ_ioPUT_COUNTER_ENABLE,1,1,0,0)
AddRequest(ID, LJ_ioPUT_COUNTER_RESET,0,0,0,0)
ErrorHandler(ID)

// set device resolution to index 12
ePut(ID, LJ_ioPUT_CONFIG, LJ_chAIN_RESOLUTION, 12, 0)
ErrorHandler(ID)

// set AIN0 range to +/-1.0 here!!
ePut(ID, LJ_ioPUT_AIN_RANGE, 0, LJ_rgBIP1V, 0)
ErrorHandler(ID)

// set AIN2 range to +/-1.0 here!!
ePut(ID, LJ_ioPUT_AIN_RANGE, 2, LJ_rgBIP1V, 0)
ErrorHandler(ID)

// set AIN4 range to +/-1.0 here!!
ePut(ID, LJ_ioPUT_AIN_RANGE, 4, LJ_rgBIP1V, 0)
ErrorHandler(ID)

// set AIN6 range to +/-10.0V here!!
ePut(ID, LJ_ioPUT_AIN_RANGE, 6, LJ_rgBIPP10V, 0)
ErrorHandler(ID)

// set internal ground channel range to +/-0.01V
ePut(ID, LJ_ioPUT_AIN_RANGE, 15, LJ_rgBIPP01V, 0)
ErrorHandler(ID)

GoOne(ID)
ErrorHandler(ID)

delay(0.5)
beginseq(callvars)
[/CODE]

As you can see, I DO NOT have my LJ streaming...

Would you recommend I setup the LJ to stream?

Do I actually [i][b]need [/b][/i]to stream just to keep counting for extended periods of time??

At first I thought our limit switch was "double counting" but I am sure that something is off and is prob a LJ -> DF issue!

Any thoughts from the GURU is always appreciated!

Thanks,

BeeHay

Link to comment
Share on other sites

Ok, first I have my counters setup pretty much exactly like the sample BasicCounter.ctl with a channel as a counter with an event that uses AddValue() to add to another test channel holding the cumulative strokes...

We utilize a hardware debounce circuit to "clean up" the signal from our momentary push button type limit switch...

I can watch in the counters table, the value that seems to be coming from my counter can range from 3 to 5 "strokes" per second and anywhere up to 10-12 a second...

This can make many things "haywire"... :)

SPM Starts reading incorrectly, volumes and velocities off, not to mention our lag starts coming up too fast...

Usually, my strokes can be MAX 3 per second (180SPM) and usually rides in the 1-2 per second range...

Albiet, I have only seen it happen a few times, but that is more times than needed to cause users to scratch thier heads...

I am not doing any processing on the counter, and have only field tested "resetting" the counter and is not an available option to the user...

After a FULL pc hard shutdown and restart (I think the LJ needs to "clear" something as just restarting DF will not fix it), things start to clear up...

Thanks for the reply and any more advice would be greatly helpful!

Link to comment
Share on other sites

You still haven't told me what "haywire" is. "Incorrectly" and "off" could mean lots of things, and those are calculated values anyway. Do you see the raw counts suddenly increment by 100's instead of 3-12, or do you see it jump around randomly, both up and down, or what?

Link to comment
Share on other sites

Sorry if I wasn't clear....

My RAW counts should be 3 a second MAX, but when I see the error, the RAW counts can range from 3 -12 per second...(12*60=720SPM)

This is what I mean by haywire...

And after they haywire begins, my calc'ed values are off/wrong but calcing correctly..(as it should but with an incorrect count number)...

Link to comment
Share on other sites

Ok, yea I think maybe the LJ is going "haywire" because I have a RPM panel meter that is behind the debounce circuit that displays the SPM correctly while DF is receiving an incorrect count...

Hmm, maybe I will swap out the in-question LJ with one from another unit to whittle down the issue!

Thanks again for brainstorming,

Brandon

Link to comment
Share on other sites

What if you close DF when you see the problem start and go to the test panel in LJControlPanel. You can enable the counter there and see if it is seeing the correct number of counts.

Another test would be if when you see the problem you remove your signal from the counter and instead connect a known signal. For example, if you have a timer available that could be configured as 16-bit PWM with TimerClockBase=12MHz/Div and TimerClockDivisor=183 to get a 1 Hz signal.

Link to comment
Share on other sites

Thanks for the reply LJ support!

I have both my timers available so I will give your second idea a run through...

I have had problems with the debounce circuit in the past (overheating I think), but it is strange how my RPM panel meter reads fine, but my LJ is receiving a strange input...

Also in the past my debouce chip was powered from an external psu, but I have now switched to using the +5V from the LJ...

Swapping the debouce on my next round is a quick and easy thing I should prob do! :)

Argh, another 1800 miles under my belt in 5 days!! :P

Link to comment
Share on other sites

Archived

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