Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

using the same point in seperate tasks

I have a need use PFI0 in seperate tasks that exist in different programs. One will write to it and the other will monitor the value only, but when I try to do this I always get this message from the one that is trying to write:

Error -200472 - Write cannot be performed when the auto start input to DAQmx Write is false, and timing for the task is not configured or Timing Type is set to On Demand. Set auto start to true, or configure timing and specify Timing Type other than On Demand.

Both tasks run continuously but aren't used for any pattern generation or reading.

Ed
0 Kudos
Message 1 of 5
(3,747 Views)
Hi Ed,

It looks to me like the error you are getting is not caused by the PFI line. It looks like you are calling a DAQmxWrite without first starting the Task. Does it work if you set autostart to true?

I do not think you will be able to use the PFI line from two different applications. Instead, you should route your signal to a RTSI line in one program and read from the RTSI line in the other. This is the best way to do it. If you need your signal to also appear on the PFI line, you can route it there too.

If you still have questions it will be helpful to see your code.

-Sal
0 Kudos
Message 2 of 5
(3,737 Views)
Sal, I am trying to avoid using jumper wires from one point to another. In another application I was using a digital output for Arm Start Trigger on a counter with a jumper to PFI0. Someone suggested it could be eliminated by using PFI0 as the digital output (I didn't know it was possible). It works fine.

This application is attempting to fit the PCI-6220 into old software that originally used a digital line to signal another program when an event happens. It works with a jumper from a DO to a DI line, but I was wondering how I could eliminate the jumper. Your idea of using RSTI is new to me and I don't know what that is. I will look for info but if you have a link that would be helpful.

Thanks, Ed
0 Kudos
Message 3 of 5
(3,733 Views)
Sal, I have read about the RSTI lines and it appears they can be internally routed to a PFI line on an M Series (PCI-6220) as you suggested. What I have tried to do is the following:

DAQmxConnectTerms ("/Dev2/PFI0", "/Dev2/RSTI0", DAQmx_Val_DoNotInvertPolarity;

So I am routing PFI0 to RSTI0, and PFI0 is also being used as an Arm Start Trigger to ctr0. When I try to start a task using RSTI0 as follows:

DAQmxCreateDIChan(m_hDITaskHandle, "/Dev2/RSTI0", "", DAQmx_Val_ChanPerLine);

I get the error -200478, specified operation cannot be performed when there are no channels in the task. But if I use a jumper wire to PO.0 and the following it works fine:

DAQmxCreateDIChan(m_hDITaskHandle, "/Dev2/port0/line0", "", DAQmx_Val_ChanPerLine);

Can't understand why this is not working, Ed
0 Kudos
Message 4 of 5
(3,722 Views)
Hi Ed,

The reason that you are getting the error is because you are trying to configure your physical channel to be an RTSI line. A physical channel cannot be an RTSI line.

int32 DAQmxCreateDIChan (TaskHandle taskHandle, const char lines[], const char nameToAssignToLines[], int32 lineGrouping);

In the function prototpye the "lines" must be a physical channel like Dev1/port0/line0:3. It cannot be a RTSI line.

You can use your RTSI lines for your sample clocks and trigger signals.

-Sal
0 Kudos
Message 5 of 5
(3,710 Views)