11-04-2011 02:21 PM
Hello again,
So I recently had my voltage vs. distance problem solved, but now I need to move the program to two channels (meaning two motors and two load cells). The program is designed to read the force (voltage) measured on the load cell vs. the distance of the linear actuator moved over time.
I'm sure I'll get flak for this, but due to my limited knowledge, I copied and pasted the single channel program in order to make a dual channel program.
The error -50103 is coming up because it says that the specified channel is reserved for the load cell even though I changed it (and all other channels) to their respective channels for a second "system". How is this possible? Maybe I'm just not understanding what's being reserved, but I thought since none of the ports or lines are overlapping, it shouldn't give me this error. I'll attach the VI below, as well as the single channel VI for reference.
Let me know if there is any additional information that you guys need.
Thank you,
James
11-04-2011 02:36 PM
Do a search for the forums for Error 50103.
It is not the channel overlapping. It is that you are trying to use the DAQ timing clock that is already being used by another task.
PS: Don't create tasks and clear tasks on every iteration of your while loops. Create the task before the loop, Read or Write in the loop, Clear the task after the loop.
11-04-2011 02:43 PM
Thanks Ravens Fan,
I got an understanding of what the error means. To quote you after a quick search:
"By any chance are you acquiring your two channels of data by way of two different DAQ tasks? If so, don't. You can only have one DAQ task per DAQ device. The shared resource is the timing engine for the DAQ device."
I believe this is what I'm running into. I guess my issue is that is it possible to be reading from two different load cells leading to the same card? Where is this DAQ timing clock, and if I do what you suggest in the PS, does that allow it so that the timing clock can be used for both channels?
Thanks again!
James
11-04-2011 03:20 PM
The timing clock is in the card and gets called into use by the DAQ assistants where you specify a clock rate.
You can add more than one channel to your DAQ task. Then when it acquires the data, you can split it into the individual data channels.
One DAQ assistant with two channels, all in one while loop.
11-11-2011 12:11 PM
Alright, here is my updated code with the corrections made.
My next question is that I also need to duplicate the code that controls the motor itself. So how should I go about connecting another counter (Dev1/ctr0) to the whole program so that I can control the second motor independently from the first.
Thanks,
James
11-11-2011 02:23 PM
If the code is truly duplicated and you are using a different DAQ device, you could just copy the code and run it in parallel to your existing code. You could make your code into a reentrant subVI and run two copies of that subVI.
But if the second motor is using different channels on the same device as the second motor, you are going to need to rearchitect your system. You would need to have a single loop that handles the acquisition for both motors, and that passes data back and forth with the loops (such as by using queues) that are handling the control logic for each motor.
05-28-2013 10:09 PM
Hello,I'm trying to take two analog outputs from a NI 9264. how do i clear the loop?
i send my vi, the first output must be in a01 and the second in a02
05-28-2013 11:11 PM
Why did you add your question to an old unrelated message thread rather than starting a new one?
I don't understand what you mean by "clear the loop".
Please start a new message threads and add more details about what you are trying to do.
05-29-2013 06:43 PM
i get the same error -50103
and it's all becouse i want to do two tasks at the same time.
my mistake, I meant clear the task in the loop
05-29-2013 06:44 PM
after the loop*