Good evening,
While trying to control a laser on windows HP laptop, the A01 port that we are using to set the laser bandwidth drops to 0 (which shuts off the laser and ruins the crystal grow process we are using it for). Upon running the VS code, we are able to control the bandwidth with VS buttons controls and it reads/ responds to the voltage it is set to. Sometimes it drops to 0 when we are using the buttons, and sometimes it drops to 0 randomly while the controls are being automated. The error has no evidently repeatable condition, and there are no unhandled error messages being thrown from labjack or VS. Any thoughts/ starting point we can try?
thanks so much!
Here are some possibilities I can think of:
1. AO1 is not dropping to 0, but rather your laser shuts off for some other reason. Can you use a scope or similar to confirm?
2. The U12 is rebooting. Do you see the LED make the boot-up pattern or hear Windows make the USB disconnect/reconnect chime?
3. Software issue? Close all software. In fact, reboot your computer so you are sure nothing else is running. Run LJlogger and use that to manually control AO1 and see if you see the same problem.
Thanks for the response,
1. AO1 is not dropping to 0, but rather your laser shuts off for some other reason. Can you use a scope or similar to confirm?
--> The reading on the labjack goes to 0 when the laser isn't connected as well. Yes, we measured the actual voltage and it goes to zero
2. The U12 is rebooting. Do you see the LED make the boot-up pattern or hear Windows make the USB disconnect/reconnect chime?
--> We have not heard the windows disconnect/reconnect chime when this issue happens, and we may have seen the labjack blink once very quickly but never in a sequence like when it is initialized
3. Software issue? Close all software. In fact, reboot your computer so you are sure nothing else is running. Run LJlogger and use that to manually control AO1 and see if you see the same problem.
--> We have been rebooting the computer each time we run the program on a field test, this is not an ideal case and it does not prevent the problem from happening. What is LJLogger/how do we run it manually? Is there a resource page we can look through to learn how to use it? Are there any pre-programmed status messages we can extract/call from labjack through the program?
Thank you for your help!
The fact that it happens with nothing connected (except USB and a voltmeter/scope to AO1 & GND) is great info. That should have been an item #4 I listed.
That makes me think of a test #5. Set AO1 to some value of interest, and then close all software. AO1 should stay at the last commanded value until something tells it to go to some new value, or the U12 reboots.
Even though you don't notice that the device is rebooting, I suggest you go ahead and force disable the watchdog just in case. Securely clamp a jumper wire from IO0 to STB, then power cycle the U12, the remove the jumper, and then power cycle again:
https://labjack.com/support/datasheets/u12/programming-reference/watchdog
LJlogger.exe is part of the normal Windows installation. It has a control you can use to set AO1:
https://labjack.com/support/datasheets/u12/example-applications/ljlogger
Thanks so much for the resource pages,
after looking back through the user manual as well, we realized we don't have any diodes or resistors in our system between A01 and ground. Do you think the issue could have anything to do with this? Can we connect AI1 directly to AO1 without a resistor? Or, how do you connect AI1 to AO1 so that we can monitor the actual voltage out of AO1?
Yes you can jumper AO1 directly to AI1. That sounds like a good idea for tests 3 and 5. Have no other connections except USB and that single securely clamped jumper.
In the past, I have verified that the voltage coming out of the AO channels are correct with a high impedence multi-meter. I've found them to be quite accurate from 0 to 5 V DC. But I never felt the need to constantly monitor it like I think you are trying to do. I've never had any AO channel suddenly drop to 0 for no reason. If it did, it's something in my coding that's wrong (like I don't define it at some point during a loop, so since it's un-defined, it momentarily drops to zero, until it gets the command again). Hope that helps.
These things are really meant to be troubleshooting steps that help direct us to solutions, not solutions on their own. We need to isolate the problem and narrow down the cause. Any feedback you provide on these items help with that.
3. Do you see the same problem happen with LJlogger.
5. Does the problem happen with no software connected.
To minimize confusion, we want as simple a system as possible, so that is why you do these with just USB and a single jumper wire or DMM.
These things are really meant to be troubleshooting steps that help direct us to solutions, not solutions on their own. We need to isolate the problem and narrow down the cause. Any feedback you provide on these items help with that.
3. Do you see the same problem happen with LJlogger.
--> a) I did not see the issue happen with LJLogger (no software connected) while i had the IO0 to STB shorted and AI0 connected directly to AO0.
--> b) I also did not see the issue happen with LJLogger (no software connected) when we removed the IO0 to STB short.
--> c) I did not see the issue happen with the software connected and only the AI and AO0 terminals connected.
5. Does the problem happen with no software connected.
(See above)
To minimize confusion, we want as simple a system as possible, so that is why you do these with just USB and a single jumper wire or DMM.
General troubleshooting tips:
- Only run 1 program at a time.
- Remove all extra connections.
So it sounds like if you just have USB and a single jumper wire from AO1 to AI0, and then run LJlogger, you do not see any problem with AO1.
If the only change you make is to add wires to connect AO1 to your laser, do you then see the problem in LJlogger? I'm guessing the way you connect the laser is to use 2 wires to connect GND & AO1 from the U12 to the laser.
Hi, Im looking for some direction.
I would like to learn Python coding to create an exicutable program.
This program will read data from a txt file (created by other sensors and software) then depending on that txt file data, operates the Labjack which controlles electric motors.
Ive done html, java and machine code (C64 days :/ ) and I want to learn Python coding for this application. Ive watched youtubes on Python creating databases, websites but this isnt the aspects I need to learn.
Where do I start?
I appreciate any help on getting started.
Update: After running LJLogger and the program independently, LJLogger had no detectable problems, but the program would produce the issue. I found out that we have a Visual Studio memory leak that was causing our program (that labjack is integrated into) to slow down to less than 3Hz, and it is when we saw it slow down below 3Hz that the issue appeared more consistently. Thank you for your help, definitely helped me understand a direction to look in for troubleshooting!
Hi Quake,
For general getting started with Python, look here:
https://www.python.org/about/gettingstarted/
For documentation on reading from a file, look here:
https://docs.python.org/3/tutorial/inputoutput.html#reading-and-writing-...
As for motors, we have an app note for stepper motors:
https://labjack.com/support/app-notes/digital-IO/stepper-motor-controller
If that doesn't help regarding your motor, can you provide more details on what motor and LabJack you are using? This forum topic is related to U12 and C#, and didn't involve motors or Python.