From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

HSDIO script generation problem

hi,

 

I'm trying to generate finite generation using HSDIO script generation. Simply said, I'm generating 3 types of digital datas:

1. ramp

2. sinewave

3. constant

 

I'm generating this waveform in serial way, and have possibility to add delay between each point of my waveform.

 

This screenshot is the script to generate my waveform. I have 40 bit of "0" and "1" as one point of data. And I use the same card (in different VI) to acquire the generated data using rtsi0 as start trigger to trigger the acquisition whenever the generation occurs.

 

script.png

 

I'm not generating both signal at the same time, but I can choose which signal I would generate in frontpanel.

 

And now, when I put delay between each point of data, it works fine by ramp generation but not by sinewave generation. Screenshot:

 

 

script2.png

 

 

I dont have any idea what might the source of the problem here, the script generation of my sinewave doesnt give me that delay, even I got the script with delay.

 

regards,

Yan.

Download All
0 Kudos
Message 1 of 4
(5,055 Views)

ok, found my error source.

 

I'm generating my ramp using "script" (niHSDIO configure generation mode), and generating my sinewave using "waveform". Thats why the delay on the script wouldnt be generated.

 

But I chose to generate my sinewave using waveform, the reason was: so I can use property node "repeat count", so I wouldnt have problem to repeat a waveform generation.

 

I'm trying to use repeat finite in the script in my sinus generation, but for low frequency sinewave (more points per cycle), I keep getting error.

 

Repeat finite in script generation cant repeat more than 47 lines of commands. What should I do to trick this?

 

regards,

Yan.

0 Kudos
Message 2 of 4
(5,046 Views)

I found something interesting between script generation and waveform generation to generate sinewave using HSDIO:

 

script generation:

- no problem to add start delay (using wait)

- no problem to change delay between each data (using wait)

- problem with repeat (cant repeat finite more than 47 line of generations??)

 


waveform generation:

- problem to add start delay (especially for long delay time)

- not a big problem to change delay between each data

- no problem with repeat (can repeat any generated waveform), but it will repeat waveform and the start delay that generated.

 

I'm looking for possibility to generate start delay, then sinewave (might be repeated cycles).

0 Kudos
Message 3 of 4
(5,040 Views)

Hello Mystogan,

 

since I can't see the code I would suggest a work around:

 

Have you tried to generate values of zeros instead of using the the wait command?

 

- Lam

0 Kudos
Message 4 of 4
(4,950 Views)