Counter Enable


SolarBoat

Recommended Posts

I am new to using DAQFactory, and am having a lot of trouble getting my counter to enable. I am using the following code:

using("device.labjack.")

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

gloabal ID = 0

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

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

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

AddRequest(ID, LJ_ioPUT__CONFIGURATION_RESET,0,0,0)

GoOne(ID)

ErrorHandler(ID)

It's giving me two errors. One says, "request made on pin not properly configured for analog/digital", and the other says, "the ID must be a scaler value, not an array or string: Count line 6". I am a student working on a project, and would appreciate any help that anyone could offer. Thanks.

Link to comment
Share on other sites

1) "request made": if it only does this once at boot its because the Timing loop for the channel ran before you properly configured the pin. Just ignore it. If it repeats than you are trying to read the counter without actually configuring it. Analogs and digital I/O typically auto-configures.

2) the ID must be a scalar". Is the script you posted in the Count sequence? Did you cut / paste that script. If so, you have a typo in line 4. Its "global" not "gloabal". Computers are very particular about this sort of thing, and for good reason. You really don't want the computer making assumptions. There are plenty of software (Microsoft software in particular) that does this, and it doesn't always make the right assumption. In a word processor its ok, but in Data Acquisition or Process control, it really needs to be right 100% of the time, so DF doesn't make assumptions.

3) You have another typo in the second PUT_CONFIGURATION_RESET. It appears you have two underscores.

4) More importantly, you don't even need that line. In fact, that line is simply resetting the LabJack back to defaults and eliminating all the work you just did.

Link to comment
Share on other sites

Archived

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