Quantcast
Channel: Digital I/O topics
Viewing all articles
Browse latest Browse all 2183

Need help with outputting digital data using the NChan Nsamp function

$
0
0

Hello All,

 

I am writing to this form in the hopes of getting some insight in to what I am doing wrong with an application that I am trying to build to output digital data. 

 

I must warn all those who might cringe as they witness how I went about achieving my goals that I have not programmed in labview for over 5 years so I am very rusty. I am fairly certain that there is something incredibly wrong with the way I am attempting to get this system to output digital data.

 

My setup is as follows:

 

NI PCI-6254 Device (dev1)

BNC – 2110 breakout box

Labview Version 2013 32 bit

 

I have another NI card in the system which is designated as DEV 0 in NIMAX as shown below. 

 

1.jpg

I setup my block diagram as follows:

 

2.jpg

 

The way I set this up was to utilize the first three lines in port zero of dev1 as my digital output. I setup the channel for digital output and for each line to have a channel of their own.

 

I set the sample clock to utilize the PFI0 port on the NI card such that I could control the rate at which the pulses are being sent out by the NI card. I have a TTL pulse driving the PFI0 input. I set the sample rate to around 500 and the active edge to rising. I have the sample mode set to finite samples and I have an indicator for the number of samples written by the digital output write function.  

 

The reason I chose such a low rate is because I have my ttl clock to around 8 Hz so it would be easy to watch the transitions when the function wrote the digital data out to the selected lines. 

 

3.jpg

 

The problem that I have with this setup is that I do not get any digital output on the P0, P1, and P2 outputs when this program is running. I have tested these outputs using the test panels in NI MAX and they do in fact work when toggling the logical state in the test panel run mode. I am not sure why this program is indicating that it is writing 8 samples per channel and yet I see nothing on the output when I monitor all of the channels with a scope.

 

Another thing I found perplexing is that when I initially set this up I configured the N samples N channels data type to U8 but when I attempted to run the program it crashed and indicated that I needed to set it to 32 bits. I do not understand why I needed to set it to 32 bit when the source array elements are U8.

 

I am quite certain I am doing something incredibly stupid but I have spun my wheels for more than a week on this so now I am appealing to the experts. I would really like to stick with the method of feeding an array of data in to the Nchannel and N sample function. I am aware of the wiring a Boolean array method and I was hoping to not have to go that route. I appreciate and assistance anyone can provide me.

Thank you in advance.

 

- Randy

 


Viewing all articles
Browse latest Browse all 2183

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>