U3 - Trouble Reading Channels First Few Times


gkimsey

Recommended Posts

I'm having trouble in my project when reading some channels in a sequence at load time.

The Channels are set up, but none of the A to D channels are set to read automatically (I just want to read at specific times).

Basically when my init sequence runs I get an error such as "Request made on pin not properly configured for analog/digital". The sequence contains about half a dozen Read() commands on various inputs and an assortment of digital output settings.

Now, since the initialization sequence failed I'll restart it manually, and get similar results but it gets a few commands further before giving an error. I'll do it again, and everything seems to go fine but one of my digital outputs is in the wrong state (always the same one). Then, running it a 4th or 5th time, everything goes fine.

This only happens when the LabJack hasn't been used since being plugged in (i.e. I can restart the whole project after it works and it'll work the first time).

The biggest problem I have is that I can't even catch all of these issues with OnAlert (to fully automate the retry process). On the last time through an output is in the wrong state so I get no alert.

Why does it take so many attempts to get this working?

I have a debug/testing project I set up with the same Channel list as my main project. This other one DOES automatically poll certain channels. When I plug in the LabJack while it's running I get the similar "Request made on pin not properly configured for analog/digital" errors for several reads before they go away.

The issue seems to be based on the number of attempted reads rather than real time. I.e. in the first example if I wait a full minute between retries it still takes 4 or 5 times through my init sequence.

If the failed reads aren't something I can fix altogether, I need some way to programmatically get to the point where all my I/Os operate as expected, and to know for sure that I'm there.

Link to comment
Share on other sites

With channels, DAQFactory automatically tries to adjust the pin types. But if you are doing things manually, you probably need to setup the pins manually as well. You'll need to use the appropriate pin functions from the UD to do that, and I refer you to the LabJack docs for that. Scripting it in DAQFactory is very similar to the psuedo-code in the LabJack docs. See the DAQFactory Labjack App guide for examples. I don't think there is one explicitly for pin function setting, but you'll see the syntax.

Also, double check that you aren't doing two different functions on the same pin, and thus switching the type back and forth.

As for error checking, if you use read() or readGroup() you don't get direct error handling. If you need error handling you have to manually read the inputs using UD functions (see 9.1 in the DF-LJ App guide).

Link to comment
Share on other sites

  • 3 years later...

Hi this is as close as I could get.

I have 2 copies of a program using a U3-HV to read 0-5V signal from Mass Flow Controllers (MFC).

The first sets Test Channels to Update the LJ_TickDACs the second removed the test channels and sets them to Variables.

Loading the first program doing nothing it reads the channels close to 0V. Loading the second program reads about 32000V.

Close one, open the other always the same readings populating the tables and about the same sort of Jitter (same amplitude) on the channel graphs.

Why would I gets such an unreasonable response. I assume it is some sort of Binary number, but why?

Cheers Jim

PGM ReadError.docx

Link to comment
Share on other sites

Archived

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