06-09-2023 11:46 AM
I am simply trying to output a TTL from DIO4 in my 9401 which will happen after a trigger is detected in DIO0 in the same module. It is not working and I don't know why. I get this error:
Possible reason(s):
Specified read or write operation failed, because the number of lines in the data for a channel does not match the number of lines in the channel.
If you are using the Digital Waveform datatype, make sure the number of lines in the digital waveform matches the number of lines in the channel. If you are using boolean data, make sure the array dimension for lines in the data matches the number of lines in the channel.
Number of Lines in Channel: 1
Number of Lines in Data: 0
Task Name: _unnamedTask<0>
The 9401 module is connected to a cDAQ-9189 chassis. Any help would be appreciated, thank you.
Solved! Go to Solution.
06-09-2023 12:49 PM
Please post your code so that we can understand what's going wrong.
06-09-2023 01:31 PM
Woops I thought I did, here it is now.
06-12-2023 04:53 PM
I would also like to note that I have gotten this to work within the DAQ assist's UI so I am having trouble translating it to DAQmx tasks. I have tried converting my DAQ assist to code and I was still confused.
06-13-2023 12:40 PM
Update on this, I have managed to almost get it working how I would like. The issue right now is that the digital signal comes out too late after the trigger is set off. Can anyone provide any insight on how to make sure this doesn't happen? I expect to see my "Digital out" signal to look like a square pulse but instead it comes out like the image I attached. I believe this is because when the trigger happens, the digital task takes too long to start. Any help would be appreciated.
06-14-2023 09:53 AM
So does no one have any insight?
06-14-2023 10:32 AM
Your Digital out signal just looks like noise at the moment. Can you save your VI for LabVIEW 2019 or earlier and repost? (File - Save for Previous Version, 19.0)
06-14-2023 10:34 AM
Hope I did that right. Here it is. Thanks for responding.
06-15-2023 03:49 AM
Yes, that's fine thanks.
Can we just be clear what you are trying to achieve here? It looks to me like your VI does the following things:
You say that you have almost got it working - do you get any error messages? What are you using to generate the trigger to PFI0 - an external signal or something routed internally?
Also, is your screenshot of the waveform graph representative of an actual test? (I assume from this that you have the PFI0 and DO signals connected to two of your analog inputs). Neither Trig1 nor Trig2 appears to include a rising edge which would provide the reference point.
Can provide some more information and comment on the above?
Andy
06-15-2023 10:15 AM
To trigger my PFI0, I have a laser sensor that sends a 5V signal when activated, so an external signal. We can ignore trig 2 for my situation as the whole system kicks off trig 1/the first laser sensor. I don't have it wired to the channel displayed on the plot but it is still wired to my PFI0 so I can test. The screenshot is representative of an actual test, the signal is supposed to be my DO which I expect to appear as a square TTL but I think it is coming out too slow, I get no error messages. I did another test with the laser 1 wired and I have included a screenshot of what happened, the DO still comes out as noise and I think it is a timing issue.