Counter issues with LabJack U3-HV


MoparMuscl

Recommended Posts

I have some issues that I can't figure out. Wrote my scripts with one timer and one counter enabled. I have a pin offset of of 6. I had everything working and recording data yesterday. My computer locked up without me being able to save, and I haven't been able to get it working ever since.

When I enter the LJ test panel I can get FIO7 to read counts. I do have FIO6-7 configured to digital in the LJ config panel. The counter is configured as counter1.

Also, I can't even get the basiccounter.ctl example to record/read counts. I am getting a 'Channel Error Timing = 1.00, Offset = 0.00: C1086 One of the parameters was empty: Line 2' error on the basic counter example as well as my file I created (different line #). I was getting that error yesterday when it was working, so I'm not sure what to make of that. Under the Table tab for my RawCounts it always reads 0.

Right now I'm clueless.

Here is the scripts in my startup sequences:

// standard labjack commands:

using("device.labjack.")

include("c:\program files\labjack\drivers\labjackud.h")

// we'll use a variable for the ID so we only have to change it here in

// script. Just remember to change the D# of your channels too. These

// cannot take a variable, so you'll have to do it manually.

global ID = 0

// this command resets the LabJack to its original configuration. A good

// thing to do since we make a lot of assumptions about its configuration

// everywhere else.

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

//Set the timer/counter pin offset to 6, which will put the timer0 on FIO6 and counter1 on FI07:

AddRequest (ID, LJ_ioPUT_CONFIG, LJ_chTIMER_COUNTER_PIN_OFFSET, 6, 0, 0)

//Enable counter1 (FIO7)

AddRequest(ID, LJ_ioPUT_COUNTER_ENABLE,1,1,0,0)

AddRequest(ID, LJ_ioPUT_COUNTER_RESET,1,0,0,0)

GoOne(ID)

ErrorHandler(ID)

//Enable timer0 (FIO6)

AddRequest(ID, LJ_ioPUT_CONFIG, LJ_chNUMBER_TIMERS_ENABLED, 1, 0, 0)

GoOne(ID)

ErrorHandler(ID)

Here are my scripts in my 'RawCounts' channel under events:

// calc counts in interval

Counts.AddValue(RawCounts[0] - RawCounts[1])

// calc counts per second in interval

Hertz.AddValue((RawCounts[0] - RawCounts[1]) / (RawCounts.Time[0] - RawCounts.Time[1]))<--This is line #5 that I think the error code is referencing

Right now I'm clueless.

Link to comment
Share on other sites

Okay, you are right. I only get the error once, so that makes sence. RawCounts is updating. If I go into Table I can see that every 1 second (how I currently have it set), it updates. BUT, it never displayes a value. It is always 0 no matter what input I have. That is where I am just lost. Any clue why I could get my logging or the BasicCounter.ctl to read counts?

Link to comment
Share on other sites

If raw counts is always reading 0 then you either have a wiring problem, you are wired to the wrong pin, or your signal is not big enough to trigger the count. You can sometimes get a count by just putting a wire in the terminal and touching it, or alternately touch it between GND and Vc. I hate to send you back to the LabJack guys, but they'd have better ideas for the hardware side. DAQFactory only does what the device tells it.

Link to comment
Share on other sites

Archived

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