Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Program vi for Toggle Lines Testpanels HSDIO

Solved!
Go to solution

Hallo everyone,

 

I have a question regarding testpanels of HSDIO in MAX. There is an option in MAX to generate datas in various forms of digital datas:

RAMP / TOGGLE LINES / MARCHING ONES / MARCHING ZEROS / RANDOM.

 

ToggleLines.png

 

And most examples using HSDIO are generating the datas using RAMP method. I've been trying to look but I couldnt find the other methods of data generation. I really need the program to generate the data with TOGGLE LINES method. Have tried to use the express gen block, but doesnt help me either. I believe it shouldnt be a complicated built in program, but somehow I cant think what should I do to generate such waveform. I need two channels to generate the same signals like in the picture above.

 

I have tried generating the ramp and connecting one channel with another one unused channel, but the voltage got dropped and therefore I dont want to use that method. I need later to add delay to one channel, but I believe I can get something from one example from NI (dynamic generation with data delay).

 

regards,

Yan.

0 Kudos
Message 1 of 7
(4,861 Views)

You might want to look into a square wave generation.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(4,854 Views)

hi, thanks for response.

 

I'm trying to generate only 2 bits data, and I dont think it has anything to do with square wave generation. The problem is, HSDIO write.vi takes the data that I want to wite in parallel way. For example, we can build 4 steps ramp with:

 

ch1 | ch0

0    | 0        (numeric: 0)

0    | 1        (numeric: 1)       

1    | 0        (numeric: 2)

1    | 1        (numeric: 3)

 

and I think I just need to rotate the 0 0 (numeric 0) and 1 1 (numeric 3) forever, without including 0 1 and 1 0. I'm trying to look the examples using script. Maybe it can help.

 

regards,

Yan.

0 Kudos
Message 3 of 7
(4,847 Views)

hi,

 

I've figured it out. With using dynamic generation with script.vi I can manage to get (almost) what I want. The key is rotating 0(binary: 00) and 3(binary: 11) for 2 channels and using script repeat forever.

Or rotating 0(000) and 7(111) for 3 channels.

 

0 3 rotate and generate.png

 

this trick gives me half frequency of clock rates in both channels, but what I need is 1/4 of clock rates in both channels.

And I need also to find out how to put the delay in one channel.

Any suggestion?

 

Regards,

Yan. 

0 Kudos
Message 4 of 7
(4,844 Views)
Solution
Accepted by topic author Mystogan

Hi Yan,

 

To get 1/4 clock rate on two channels, it would look like this:

 

00

00

11

11

00

00

11

11

 

You oversample the data and then you get two channels with 1/4 clock rate output frequency.

Kyle A.
National Instruments
Senior Applications Engineer
Message 5 of 7
(4,841 Views)

thanks kyle,

 

to push the 2nd clock 1/4 periode from the 1st clock, I need: 

00

01

11

10

00

01

11

10

= sequence of 0-1-3-2-0-1-3-2

 

and 1/2 periode:

01

01

10

10

01

01

10

10

= sequence of 1-2-1-2-1-2-1-2

 

I can manage to create the 2nd sequence. But the first one, I'm not sure how 😞

 

regards,

Yan.

0 Kudos
Message 6 of 7
(4,820 Views)

hi,

I've managed to get them working properly. Now I need them to work at the same time with a static generation using the same board. I've looked here (http://www.ni.com/white-paper/3528/en) and here (http://forums.ni.com/t5/Digital-I-O/Getting-the-6551-to-do-BOTH-dynamic-generation-ch-0-7-and-Static...

But somehow I cant get the dynamic generation working properly when I assign them in channel 16-31 (I'm using 6544, it has 32DIO). It runs normal in labview, but I dont see anything in ch.16 using scope.

My problem: I need to generate the static value with delay (I'm using sequence structure) using 5 channels (1 channel with delay, 4 channels without) and dynamic signal with using 2 channels. I need them to start working at the same time. But it seems I cant have abort.vi (to cancel out the loop script) working at the same time with static generation (I'm getting error message: invalid task).

 

regards,

Yan.

0 Kudos
Message 7 of 7
(4,805 Views)