Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulated PCI-6515 not working with VC++ samples

Hi!
I'm trying to simulate the PCI-6515 Digital I/O card and test the Visual C++ samples using input ports "Dev1/port0/line0:7"
1) I created a simulated Digital I/O device in MAX.
2) I can compile and run any of the samples (ReadDigPort.c, ReadDigChan-ChangeDetectionEvent.c), they are working returning the input port value=00. That's OK.
3) Now I need to simulate some input signal. I'm starting "Test panels" in MAX and running any of the VC++ samples.
I'm getting:
DAQmx Error: Requested operation could not be performed, because the specified d
igital lines are either reserved or the device is not present in NI-DAQmx. It is
 possible that these lines are reserved by another task, the device is being use
d through the Traditional NI-DAQ interface, or the device is being reset.
If you are using these lines with another task, wait for the task to complete.
If you are using the device through the Traditional NI-DAQ interface, and you wa
nt to use it with NI-DAQmx, reset (initialize) the device using the Traditional
NI-DAQ interface. If you are resetting the device, wait for the reset to finish.
Device:  Dev1
Task Name: _unnamedTask<0>
Status Code: -200587
Please explain me how can I simulate input signals with "simulated" PCI-6515 and read them in my software ?

Thank you
 
Best regards,
Jurijus Cizas,
Applications engineer,
Infineon Technologies North America
0 Kudos
Message 1 of 6
(3,950 Views)
Hi Jurijus,

It looks like you are trying to read and write data from the same lines on the PCI-6515 board.  If you look at the DataSheet for this device you will see that ports 0-2 are configured for one direction and then ports 3-5 are for the other direction.

The error that you are getting is probably this one:
Error -200587 occurred at DAQmx Start Task.vi
Possible reason(s):

Requested operation could not be performed, because the specified digital lines are either reserved or the device is not present in NI-DAQmx.

[more stuff]


Essentially the error tells you just what you need to know.  You are trying to read from the same lines that you are writing to.  This module can read from one bank and then write to another, but cannot do both read and write on any one bank.  As a result you need to make sure that your program takes that into account.

Finally, these are simulated devices that you are trying to create.  While some of the functionality exists as for a real device there are certain things that you cannot simulate.  You will not be able to write something out on one digital port and then try to read back that signal on a different port.  Essentially the simulation allows you to check for any serious errors in your development, but won't necessarily give you any good or relevant data for your task.

Your options right now stand to make sure to read and write from different banks.  Keep in mind that the read and write tasks cannot be linked to one another and that the simulation is only meant as a development tool to see if any errors would occur.

Regards,
0 Kudos
Message 2 of 6
(3,942 Views)

Hi Matt,

Thanks for coming back to me so soon.

Probably screenshots will not come through this window, see attached Word document with full my reply.

Actually the problem is different.

I'm only trying to read the PORT-0 (which is input port on PCI-6515), I'm not writing to it.
I'm using one of the C++ samples (without modification) included in NI-DAQmx: ReadDigPort.c - only reading !
And it works fine !
... Until I try to simulate the input signal on port0 by starting "Test panels" in MAX.

See attached document with full screenshots

May be I'm doing something wrong.   Please explain me how can I simulate a PCI-6515 input to test my VC++ program. I' need ONLY INPUTS

Thank you

Sincerely,
    Jurijus Cizas
        Infineon Technologies North America Corp.
        AIM CC
        Applications Engineer


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

Hi Jurijus,

Once again, this is the same issue that you were running into earlier.  You can only read or write from one bank at any one point in time.  When you try open a test panel from the simulated 6515 in MAX it automatically makes ports 0-3 as read ports and ports 4-7 as write ports. 

What is happening in your situation is that you are trying to run two iterations of the read task on the same port on the same board at the same time.  That creates the error that you are seeing.

Once again, the simulated devices are just for diagnostics and you will not be able to send a simulated signal out on one line and then read it on another line.  The simulation allows you to test your code for any errors that would occur.  In this case the errors are occurring because of the reasons stated in the error codes.  If you want to avoid the errors then either read the port in MAX or in LabVIEW, but don't try to do both at the same time or you will keep seeing the errors.

Regards,

0 Kudos
Message 4 of 6
(3,930 Views)

Hmmm, strange kind of simulation... I thought simulator can be used for testing my software without having the card ?

If I got it right, there is no way to simulate single digital input line on "simulated PCI-6515" so that my software could detect for example 0 to 1 transition. Right ?

Sorry for troubling again and again. We are in process of vendor selection for our new project.
Simulator was a serious benefit comparing to other vendors (AdLink and Advantech).
We need some way to test our SW without having a PCI card slot (in laptop)
 
Thank you
 
Best regards,
Jurijus Cizas
0 Kudos
Message 5 of 6
(3,927 Views)
Hi Jurijus,

I definitely understand where you are coming from desiring a bit more dynamic simulated devices ability.  I think you will find that the features you are looking for do actually exist to a certain extent.  You want the digital lines to toggle and they do (they slowly count up).  You can actually see that behavior when you look at a Test Panel for ports 0-3.  You will see the bits slowly incrementing.  This feature allows for some testing ability, but it is not very complex. 

We would like to have greater flexibility with the simulated devices, but then it quickly becomes very complex and there are such varying needs for each customer that it would be hard to have one thing that met the needs of all developers.

In the meantime you can continuously read a digital port and you will see the port increment.  The simulated device cannot take the full place of a real device, but it can give you a head start on your development needs.

All the best,
0 Kudos
Message 6 of 6
(3,916 Views)