Streaming rate


Recommended Posts

I am using UE9 to stream data from one analog and 5 digital ports using USB 2.0. Somehow, the acquisition rate is not same as I expect. I am sure that the computer is not an issue. The scanning frequency rate meets dead end at 3000. Here is the code:

Device.LabJack.AddRequest(Var.d_number,"LJ_ioPUT_CONFIG","LJ_chSTREAM_SCAN_FREQUENCY",10000,0,0) // Set Scan Rate: 10000 samples/sec

Device.LabJack.AddRequest(Var.d_number,"LJ_ioPUT_CONFIG","LJ_chSTREAM_BUFFER_SIZE",100000,0,0) //Give the UD driver a 5 second buffer (scanRate * 2 channels * 5 seconds)

Device.LabJack.AddRequest(Var.d_number,"LJ_chSTREAM_WAIT_MODE","LJ_swSLEEP", 0, 0) //Configure reads to wait and retrieve the desired amount of data.

Device.LabJack.AddRequest(Var.d_number,"LJ_ioCLEAR_STREAM_CHANNELS",0,0,0,0)

Device.LabJack.AddRequest(Var.d_number,"LJ_ioADD_STREAM_CHANNEL",0,0,0,0) // Add four streaming channels

Device.LabJack.AddRequest(Var.d_number,"LJ_ioGET_DIGITAL_PORT_DIR",193,0,0,0) // Set FIO-port to input

Device.LabJack.AddRequest(Var.d_number,"LJ_ioADD_STREAM_CHANNEL",193,0,0,0) // Add a FIO to streaming channel

Device.LabJack.AddRequest(Var.d_number,"LJ_ioSTART_STREAM",0,0,0,0) // Start Stream Request

Device.LabJack.GoOne(Var.d_number)

Any suggestions?

Link to comment
Share on other sites

What exactly is the symptom you are seeing. Does it stream at all with those commands?

Try setting the analog input resolution to 12.

Note that your request using LJ_ioGET_DIGITAL_PORT_DIR with Channel=193 is not valid. Even if you had a valid channel number, that command does not configure the direction of lines, but rather just reads the direction of lines. What you want to do is use LJ_ioGET_DIGITAL_PORT where Channel is the starting bit numer and x1 is the number of bits to read. So if you want to set all digital lines to input, use Channel=0 and x1=23.

Link to comment
Share on other sites

Archived

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