Library Error code 1261 LJME_NO_COMMAND_BYTES_SENT | LabJack
 

Library Error code 1261 LJME_NO_COMMAND_BYTES_SENT

21 posts / 0 new
Last post
rohanl
rohanl's picture
Library Error code 1261 LJME_NO_COMMAND_BYTES_SENT

Hello,

I am getting this error at the following line in my python code. I am checking the buffer status and writing to the buffer in a while loop.

buffer_status = ljm.eReadName(handle, "STREAM_OUT0_BUFFER_STATUS")

I get an exception for no command bytes sent.

Can you please let me know the possible causes of this exception?

Thanks,

Rohan 

LabJack Support
labjack support's picture
Hello,

Hello,

First, please upgrade to the latest LJM (https://labjack.com/support/software/installers/ljm) and firmware (using Kipling).

1. Is the STATUS LED doing anything when this happens?

2. What is the connection type?

3. Could you post your code?

4. Does the error happen for every read to STREAM_OUT0_BUFFER_STATUS, or just some?

5. If you except this error, does a read to "SERIAL_NUMBER" or anything work?

rohanl
rohanl's picture
Hello and thanks for the

Hello and thanks for the reply,

Here is my comment on your questions. (The T7 device is being used to generate a waveform using the DAC and buffer).

1. This line of code is in a while loop (python), so the STATUS LED just blinks continuously.

2. The connection type is USB.

3. I shall try sharing the code, for now I cannot.

4. I am not sure if the error happens at every read, since after the error, the exception is caught and it halts the code there.

5. I haven't tried this, will check it out.

Please let me know.

Thanks,

Rohan L

LabJack Support
labjack support's picture
For #4, try printing output

For #4, try printing output after each ljm.eReadName(handle, "STREAM_OUT0_BUFFER_STATUS"). If you see that output a number of times, that means eReadName was successful sometimes, in which case it may be worth trying to investigate if something different happened immediately before the exception occurs.

6. You could also try running in_stream_with_non_looping_out_stream.py from the LJM Python examples: https://labjack.com/support/software/examples/ljm/python

in_stream_with_non_looping_out_stream.py reads STREAM_OUT0_BUFFER_STATUS and STREAM_OUT1_BUFFER_STATUS as part of its main loop without throwing an exception.

rohanl
rohanl's picture
Hello,

Hello,

I shall try printing the output after ljm.eReadName(handle, "STREAM_OUT0_BUFFER_STATUS")

However, I want to share the piece of  python code used for streaming. The details of streaming are: Output-DAC0, stream channel - stream_out0. I am sharing a file with two functions setupStream and startStream.

The function setupStream is called before the streaming begins. Function startStream begins the streaming. The exception is occurring at line no. 72 in the attachment.

Please let me know if I have set up the functions correctly (i.e. the order of commands to setup and start streaming) and are they being used appropriately, and that if there is any command used incorrectly that might be causing the exception to occur.

Thanks,

Rohan L

File Attachment: 
rohanl
rohanl's picture
Hello,

Hello,

I submitted my code for review a week ago for error code 1261.

Please let me know if the code is in any way responsible for the error.

Thanks,

Rohan L

LabJack Support
labjack support's picture
I've found a bug in the

I've found a bug in the stream-out code of LJM in version 1.16.1, which I will fix. I will update this thread when that fix is released.

rohanl
rohanl's picture
Sure. Thanks. Is this update

Sure. Thanks. Is this update for LJM stream-out code for python. Just to confirm.

-Rohan L

LabJack Support
labjack support's picture
This update will affect all

This update will affect all LJM wrappers, including Python LJM. I expect it to be released on Monday.

rohanl
rohanl's picture
Hello Support team,

Hello Support team,

The new release with the bug fix for stream out code was to be released by Monday. I see some beta version release with release date of May and September 2017.

Can you please update me with the new release? Hopefully that will resolve my problem with error code 1261.

Thanks,

Rohan L

LabJack Support
labjack support's picture
The new release is release as

The new release is release as beta for Windows, Mac, and Linux (32-bit and 64-bit):

https://labjack.com/support/software/installers/ljm

Please let us know how it goes.

rohanl
rohanl's picture
Hello,

Hello,

I used the new beta release dated 2017-10-17. The DAC was generating waveforms using LJM streamout for 4 days. 

On the fifth day, I am seeing the same error again(as an exception) - Error code 1261.

Please let me know if I you can review my stream-out code to confirm if the python code is causing this error.

Thanks.

LabJack Support
labjack support's picture
It's hard to say what's

It's hard to say what's causing the issue. I may have a clue as to what's going on. I will investigate and I will update this thread.

LabJack Support
labjack support's picture
In the meantime, make sure

In the meantime, make sure the device and computer have a constant power supply and that the computer is configured to never sleep.

LabJack Support
labjack support's picture
We've released a new LJM

We've released a new LJM installer for Windows with LJM 1.1603 that fixes a segmentation fault issue for the case when a device is disconnected while stream out is running (and also when stream in is not running). It's currently available as a beta installer here: https://labjack.com/support/software/installers/ljm

It may not fix the issue for you, but it should prevent LJM from being unrecoverable. Also, it will probably change the error that happens from 1261 to 1239 (LJME_RECONNECT_FAILED).

One possibility is that the issue is being caused by LJM losing connectivity to the device because of a connection- or power-related issue. To check for this or prevent this:

1. Make sure the computer is powered consistently

2. Try removing all connections from the device, other than USB

3. Try a different USB port and a different USB cable

4. Try unplugging unnecessary USB devices from the computer

Please let us know how it goes.

rohanl
rohanl's picture
Thanks a lot. I have begun

Thanks a lot. I have begun using the new beta release of the installer.

I shall let you know if the error occurs again.

-rohanl

rohanl
rohanl's picture
Hello,

Hello,

I have two labjack devices, one each of T7 and T7 Pro. 

I ran the code to generate waveforms using the DAC0 output with exact same versions of LJM(latest beta dated 24th Oct), Python27 and Device firmware.

It is found that this error (1261) is taking place only with the T7 device and not occurring at all with the T7 Pro.

Please let me know your inputs on this.

And also please let me know if this is a hardware problem with one device, can I ship the device to Labjack team to have it checked and repaired.

Thanks,

rohanl

LabJack Support
labjack support's picture
A couple of things:

A couple of things:

  1. What scan rate is used?
  2. How long does the program run before giving the error?
  3. Is there any consistency to how long it runs before giving the error?
rohanl
rohanl's picture
Sure. Here are the details:

Sure. Here are the details:

1. Scan rate used is 200(samples/second)

2. The program typically runs for 5 days, but the error occurs at different times ranging from an hour to 2(or even 3 days) days from the start of run.

3. There is no consistency. It may give the error any time between an hour to three days after the start of run.

Note: The error occurs only with T7 device, the T7 Pro has completed the fourth day today but there is no error.

Hope this helps.

Thanks,

rohanl

LabJack Support
labjack support's picture
We are running some tests

We are running some tests here at LabJack. No errors so far. 

Some questions:

  1. Are both the T7 and T7-pro connected to the same computer?

Some tests:

  1. Try switching the T7 to Ethernet. Does the failure still occur?
  2. Swap the USB connections so that the cable currently connected to the T7-Pro is now connected to the T7. Do not change the connections at the computer side. Does the failure still occur?
  3. Move the T7 to a separate USB hub. Does the failure still occur?
  4. If you disconnect everything from the T7 except the USB cord, does the issue still occur?
  5. Did you try using different USB ports (mentioned above)?
rohanl
rohanl's picture
Thanks. Sure. Here are the

Thanks. Sure. Here are the answers to your questions.

1. Yes, the T7 and T7-Pro are connected to the same computer with the same USB cable.

Tests:

Some disclosures: The output of labjack DAC0 is applied to our system(This has a high impedance input and current drawn from DAC0 output is negligible, so no loading of the device) and also given to an oscilloscope(to view the waveform).

1. I cannot switch the T7 to ethernet, the python application is designed to use the USB connection.

2. I shall try this once the waveform generation with T7 Pro(currently running and would complete on 4th Nov) is finished.

3. I shall use the same USB cable currently being used with the T7 Pro, and connect the T7 to it and try running it by connecting to the PC through a USB hub.

4. With respect to the disclosure above, I shall test this too, without connecting it to our test system, and to the oscilloscope.

5. I tried connecting the T7 to all the three USB ports on the PC, and the issue occurs.

PS: The T7 Pro is currently running fine without this issue for four consecutive days out of the five day run, whereas the T7 would fail with this 1261 issue after an average time of two days.

I shall let you know once the tests are done.

Thanks,

rohanl