Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating different signals for different channels using HSDIO

Hi there, I have the following queries on labview. Hope I can get some solution from here as I am new to Labview.

 

I am using NI-PXI-6552 and Labview version 7.1 .  I have successfully generated different digital signals using HSDIO function. The problem now is that I want to assign these different digital signals to different channels so that eventually i can produce the relevant logics to my IC chip. 

 

Here's an example of what i need : Digital Signal 1 to Channel 0

                                                         Digital Signal 2 to Channel 1 and so on...

 

I have a total of 9 different signals to connect to 9 different channels.

 

I am currently using HSDIO to generate my signals.

 

Hope someone will be able to send me a sample VI on this problem.

 

This is the first time I use labview and I am very foreign to this program. I am in desperate need for an answer to this problem. Hope someone can help me on this.

 

 

0 Kudos
Message 1 of 9
(10,892 Views)

Hi there,

 

Is it impossible to do this using HSDIO commands/driver? I really need an answer to this. Hope someone will be able to help me on this.

 

Thanks you alot!

0 Kudos
Message 2 of 9
(10,851 Views)

Hi Keith,

 

As long as all of the channels you're generating have the same clock rate and start at the same time, it's absolutely possible to use multiple channels in a single generation session.

 

Do you have a VI that you're working on?  Does it give you errors?

 

If you post it , I can take a look and see what's going on.

 

Keith Shapiro

National Instruments R&D

0 Kudos
Message 3 of 9
(10,839 Views)

Hi there,

 

Thanks a lot for the reply. I managed to produce multiple signals for different channels using the same clock rate. I have attached my VI for your reference. If you connect channel 0, 1 and 2 into your oscilloscope, you will be able to see three different signals or rather, one square signal, one pulse signal and one signal with a series of different logics.

 

But I notice another problem. From what I viewed from my oscilloscope, the signals that I have generated is not continuous. At certain stages, all the signals go to constant logic '1' or logic '0'  before resuming to the desired signals.

 

So how do I generate a continuous signals using my VI? Or do I need to add in additional function block to make it continuous? 

 

Another question that I would like to ask is that can I generate multiple signals with different clock rate?

 

 

FYI : I have assigned only channel 0 to channel 2 to the VI and also assigned my card to the VI, you might want to change it to your assigned card.

 

I have modify my VI from the examples given by NI.

 

 

Thanks very much for the help.

 

0 Kudos
Message 4 of 9
(10,821 Views)

Hi Keith,

 

If you look at the script in your VI, you'll see that you're asking the 6552 to wait between samples.  Whenever the 6552 is waiting it transitions into the Idle state.  I'm fairly certain that the default Idle state is to hold the last value on the line.  Have you tried removing the wait statements from the script?  That might provide you with what you're looking for.

 

In general, I would recommend building complete waveforms.  For example, instead of using the script to build your waveform (especially in such small blocks), you could have built them using the array and just repeated a single waveform forever).  As your generation frequencies increase, so does the minimum waveform size.

 

Have you looked at the Digital Waveform Editor?  It provides a graphical approach to building waveforms and might be a lot easier to work with than building arrays.  There's an evaluation version that you can download here:

 

http://digital.ni.com/demo.nsf/websearch/02842c25fd0f1a2586256e30005e3d4a

 

Also, your 6552 only has one master clock for generation per board.  You can, though, approximate multiple different frequencies through oversampling.  The limitation is that the frequencies need to be integer divisors of a single master clock frequency.  So, let's say you needed to produce 50MHz, 33MHz, and 10MHz.  100M/50M = 2, 100M/33M = 3, and 100M/20M = 5.  You would repeat each sample that many times.  Here's the same pattern - 10100101  - for each of those frequencies:

 

50MHz:  1100110000110011

33MHz:  111000111000000111000111

20MHz:  1111100000111110000000000111110000011111

 

 

0 Kudos
Message 5 of 9
(10,799 Views)

Hi there,

 

Thanks very much for the help. Over the week, I have been exploring labview and my card and had identified quite a handful of problems relating to my project. Therefore I will like to take this opportunity to ask all of them using the thread. Hope you dont mind.

 

1. First of them, I am currently using your suggestion of arrays to construct my signals. But I had encountered a problem. I have generated 6 different signals using array and output from DIO 0 to DIO 5.    I notice that the signals coming out of DIO 1 to DIO5 is unstable when I viewed it in oscilloscope. Only DIO 0 has a stable signal. Therefore, I elimilated the possibility of wrong settings on my oscilloscope that might cause the displaying of unstable signals.  Can you recommend or attach an example on how to use array to generate signals? I might just have done it wrongly after all.  I have attached my VI for your referrance.

 

 

2. I found is that for DIO 0,  the voltage level is always higher than the rest of the channels. Why is that so? I am using NI-PXI-6552

 

 

3. For my project, I will need to firstly generate 6 signals to pump to my IC chips and then accquire 1 signal from the chip and finally generate another signal back to the chip. Will I be able to do this using one card? Or is it that for PXI-6552, we can only generate signals simultaneous?

 

4. Lastly, I would like to clarify my understanding of my card NI-PXI-6552.  In order to generate a certain signal for channel, I will need to enter the data in binary format?

 

For example :    Binary format : 1 0 1 1          means     channel 0,1 and 3 will get logic '1', while channel 2 will get logic '0' ?

 

 

I have attached my VI on using array to generate signals in this thread for your referrance

 

 

Sorry for the long post as I dont want to wait too long for ask those queries.

 

 

Thanks a lot in advance for the help.

 

 

Keith Tan

 

 

Message Edited by Keith Tan on 05-27-2009 10:53 PM
0 Kudos
Message 6 of 9
(10,778 Views)

1. First of them, I am currently using your suggestion of arrays to construct my signals. But I had encountered a problem. I have generated 6 different signals using array and output from DIO 0 to DIO 5.    I notice that the signals coming out of DIO 1 to DIO5 is unstable when I viewed it in oscilloscope. Only DIO 0 has a stable signal. Therefore, I elimilated the possibility of wrong settings on my oscilloscope that might cause the displaying of unstable signals.  Can you recommend or attach an example on how to use array to generate signals? I might just have done it wrongly after all.  I have attached my VI for your referrance.

 

When you say unstable I'm not sure what that means.  You've got a pattern that's approximately 20us long (1/(2MHz) * ~40 samples).  You're repeating that pattern forever.  There's nothing there for a scope to trigger on to show you your pattern.  My recommendation to see your pattern clearly on a scope is to adjust your script like so:

 

 script myScript1
        Repeat forever
            Generate wave1 marker0(0)

       end repeat
end script

 

This will cause a marker to be output on the first sample of your waveform each time it's repeated.  You can use the niHSDIO Export Signal.vi to route that marker to a PFI line.  If you use your scope to trigger on the marker, you should be able to see your pattern the way you expect.

 

 

2. I found is that for DIO 0,  the voltage level is always higher than the rest of the channels. Why is that so? I am using NI-PXI-6552

 

That's not expected.  The output lines are sourced from a common supply.  I noticed that you are not explicitly setting the voltage output levels in your VI.  So I would do two things - first, add the niHSDIO Configure Voltage.vi to your VI and explicitly set the output levels you want (VOL and VOH).  Second, make sure that the input impedance on your scope is set to the same for all of the channels.  Most scopes have an option for 1Mohm (or 10Mohm) and for 50ohms.  Make sure all your channels are set the same.

 

3. For my project, I will need to firstly generate 6 signals to pump to my IC chips and then accquire 1 signal from the chip and finally generate another signal back to the chip. Will I be able to do this using one card? Or is it that for PXI-6552, we can only generate signals simultaneous?

 

Acquisition and generation on the PXI-6552 can run simultaneously.  Do you know the expected result from your chip?  If so, you can use one of our advanced features - Hardware Compare - to functionally test and determine if the expected result is correct all from the 6552, which will decrease your test time per item.

 

If you are doing data collection or validation of a range of data, that's also possible.  If you look at the examples provided in with NI-HSDIO, you'll see that there is a library of examples for doing simultaneous generation and acquisition.

 

The PXI-6552 can even use a pin for both acquisition and generation at the same time, allowing bidirectional pins to be tested.

 

4. Lastly, I would like to clarify my understanding of my card NI-PXI-6552.  In order to generate a certain signal for channel, I will need to enter the data in binary format?

 

For example :    Binary format : 1 0 1 1          means     channel 0,1 and 3 will get logic '1', while channel 2 will get logic '0' ?

 

You are correct.  Using a binary representation for a U32 (32-bit unsigned integer) goes from MSB (bit 31) to LSB (bit 0) left-to-right on your screen.  The PXI-6552 also supports Labview's waveform data type and 'HWS' which is a waveform generated by our digital waveform editor.

 

For a U32 and the PXI-6552, here's how it breaks down:

 

31                                  19   16  15                                          0

XXXX XXXX XXXX 0000 0000 0000 0000 0000

 

Since the 6552 only has 20 channels, bits 20-31 are ignored.  Each bit is assigned to the channel number of the same value (bit 0 is assigned to channel 0).  Only channels that are specified in your channel list for niHSDIO Assign Dynamic Channels.vi are activated for a given generation session.

 

I hope that helps.  Please feel free to ask more questions.  I'm attaching your VI with the modifications I recommended.

 

Keith Shapiro

National Instruments R&D

Message 7 of 9
(10,769 Views)

My application is similar to this one too and Im also using PXI 6552. So thought this is the relevant thread to post my queries. I'm a total newbie to Labview so apologize if some of my questions look trivial.

 

1.I have to get Labview to operate in a certain sequence. The first is a start up sequence consisting of three signals say signal A, B and C. Sig A needs to stay low for the entire time in this sequence, Sig B needs to stay low at the start and toggle to high and Sig C also needs to stay high for the entire time in this sequence. But Im not sure if this falls under static generation or the dynamic generation. The signal that toggles can toggle at any point and timing is not all that important. I know Sig A and C can be generated using a simple Static generation VI, but Sig B is the one that's holding me off. Any example would be highly appreciated.

 

2. The second sequence is a SPI sequence. I have used the SPI Reference Digital Wavefwn library on the NI website to integrate it with my HSDIO signals to create a SPI interface. This SPI should also acquire on the same channel used for Sig B in the start up sequence above.I do not know how to make my start-up and SPI phases run sequentially and use the same channel in both the phases one after the other. Can I use a HSDIO Init and Close on Channel B for start - up sequence and use them again in the SPI sequence? 

 

3. I was planning to use Stacked Sequence VI to separate out the above two phases. Any better ideas? And If I do use stacked sequence, how do I specify how much time to stay in each frame?

 

Thankyou

Priyatham.

0 Kudos
Message 8 of 9
(10,763 Views)

Priyatham wrote:

My application is similar to this one too and Im also using PXI 6552. So thought this is the relevant thread to post my queries. I'm a total newbie to Labview so apologize if some of my questions look trivial.

 

1.I have to get Labview to operate in a certain sequence. The first is a start up sequence consisting of three signals say signal A, B and C. Sig A needs to stay low for the entire time in this sequence, Sig B needs to stay low at the start and toggle to high and Sig C also needs to stay high for the entire time in this sequence. But Im not sure if this falls under static generation or the dynamic generation. The signal that toggles can toggle at any point and timing is not all that important. I know Sig A and C can be generated using a simple Static generation VI, but Sig B is the one that's holding me off. Any example would be highly appreciated.

 

2. The second sequence is a SPI sequence. I have used the SPI Reference Digital Wavefwn library on the NI website to integrate it with my HSDIO signals to create a SPI interface. This SPI should also acquire on the same channel used for Sig B in the start up sequence above.I do not know how to make my start-up and SPI phases run sequentially and use the same channel in both the phases one after the other. Can I use a HSDIO Init and Close on Channel B for start - up sequence and use them again in the SPI sequence? 

 

3. I was planning to use Stacked Sequence VI to separate out the above two phases. Any better ideas? And If I do use stacked sequence, how do I specify how much time to stay in each frame?

 

Thankyou

Priyatham.


 

1.  If timing isn't that important, you can use HSDIO static generation.  Once you write a static value, you can then write another value.

 

2.  You absolutely can use an init/close and then do another set of operations.  Something to keep in mind is that your pins will hold their last value after you close the session, so as you move into your SPI code you'll need to deliberately tristate that line using the Tristate VI.

 

3.  A stacked sequence is fine for defining order.  If you need each frame to last for a minimum amount of time, then you can just add the Wait VI.  Since everything in the VI runs in parallel, and all VIs in each frame must complete before moving to the next, you can guarantee that each frame will last at least as long as your wait.

 

I've attached a VI that shows multiple static writes without closing the channel.  Hope that helps.

 

Thanks,

 

Keith Shapiro

National Instruments R&D

 

 

0 Kudos
Message 9 of 9
(10,714 Views)