streaming problems


tania

Recommended Posts

i wanted to do my first streaming...and attached my labjack ue9 via usb....

i am using daqfactory express....

when i want to make a sequence like below

using("device.labjack.")

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

i get the following error...

c1000 channel or function not found startup line 1-uncaught error in sequence startup

where am i going wring?

Link to comment
Share on other sites

Probably. DAQFactory 5.15 is nearly 2 years old, so I am unsure how it will respond if you have updated any of the LabJack software. I recommend upgrading to the latest version. There is no charge.

thank you very much..this forum is a life saver!

Link to comment
Share on other sites

The configuration window was eliminated because it was confusing people on when the config occurred and it didn't know what to do on a disconnect. Release 5.75 includes a Using DAQFactory with the LabJack guide that shows how to do the config with very simple script.

Link to comment
Share on other sites

ooh...hmm....but it was kinda easy....i mean compared to the typing of scripts and ending with typo errors...anyways thnkx...

i asked cos i thot i would hv missed it somewhere else...answays thnk you once again for clarifying the doubt!!

Link to comment
Share on other sites

Yes, it was easy, but scripting gives you the most flexibility, and the LabJacks are so flexible that we found it limiting and thought it better that users learn scripting so they can take full advantage of the power of the LabJack. For this reason we created the new Using DAQFactory with the LabJack guide, which walks you through doing most things with the LabJack and DAQFactory.

Link to comment
Share on other sites

speaking on Resolution,

i need a high speed acquisition of 10 ms...and a resolution of 16bit but i get the following error

c1038 timing lag,data acquisition stalled resetting timing 0.010;offset 0.000

is it because of the 16 bit resolution?also i wanted to know this part "resetting timming" -does it mean that we loose the data point in the signal while logging?or the prev data point is repeated,,,

in my logging set i see that my time(in ms) gets repeated at intervals but the data value is different....this happens when i change my resolution to 14 bit...

my channel range is +-5volts

thnkx

Link to comment
Share on other sites

before hand to let u know that ....i do the transmissions wireless....

i have noticed that when i start the experimants (first one of the day) ... and log sets...i do get some errors..maybe in time as i mentioned before....but as time passes...all things go fine..

is there a starting delay...i mean...for the system to get booted and transmission to begin...should there be a waiting period so that the system is ready for transmission...

or am i wrong....there is no such thing like tht?

keeping in mind these things..that

1) my pc i am using is kinda slow

2)i have a file with settings stored...so just need to click it to start the experiment

3)the labjack and the wirless transmitter is connected with the additional power supply of my circuit so tht means when i switch the power supply on....then only the labjck n wireless tx is on....

does this make sense.. ? being a begineer definately can stir up weird questions right :)

just that it would be nice to get guidance from an expert incase i go wrong sumwhere...

Link to comment
Share on other sites

100 hz in software polled acquisition is pretty much the limit on a single core processor, and even then is pushing it, as windows needs to have some processor time to draw the screen, move the mouse, etc. Usually I say 50hz is the safe limit without careful system design. Above that, you should move to hardware streaming. Since your computer is slow, this is almost certainly the issue.

The Timing Lag error just means that the timing loops couldn't keep up with acquisition rate you specified. So, you say you want 10ms interval, but its actually taking 11ms, so the timing loop starts to get behind. Since the loops are self correcting, if the delay is temporary, the loop will catch up once it gets more processor power. However, if it gets more than, I believe, 10 seconds behind, it will reset the loop and start over. This doesn't mean you missed data, it just means it couldn't keep up with the interval you specified. I suppose that does mean you missed data, but not that you would have a big hole in your data. You can see this by looking at the time tags of your data. If the PC was able to keep up, the times would be x.000, x.010, x.020, etc (perhaps +/- 0.001). If it can't, the times might be more like x.000, x.015, x.030, etc.

As for the resolution, the default is determined by hardware. I believe there is even a function you can call to set the power on defaults of the LabJack, but you'd have to refer to the hardware manual for that. I believe it is LJ_ioSET_DEFAULTS and only available on the U3. To retrieve the resolution, you would have to do LJ_chGET_CONFIG with LJ_chAIN_RESOLUTION. Its very similar to setting the resolution. You would not want to put this in the watch or page directly as this will cause it to be called every time they refresh. Put it in a sequence instead and store the result in a variable to display. I do not know if this function returns the actual resolution of the device, or what the UD thinks the resolution is.

Link to comment
Share on other sites

well..yes i hv noticed the time lags...also when i check the data...

for 10 ms we hv 100 datapoints between two sucessive peaks....

for 16 bit there is only around 80-85 datapoints at max...

but for 14 bit i am getting all the 100 data points...

for me every ms matters...

also i was reading thru the doc of labjack with daqfactory...it also said we can increase the acquisition rate even more...by using scan rate and

if my d#=1;scanrate=0.005 channel 2:

eGet(1,LJ_ioSTART_STREAM, 2, 0.005, 0)....am i right...?did i interpret right?

Link to comment
Share on other sites

Sorry, I don't know the exact specs on speed for the LabJack at different resolutions, but apparently it takes more than 10ms to read 16bit. Not sure how many channels you have either. Also remember that there is some overhead in DAQFactory as well, so times quoted in the LabJack specs will not be reached when soft-polling because of this overhead. To reach maximum speed you'd have to create a tight loop in C.

But, really at high rates you should consider streaming as you mentioned. It is not quite as simple as that command you mentioned. That command is used, but you need others to set the channel. I recommend reading through the streaming section and then trying the sample indicated at the end of that section. It should stream for you immediately and you hopefully can see exactly how it is done. It is pretty straight forward.

Link to comment
Share on other sites

as i wanted high streaming acquisiton....i wrote the below sequences...but sumtg seems to go wring...

i have two channels...at 0 and 13 chn# and d#=1, and usb first found...timming 0

sequence 1:start

using("device.LabJack.")

include("C:\Programme\LabJack\Drivers\LabJackUD.h")

/*setup stream

//set scan rate

addrequest(1,lj_ioput_config,lj_chstream_scan_frequency,1000,0,0)

//set up channels for streaming.....channel 1 and channel 2

addrequest(1,lj_ioclear_stream_channels,0,0,0,0)

addrequest(1,lj_ioadd_stream_channel,0,0,0,0)

addrequest(1,lj_ioadd_stream_channel,13,0,0,0)

goone(1)

//start the stream

global scanrate=0

eget(1,lj_iostart_stream,0,0,0,0) .........???(no idea here)...i want a sampling of 200 hz

//setting the resolution to 16 bit

//device.LabJack.AddRequest(1,lj_ioput_config,lj_chain_resolution,16,0,0)

// setting the channels to the bipolar range +-5v

device.LabJack.addrequest(1,lj_ioput_ain_range,0,lj_rgbip5v,0,0)

device.LabJack.addrequest(1,lj_ioput_ain_range,13,lj_rgbip5v,0,0)

device.LabJack.goone(1)

sequence 2:end:

eput(1,lj_iostop_stream,0,0,0)

i wanted my outputs bipolar...but when i add these scripts with the scanrate sequence i see no output....

am i missign sumtg here?

Link to comment
Share on other sites

ok i got the signal..the way i wanted..

do we need a buffer while doin high acquisition?

is this syntax correct,,,,what is the basic difference between scanrate and scan frequency...

i want a sampling of 200 hz..so some of my scripting will be like below...

addrequest(1,lj_ioput_config,lj_chstream_scan_frequency,200,0,0)

[2]...eget(1,lj_iostart_stream,0,200,0)

for eget the syntax is (d#,iotype,channel,@value,x1)

does @value refer to pointer?have i assumed it write in [2] ?

thnk u

Link to comment
Share on other sites

Due to the nature of the internal clock and clock divisor, not all scan rates are available. So, if you specify 1000hz, you might get 998hz. The internal driver does its best to match the desired rate. The actual scan rate used is what is returned in StartStream.

Yes, it is a pointer, so you'd do:

private actualrate
eGet(1, LJ_ioSTART_STREAM, 0, @actualrate, 0)

Link to comment
Share on other sites

Due to the nature of the internal clock and clock divisor, not all scan rates are available. So, if you specify 1000hz, you might get 998hz. The internal driver does its best to match the desired rate. The actual scan rate used is what is returned in StartStream.

Yes, it is a pointer, so you'd do:

private actualrate
eGet(1, LJ_ioSTART_STREAM, 0, @actualrate, 0)

great thnkx!!

Link to comment
Share on other sites

To reiterate: "Scan Rate" and "Scan Frequency" are just different terms for the same thing. Lets just call it "Scan Frequency".

You specify the desired scan frequency in your configuration code using IOType LJ_ioPUT_CONFIG with special channel LJ_chSTREAM_SCAN_FREQUENCY, before you start the stream.

You read back the actual scan frequency from the "Value" returned by the start stream command.

Link to comment
Share on other sites

Archived

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