LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Event structure" can't work in "While Loop"

Solved!
Go to solution

@chen3477 wrote:

I add a waiting time because I found it couldn't produce array one-by-one. Now it can create in a sequence like 0.001, 0.002 and without a time delay it can't work at the regular interval of 0.001. I don't know why.


Timing is separate from data. your statement makes no sense at all. Without timing, it happens so fat that all you see is the final result.

0 Kudos
Message 11 of 23
(1,023 Views)

My desire is to create a 1000-dimension array. The first 700 elements add from 0 up to 1 and the later 300 decrease from 1 to 0.

0 Kudos
Message 12 of 23
(1,018 Views)

Yeah I do find the ramp pattern. I need to output the analog voltage signal via DAQ but I don't know how to connect the ramp pattern with the DAQ.

0 Kudos
Message 14 of 23
(1,008 Views)

Simple example with on-demand timing (you probably don't want this, but it at least points you in a direction for:


@chen3477 wrote:

I need to output the analog voltage signal via DAQ but I don't know how to connect the ramp pattern with the DAQ.


daqmxout.png

 

Is that basically what you want?


GCentral
0 Kudos
Message 15 of 23
(969 Views)

Exactly! Thanks! But I wonder how can I control the frequency since there is not a time loop structure? And I found some data was missing or delayed.

0 Kudos
Message 16 of 23
(935 Views)

Put a while loop around the For loop in cbuther's code and do NOT use the continuous run button.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 17 of 23
(926 Views)

@chen3477 wrote:

Exactly! Thanks! But I wonder how can I control the frequency since there is not a time loop structure? And I found some data was missing or delayed.


Because after each segment, you are configuring the IO from scratch, which takes time of course. Can't you give it the entire array of N samples and use continuous hardware-timed output? If course, as Ben already said, only the inner daq part should be repeated, not the entire code. Look at the shipping examples.

0 Kudos
Message 18 of 23
(906 Views)

@altenbach wrote:

A RT target does not have a UI, so an event structure is useless.

 


Bit of a sidetrack here, but couldn't you use the event structure for User Events and DAQmx Events on a RT system? (I never do any RT programming, but I assumed those use cases would work in RT)

Message 19 of 23
(894 Views)

@BertMcMahan wrote:

@altenbach wrote:

A RT target does not have a UI, so an event structure is useless.

 


Bit of a sidetrack here, but couldn't you use the event structure for User Events and DAQmx Events on a RT system? (I never do any RT programming, but I assumed those use cases would work in RT)


You are correct.

 

Spoiler

 

So for anyone keeping score that brings Christian up 2 when we recall he once posted "1 can not be represented in binary."

 

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 20 of 23
(887 Views)