09-14-2015 07:17 PM
I'm trying to accomplish something very simple with cDAQ-9181 and the cRIO-9401 hardware: when a trigger occurs, wait 20 ms and then set some digital output lines. Reading through the documentation for the cDAQ-9181 and the cRIO-9401, I see that there is a PFI0 trigger; I don't see a physical input for that, so I assume it is implemented internally in some way. I tried using a digital input as a trigger, but I get error -200524 with my code. I have looked though the examples, but I don't see how to do it with my hardware. Please help. Thank you. See attached png for the block diagram.
Solved! Go to Solution.
09-14-2015 08:01 PM - edited 09-14-2015 08:02 PM
I believe you selected DAQmx Write (Digital 1D Bool NChan 1Samp 1Line). You have more than 1 line and just one channel so you need to pick DAQmx Write (Digital 1D Bool 1Chan 1Samp).vi
09-15-2015 11:29 AM
Thank you for the response. It sounds like a single digital line input can trigger only a single digital line output. I have re-written the code to have individual references for each digital output (see attached). Does this look like a reasonable approach? Do I need to configure the triggering line as a digital input?
Your assistance is much appreciated.
09-16-2015 12:43 PM - edited 09-16-2015 12:44 PM
I'm not sure that will work. If you run into trouble it might be because, if you put a physical resource (line) in multiple tasks as you are doing below, the second "create task" will fail because the physical resource is already in use.
Did you try DAQmx Write (Digital 1D Bool 1Chan 1Samp).vi that sort of sounds like what you are looking for. You might need a little application logic to software time the delays.
09-16-2015 05:03 PM
Using just 1 sample/1 channel gives me Error -200262.
DAQmx Start Task.vi
Property:
Start.Trig type
Corresponding Value:
Digital Edge
Property:
SampTimingType
Corresponding Value:
On Demand
Looks like maybe I can't just wire a digital line to the trigger input. Any ideas on how to implement the trigger input?
Thank you for any assistance you can offer.
09-16-2015 05:05 PM
Just saw your posting at 12:44 pm. I will try this. Thank you.
09-18-2015 03:51 PM
I tried using DAQmx Write (Digital 1D Bool 1Chan 1Samp).vi utility, but I get the following error:
Error code: -200524
Number of channels in task: 1
Number of channels in data: 4
See attachment for code. Sorry this is turning into such an issue, I thought it would be fairly straightforward.
09-21-2015 05:17 PM
Hi Chris_12345,
DAQmx Create Channel has an input called 'line grouping', which you can use to specify how you'd like your data to be written with respect to lines; right click that and select Create -> Constant. On the constant that appears on your block diagram, make sure 'one channel for all lines' is selected. This should ensure that LabVIEW associates each boolean value in your 1D array with the proper line.
09-24-2015 07:52 AM
Tom,
Thank you for your response. I wired the constant 'one channel for all lines' to DAQmx Create Channel. This was the default value, so I think this would not have any effect. Do you have any other suggestions?
Chris
09-25-2015 05:05 PM
Hi Chris,
Just for clarification--you are also receiving error -200254 for when using DAQmx Write (Digital 1D Bool NChan 1Samp).vi? Is the error the same in that case (i.e. does it still indicate 1 channel in the task and 4 channels in the data)?