05-12-2009 08:14 AM
I am working on a VI that should allow me to input coordinates for 2 voltage actuated piezos. The VI converts the location into a voltage and outputs the corresponding voltage. The basic program works well however, i i have been modifying it to test how the piezos will react to a ramp function voltage in order to assess its response. This is where i keep on running into trouble since i cannot seem to write to the 2 channels. Errors 201105 and 50103 keep on coming up.
I have attached copies of the vi. Coordinate Writing is the original which works fine and V2 is the modified version that im having trouble with.
I would appreciate any help you can give on this.
Thanks!
05-12-2009 09:44 AM
Neither VI makes much sense. The one with AO function will only execute once and then stop. DO NOT USE the run continuous button.
The second VI has the same problem and more. You have a DAQ Assistant and a DAQmx Read. You cannot have both. You have to combine all channels into a single task. I also don't understand the purpose of the two while loops in the second VI. Even if you fix the VI and put a while loop around the code, there would be no acquisition done until you click the stop button so the comment 'Take points every Delay ms until Stop' is very wrong.
05-12-2009 09:56 AM
Ok. The first VI works the way i want it to. My reasoning for the second VI is as follows:
1. I need the DAQ assistant to read the initial voltages before it ramps up to the newly specified value
2. Which run continuous button are you referring to?
3. How do i combine the channels into one task?
4. The 2 for loops are used to create a ramp function: It takes the initial voltage from the DAQ assistant, the final value from the cluster and ramps up the initial voltage value to this new value. It is the output voltage of the 2 for loops that i want to write to the device (NI 9263)
As usual, my reasoning makes sense to me (and probably only me) so how would you approach the problem differently?
05-12-2009 10:16 AM
I think I misunderstood. You only want to do a single acquisition correct? If so, since you are passing a couple of scalar to the bottom while loop, so you are only plotting those single points
I have no idea what the Versuch2.vi is doing and how you are creating the channels. You need to have the channels in your DAQ Assistant added there. The format for multiple channels is Dev1/ai0,Dev1/ai2 or Dev1/ai0:ai2.
It sound likes you just need to add the DAQmx Write at the end of the VI. Just use the Build Array function on the outputs of the case statement and wire that to the DAQmx Write input.
05-12-2009 10:29 AM
Im an idiot! I just realized that i attached the wrong VI, the second attachement should have been the Coordinate Writing V2, which is a build up on the original version. Sorry about the confusion. Can you take a look at the new one and let me know what im doing wrong? That is the VI im having trouble with, not the Coordinate Reading one.
Sorry about that!
05-12-2009 10:57 AM
05-13-2009 02:39 AM
From reading other comments, i know that i cannot have 2 hardware tasks run simultaneously.
How do i combine the 2 channels into one task?
05-13-2009 04:43 AM
I figured it out, Thanks for your help.
I do have a follow up question though, i want to be able to plot the graph of the voltage across the Piezos (and hence the outputs) the whole time im ramping up the voltage to be able to gauge their response to the changing voltage. Any suggestions on how i can do this?
Attached is a copy of the modified VI.
05-13-2009 09:59 AM
05-14-2009 07:29 AM
Thanks for the help thus far. So rather than continuously plot the data, i want to save the data points in a spreadsheet instead with separate columns for the time and the 2 voltage values. One of the problems with the way i have it configured is that i get the values in pairs(in the same column) with a space inbetween every pair.
Any help you can give me on this will be great. I have attached the VI and a sample csv file of what the values look like.
Thanks.