12-13-2007 11:01 AM
12-14-2007 03:29 PM
Hi Mohammad,
To answer your questions, you do not need to anything else in MAX in terms of setting the port. The VI will configure the port in your LabVIEW program. With regards to your second question, yes, the method you described works. I built a program and tested it here and the Write to a digital port.vi initializes on the first iteration and then writes a value to the line.
I would suggest looking at Traditional DAQ examples programs. These can be found by going to the Help Menu and selecting Find Examples. When the NI Example Finder box appears, under the Browse Tab on the left hand side you will need to select Directory Structure. When the new set of file appears, expand the daq folder>> expand the digital folder>> then expand the E-series.llb file. I would suggest looking at the Write to 1 Dig Port (E).vi example, since this program is already written for you.
I am unclear as to your application and what you want to eventually do. You had mentioned in your post that you are using the 6503 card as a relay. Will you be using all 24 channels, or only a few? Will you only being writing a value to that channel once each time the program is run or will you want to change the value back and for the between high and low while running? A better description of your end goal would be helpful if you post back.
Best of luck with your application, Mallori M.
12-17-2007 10:22 AM
Hello Mallori,
Thanks for your answer of my questions. Here I've attached the VI that I'm designing. I'm using Labview version 8. I'm in fact operating a lockin amplifier (7280 of Signal Recovery) through this program (I've collected the driver for this machine and using the getting started VI to make my own VI). Here I'm changing the frequency of the machine and getting the output for each frequency. So the loop in this VI is actually doing the frequency sweep. If you look at the loop, initially I'm activating two lines of the PCI 6503 card which is connected to the input of the lockin so it can measure the voltage that is inputted. The later sequences are just inputting the frequency command and getting the responses of the machine with further output command.
I'm just wondering, is this correct way to activate the line of the PCI card, The seqeunce of activating the lines are correct but I'm not getting the correct results from the machine as expected. Machine is taking the command as I can see in the front panel of the machine where it shows frequency changes with the change of freqeuncy in the loop. Could you please tell me whether the activation and the closing of the digital lines are done correctly. As you said, I don't have to do any configuration for the PCI card, and that's what i did. The device is named as number 1 in the configuration, that's all what is being done in terms of configuration of the device in it's properties option. I'll really appreciate any help from you. Thanks again.
Ahad
12-18-2007 06:20 PM
Hi Ahad,
I wanted to clarify my understanding of your application and of the problem. You have a PCI-6503 that you are using to output digital lines that will control what frequency a lockin amplifier looks at. Initially, you write values to two lines of your 6503. I am unclear as to what you meant when you said that you can measure the voltage that is input. But then you write values to the digital lines that the lockin amplifier interprets as frequency commands and then you display what the amplifier outputs at that frequency. Is the sequence structure causing the frequency sweep, which you perform 8 times? Or do you sweep through 8 different frequencies, and the sequence structure configures one frequency setting?
You mentioned that the amplifier is not returning outputs that you expect. Are you receiving any errors? You mentioned that you knew the amplifier was receiving the commands because you could see the frequency changing on the front panel of the amplifier.
I had some difficulty with your code. The way that the Write to Digital Line.vi works is if no value is input at the iteration terminal, it assumes a default of zero and takes time to reset the digital lines so that they are all low. If you do not need to set all of the lines to low in between writing to one of the lines, then you can wire the iteration terminal of a loop, or a constant value other than 0 to the input terminal of the write function.
What you code does, is for each sequence in the first loop, a value of zero is written to the iteration terminal, i.e. between each sequence with a write function all of the 6503’s lines are set to low. The last time this reset occurs is in sequence 26 of loop 0, where you write a low value anyways. From loop 1 on, the lines are not reset between sequences, maintaining the values that were previously written to them. This means that in sequence 2 of loop 1, not only is line 2 of port 0 changed to high, but line 4 of port 2 has stayed high.
Is this the desired behavior? Were you perhaps trying to address this in some way when you add 0 to the iteration count of the For loop? The iteration terminal will be the same for all 28 sequences of the same loop.
I hope this explanation helps. Good Luck,
Mallori M.
12-18-2007 10:42 PM
12-20-2007 12:45 PM
Hi Ahad,
Since I do not have the driver for you Lock-in Amplifier, I am unable to get your program to run on my computer and my help will be limited. However, looking through the sequences in your program, I did want to point out some things I noticed and make a suggestion.
First to address your questions about the iteration terminal. I would suggest wiring a constant of 0 to the iteration terminal of the Write to Digital Line.vi in sequence 0. For every sequence after that, wire a constant of 1 to the iteration terminal. This will cause the 6503 card to reset at the beginning of each of the eight loops but maintain its written values through the sequence structure.
Second, as I was progressing through the sequence structure, I noticed that in sequence 9 and sequence 11, the Boolean values you write to the lines are reversed from what you described in your previous post. In the attached VI, in sequence 9 you are actually turning off line #1 of port #0 and in sequence 11 you are turning on line #0 of port #0. You might want to ensure that this is what you intend. Also, in sequence 24, you turn line#0 of port #0 to low, and it seems, if I am correct that the above values were switched, that you might have meant to turn line #1 of port #0 to low.
I hope that this helps straighten out your program errors. Good Luck, Mallori M.