Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Configuring PFI for Output on 6024E

I am new to this, so forgive me if my terminology is incorrect.

I am using the traditional Nidaq drivers 6.9.3 and working with the PCI-6024E card.
i wish to use PFI lines to output signals.

how can i do this ?

also, the following code throws an exception,

CWDIO.Ports(2).Assignment = cwdioOutput

There only seems to be 1 port. When i output Ports.Count, it returns 1. How do i configure the usuage of more ports ?

Much Appreciated
Meshan
0 Kudos
Message 1 of 5
(2,901 Views)
Hi Meshan,

There are a couple of question I would ask before but the answer to your questions is at the end.
What device are you using? Are you using the Component Works controllers for some special reason? What programming language are you using?
If you do not have any constrain to use Traditional DAQ, I would use DAQmx. Works with same programming languages, API is much better in many ways and you can read more and get started here.
There are lots of examples for C when you install the driver at this location: C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C

If you still need to use the CW API, you find a lot of help on the chm file here. All methods and properties I speak about are explained here.
Now, back to your answers (at least my suggestions):
What kind of signals you want to export to PFI? In general you would use the RouteIOSignal Method.
To write to multiple ports I would try to define the list first (use OutputPortList Property) because the property you use is read only (Ports Property (Read Only)).
Hope this helps,

Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 2 of 5
(2,889 Views)
Im using VB 6. The program is written already, and worked in numerous systems already. So its not a code issue.
The only difference is the PCI-6024E card and the previous programs were deployed on DAQ drivers 6.9.3.
Now im using the nidaq Traditional 7.4.1 drivers and Measurement & Automation Explorer 4.

I would like to export digital signals to PFI.

In the interface, when i add the CWDIO component, click "properties" , it only shows 1 port.
I need 3 ports for outputting. How do I add ports ?

The issue is, there only seems to be 1 port, so when i say "CWDIO.Ports(2).Assignment = cwdioOutput", it throws an exception.


I have a 24V opto-coupled 8Ch Input card connected to Port 0 (P0.0 - P0.4) and it is working fine.
I have a 8Ch relay output card connected to PFI inputs from PFI1(P1.1) to PFI4(P1.4), I need to configure these as outputs.

Alternatively if it is easier to read these PFI lines as inputs, then I could swop the input and outputs.

thanks again
0 Kudos
Message 3 of 5
(2,874 Views)
Hi Meshan,

What was the outcome of the functions I suggested before?
1)
RouteIOSignal Method: here is the prototype,
CWDAQTools.RouteIOSignal ( Device, Signal, Source [, SignalNumber = 0] [, SourceNumber = 0] [, SourceSpec = 0])

2)
OutputPortList Property.
For the assignment can you follow the example on the help file:
'Make this port output
CWDIO1.Ports.Item(0).Assignment = cwdioOutput



If you still need to use the CW API, you find a lot of help on the chm file here. All methods and properties I speak about are explained here.

You can use traditional DAQ calls as well under VB6 directly. Call function
DIG_Grp_Config. This is the prototype:
status = DIG_Grp_Config (deviceNumber, group, groupSize, port, dir)
You call it once for one port in one direction and other for the other direction.
Then use the functions:
DIG_In_Grp and DIG_Out_Grp to read the data.

You will find all the function calls and description using the help file located under Start » All Programs » National Instruments » NI-DAQ » Traditional Function Reference Help.

Hope this helps,
Gerardo O.
RF SW Engineering R&D
National Instruments
0 Kudos
Message 4 of 5
(2,860 Views)
Hi,
The problem was, we installed the incorrect card. The 6024E only had 1 port but with 8 lines.

Thanks,
Your information was very helpfull and i appreciate the time you toke to help me.


0 Kudos
Message 5 of 5
(2,852 Views)