From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Am i doing right programming PCI 6503 in Labview?

I'm
using PCI 6503 digital I/O with Labview version 8.2. Someone in our lab installed this I/O earlier. As I've downloaded traditional DAQ recently, I can see that this device is
now
under Traditional NI-DAQ of 'Devices and Interfaces' of Measurement &
Automation software and also recognized as 'Device-1' when I clik on the
'Properties' tab. What else I've to set in the
properties in terms of installation of this device. As you know, this device has three port namely '0', '1' and '2'
and has 8 lines on each of the port. Do I need to do anything in terms of
setting the port.

2nd Question:

Well, now I'm using this PCI card as a relay. In my labview program,
initially, I'm setting all the lines in a port to level low ('0') by using
'write to a digital port.vi' from the easyI/O of digital I/O palette as device number '1', port '0' (suppose), pattern
'0' (binary equivalent to '00000000') and connecting the initialize pin to
the
loop iteration (as I'm using this vi in a loop) and then activating a line
by
calling this VI again and by only changing the pattern to '1' which will
produce '00000001' binary equivalent and activate the first line i.e line
'0'.
Could you please tell me, whether i'm doing right?

I'll appreciate if you could answer the above two questions for me.  Thanks.
 
Mohammad
0 Kudos
Message 1 of 6
(3,739 Views)

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.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 2 of 6
(3,723 Views)

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

0 Kudos
Message 3 of 6
(3,705 Views)

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.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 4 of 6
(3,681 Views)
HI Mallori,
Thanks for your reply. I'm sorry, i didn't describe well of my problem with the VI that i have included. Let me tell you what i'm trying to do. The lockin amplifier is used to measure impedance of a resistor (suppose) for a range of frequencies. We use four electrode method to measure the impedance. In four electrode method, at each frequency, two electrodes are used across the resistor to measure the potential at both ends and two more electrodes are used to provide current which are also put across the two ends of the resistor. So the lockin amplifier measures the voltages at the two ends of the resistor and also the current that flows (lockin acutally measures the voltages rather than the current). So basically the lock in measures three voltages, one at a time. That is the reason, we are using relays, so that lockin can measure these three voltages when the relay is switched on.
 
So in the VI, the loop is used to get different frequncies. For each frequency, all 28 sequences are used to measure three different voltages using the switching between the relays through the PCI 6503.  Line# 0 of port# 0 is connected to one end of the resistor (that we are measuring) and line # 1 of port # 0 is connected with other end of the resistor. In both cases, line# 4 of port# 2 is high or ON. When line#3 of port# 2 is high (line#4 of port#2 is now OFF), then the lockin amplifier measures the current (or voltage) that flows in the resistor. So in the VI, in the sequencies,  I turn on line#4 of port#2 and line#0 of port#0 to measure the voltage at one end of the resistor. This is done by giving a frequency command to the lockin and wait for a while and  give two more output command (this is required by the lockin) to measure one voltage. Then, I turn off line#0 of port# 0 and turn on line# 1 of port #0  to measure the other voltage of the other end of the resistor.  And then finally, I turn off line# 4 of port# 2 and turn ON line#3 of port#2 to measure the current through the resistor in similar fashion. At the end, a sequence is used to do some math to find resistance and reactance for a particular frequency and the last sequence is used to plot the data.  So I'm using 8  loops to measure the impedance for 8 diffeerent frequencies.  So here is what i'm trying to do with this VI. 
 
I was really confused with the iteration terminal of the write to digital line vi. I thought i'll connect the iteration terminal to the loop iteration terminal to keep the configuration unchanged and i guess i was totally unsure what i was doing with this. I hope you understand what is my goal.  
 
Yes, i could see in the front panel of the lockin that when i run the VI, the frequency changes according to the program and there is no error comes in the error list after the run of the program. I'm just guessing that I might be doing something wrong with the activation of the relays ie with the PCI lines and ports. Could you please tell me, is there any obvious mistake in controlling the lines and ports of the PCI.  Your help is so very important and valuable to me. Thanks.
 
Ahad
0 Kudos
Message 5 of 6
(3,676 Views)

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.

Mallori M
National Instruments
Sr Group Manager, Education Services

ni.com/training
0 Kudos
Message 6 of 6
(3,651 Views)